Skip to content

Commit

Permalink
[QE]test case update for linux default network change to user
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyLuLiu committed Dec 19, 2024
1 parent 42bccc9 commit 1972000
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
16 changes: 9 additions & 7 deletions test/e2e/features/config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -113,7 +115,7 @@ Feature: Test configuration settings
Then starting CRC with default bundle fails
And stderr should contain "Preflight checks failed during `crc start`, please try to run `crc setup` first in case you haven't done so yet"

@linux
@linux @system_network
Scenario: Check network setup and destroy it, then check again
When removing file "crc.json" from CRC home folder succeeds
And executing single crc setup command succeeds
Expand All @@ -123,15 +125,15 @@ Feature: Test configuration settings
And executing "sudo virsh net-list --name" succeeds
Then stdout should not contain "crc"

@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
Then executing single crc setup command succeeds
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
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/features/proxy.feature
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@proxy @linux
@proxy @linux
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
Expand Down
16 changes: 16 additions & 0 deletions test/e2e/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,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
Expand Down Expand Up @@ -358,6 +366,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
Expand Down

0 comments on commit 1972000

Please sign in to comment.