diff --git a/test/e2e/features/config.feature b/test/e2e/features/config.feature index 2128c4dbf5..d0efc32659 100644 --- a/test/e2e/features/config.feature +++ b/test/e2e/features/config.feature @@ -79,18 +79,20 @@ Feature: Test configuration settings Examples: | property | value1 | value2 | | skip-check-bundle-extracted | true | false | - | skip-check-crc-network | true | false | - | skip-check-crc-network-active | true | false | | skip-check-kvm-enabled | true | false | | skip-check-libvirt-driver | true | false | | skip-check-libvirt-installed | true | false | | skip-check-libvirt-running | true | false | | skip-check-libvirt-version | true | false | - | skip-check-network-manager-installed | true | false | - | skip-check-network-manager-running | true | false | | skip-check-root-user | true | false | | skip-check-user-in-libvirt-group | true | false | | skip-check-virt-enabled | true | false | + + # the following properties not suit for user notwork + #| skip-check-crc-network | true | false | + #| skip-check-crc-network-active | true | false | + #| skip-check-network-manager-installed | true | false | + #| skip-check-network-manager-running | true | false | @windows Examples: @@ -118,12 +120,9 @@ Feature: Test configuration settings When removing file "crc.json" from CRC home folder succeeds And executing single crc setup command succeeds And executing "sudo virsh net-list --name" succeeds - Then stdout contains "crc" - When executing "sudo virsh net-undefine crc && sudo virsh net-destroy crc" succeeds - And executing "sudo virsh net-list --name" succeeds - Then stdout should not contain "crc" + Then stdout contains "default" - @linux + @linux @system_network Scenario: Running `crc setup` with checks enabled restores destroyed network When setting config property "skip-check-crc-network" to value "false" succeeds And setting config property "skip-check-crc-network-active" to value "false" succeeds @@ -131,7 +130,7 @@ Feature: Test configuration settings And executing "sudo virsh net-list --name" succeeds And stdout contains "crc" - @linux + @linux @system_network Scenario: Running `crc start` without `crc setup` and with checks disabled fails when network destroyed # Destroy network again When executing "sudo virsh net-undefine crc && sudo virsh net-destroy crc" succeeds diff --git a/test/e2e/features/proxy.feature b/test/e2e/features/proxy.feature index 7374ba9718..909a8fc746 100644 --- a/test/e2e/features/proxy.feature +++ b/test/e2e/features/proxy.feature @@ -4,7 +4,7 @@ Feature: Behind proxy test Check CRC use behind proxy # inherits @proxy tag from Feature - @cleanup + @cleanup @system_network Scenario: Start CRC behind proxy under openshift preset Given executing single crc setup command succeeds When starting CRC with default bundle succeeds diff --git a/test/e2e/features/story_openshift.feature b/test/e2e/features/story_openshift.feature index 3419f87ac9..ffd00c4c5b 100644 --- a/test/e2e/features/story_openshift.feature +++ b/test/e2e/features/story_openshift.feature @@ -41,7 +41,7 @@ Feature: 4 Openshift stories Given executing "oc new-project testproj" succeeds # mirror When executing "oc registry login --insecure=true" succeeds - Then executing "oc image mirror registry.access.redhat.com/ubi8/httpd-24:latest=default-route-openshift-image-registry.apps-crc.testing/testproj/hello:test --insecure=true --filter-by-os=linux/amd64" succeeds + Then executing "oc image mirror registry.access.redhat.com/ubi8/httpd-24:latest=default-route-openshift-image-registry.apps-crc.testing/testproj/hello:test --insecure=true" succeeds And executing "oc set image-lookup hello" succeeds # deploy When executing "oc apply -f hello.yaml" succeeds diff --git a/test/e2e/testsuite/testsuite.go b/test/e2e/testsuite/testsuite.go index 2741a376fe..9e77f74e34 100644 --- a/test/e2e/testsuite/testsuite.go +++ b/test/e2e/testsuite/testsuite.go @@ -213,9 +213,8 @@ 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") + err := util.ExecuteCommand("sudo dnf install podman -y;podman run --name squid -d -p 3128:3128 quay.io/crcont/squid") if err != nil { fmt.Println(err) os.Exit(1) @@ -240,6 +239,14 @@ func InitializeScenario(s *godog.ScenarioContext) { } } + + if tag.Name == "@system_network" { + err = util.ExecuteCommand("crc config set network-mode system") + if err != nil { + fmt.Println(err) + os.Exit(1) + } + } } return ctx, nil @@ -358,6 +365,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 +976,6 @@ func PodmanCommandIsAvailable() error { csshk = filepath.Join(userHomeDir, ".crc/machines/crc/id_ed25519") dh = "npipe:////./pipe/crc-podman" } - if runtime.GOOS == "linux" { - ch = "ssh://core@192.168.130.11:22/run/user/1000/podman/podman.sock" - } os.Setenv("PATH", path) os.Setenv("CONTAINER_SSHKEY", csshk) diff --git a/test/integration/podman_test.go b/test/integration/podman_test.go index 997cc77196..ade7d2371e 100644 --- a/test/integration/podman_test.go +++ b/test/integration/podman_test.go @@ -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://core@192.168.130.11:22/run/user/1000/podman/podman.sock" - } os.Setenv("PATH", path) os.Setenv("CONTAINER_SSHKEY", csshk) diff --git a/test/integration/proxy_test.go b/test/integration/proxy_test.go index 1088a7684b..27c9675744 100644 --- a/test/integration/proxy_test.go +++ b/test/integration/proxy_test.go @@ -3,7 +3,6 @@ package test_test import ( "os" "os/exec" - "runtime" crc "github.com/crc-org/crc/v2/test/extended/crc/cmd" "github.com/crc-org/crc/v2/test/extended/util" @@ -41,11 +40,6 @@ var _ = Describe("", Serial, Ordered, Label("openshift-preset", "goproxy"), func httpsProxy := "http://127.0.0.1:8888" noProxy := ".testing" - if runtime.GOOS == "linux" { - httpProxy = "http://192.168.130.1:8888" - httpsProxy = "http://192.168.130.1:8888" - } - // Start goproxy It("configure CRC", func() { @@ -53,9 +47,6 @@ var _ = Describe("", Serial, Ordered, Label("openshift-preset", "goproxy"), func Expect(RunCRCExpectSuccess("config", "set", "https-proxy", httpsProxy)).To(ContainSubstring("Successfully configured https-proxy")) Expect(RunCRCExpectSuccess("config", "set", "no-proxy", noProxy)).To(ContainSubstring("Successfully configured no-proxy")) Expect(RunCRCExpectSuccess("config", "set", "proxy-ca-file", util.CACertTempLocation)).To(ContainSubstring("Successfully configured proxy-ca-file")) - if runtime.GOOS != "linux" { - Expect(RunCRCExpectSuccess("config", "set", "host-network-access", "true")).To(ContainSubstring("Changes to configuration property 'host-network-access' are only applied during 'crc setup'")) - } }) It("setup CRC", func() {