-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QE]test case update for linux default network change to user
- Loading branch information
Showing
5 changed files
with
35 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,21 +213,20 @@ func InitializeScenario(s *godog.ScenarioContext) { | |
} | ||
|
||
if tag.Name == "@proxy" { | ||
|
||
// start container with squid proxy | ||
err := util.ExecuteCommand("podman run --name squid -d -p 3128:3128 quay.io/crcont/squid") | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
|
||
err = util.ExecuteCommand("crc config set http-proxy http://192.168.130.1:3128") | ||
err = util.ExecuteCommand("crc config set http-proxy http://host.crc.testing:3128") | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
|
||
err = util.ExecuteCommand("crc config set https-proxy http://192.168.130.1:3128") | ||
err = util.ExecuteCommand("crc config set https-proxy http://host.crc.testing:3128") | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
|
@@ -239,6 +238,20 @@ func InitializeScenario(s *godog.ScenarioContext) { | |
os.Exit(1) | ||
} | ||
|
||
err = util.ExecuteCommand("crc config set host-network-access true") | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
|
||
} | ||
|
||
if tag.Name == "@system_network" { | ||
err = util.ExecuteCommand("crc config set network-mode system") | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
} | ||
} | ||
|
||
|
@@ -358,6 +371,14 @@ func InitializeScenario(s *godog.ScenarioContext) { | |
} | ||
} | ||
|
||
if tag.Name == "@system_network" { | ||
err := util.ExecuteCommand("crc config unset network-mode") | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
} | ||
|
||
} | ||
|
||
return ctx, nil | ||
|
@@ -961,9 +982,6 @@ func PodmanCommandIsAvailable() error { | |
csshk = filepath.Join(userHomeDir, ".crc/machines/crc/id_ed25519") | ||
dh = "npipe:////./pipe/crc-podman" | ||
} | ||
if runtime.GOOS == "linux" { | ||
ch = "ssh://[email protected]:22/run/user/1000/podman/podman.sock" | ||
} | ||
|
||
os.Setenv("PATH", path) | ||
os.Setenv("CONTAINER_SSHKEY", csshk) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,9 +57,6 @@ var _ = Describe("podman-remote", Serial, Ordered, Label("microshift-preset"), f | |
csshk = filepath.Join(userHomeDir, ".crc/machines/crc/id_ed25519") | ||
dh = "npipe:////./pipe/crc-podman" | ||
} | ||
if runtime.GOOS == "linux" { | ||
ch = "ssh://[email protected]:22/run/user/1000/podman/podman.sock" | ||
} | ||
|
||
os.Setenv("PATH", path) | ||
os.Setenv("CONTAINER_SSHKEY", csshk) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters