Skip to content

Commit 3e211b1

Browse files
Jakub Sliacanpraveenkumar
authored andcommitted
Issue #1279 Integration: Add cleanup command to tests
1 parent 38128fd commit 3e211b1

File tree

6 files changed

+51
-9
lines changed

6 files changed

+51
-9
lines changed

test/integration/features/basic.feature

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,39 @@ Feature: Basic test
137137
Scenario: CRC delete
138138
When executing "crc delete -f" succeeds
139139
Then stdout should contain "Deleted the OpenShift cluster"
140+
141+
@darwin
142+
Scenario Outline: CRC clean-up
143+
When executing "crc cleanup" succeeds
144+
Then stdout should contain "Unload CodeReady Containers tray"
145+
And stdout should contain "Unload CodeReady Containers daemon"
146+
And stdout should contain "Removing launchd configuration for tray"
147+
And stdout should contain "Removing launchd configuration for daemon"
148+
And stdout should contain "Removing /etc/resolver/testing file"
149+
And stdout should contain "Will use root access: Remove file /etc/resolver/testing"
150+
And stdout should contain "Cleanup finished"
151+
152+
@linux
153+
Scenario Outline: CRC clean-up
154+
When executing "crc cleanup" succeeds
155+
Then stdout should contain "Removing the crc VM if exists"
156+
And stdout should contain "Removing /etc/NetworkManager/dnsmasq.d/crc.conf file"
157+
And stdout should contain "Will use root access: removing dnsmasq configuration in /etc/NetworkManager/dnsmasq.d/crc.conf"
158+
And stdout should contain "Will use root access: execute systemctl daemon-reload command"
159+
And stdout should contain "Will use root access: execute systemctl stop/start command"
160+
And stdout should contain "Removing /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf file"
161+
And stdout should contain "Will use root access: Removing NetworkManager config in /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf"
162+
And stdout should contain "Will use root access: execute systemctl daemon-reload command"
163+
And stdout should contain "Will use root access: execute systemctl stop/start command"
164+
And stdout should contain "Removing 'crc' network from libvirt"
165+
And stdout should contain "Cleanup finished"
166+
167+
@windows
168+
Scenario Outline: CRC clean-up
169+
When executing "crc cleanup" succeeds
170+
Then stdout should contain "Uninstalling tray if installed"
171+
And stdout should contain "Will run as admin: Uninstalling CodeReady Containers System Tray"
172+
And stdout should contain "Removing the crc VM if exists"
173+
And stdout should contain "Removing dns server from interface"
174+
And stdout should contain "Will run as admin: Remove dns entry for default switch"
175+
And stdout should contain "Cleanup finished"

test/integration/features/cert_rotation.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Feature: Check the cert is rotation happen after it expire
2020
Scenario: Set clock back to original time
2121
Given executing "sudo timedatectl set-ntp on" succeeds
2222

23-
Scenario: CRC delete
23+
Scenario: CRC delete and cleanup
2424
When executing "crc delete -f" succeeds
2525
Then stdout should contain "Deleted the OpenShift cluster"
26+
When executing "crc cleanup" succeeds

test/integration/features/proxy.feature

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ Feature: Test the proxy
2828
When executing "crc delete -f" succeeds
2929
Then stdout should contain "Deleted the OpenShift cluster"
3030
And executing "crc config unset http-proxy" succeeds
31-
Then executing "crc config unset https-proxy" succeeds
31+
And executing "crc config unset https-proxy" succeeds
32+
And executing "crc cleanup" succeeds
33+

test/integration/features/story_health.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ Feature:
6161
Then with up to "4" retries with wait period of "2m" command "crc status" output should match ".*Running \(v\d+\.\d+\.\d+.*\).*"
6262
And with up to "2" retries with wait period of "60s" http response from "http://httpd-example-testproj.apps-crc.testing" has status code "200"
6363

64+
6465
@darwin @linux @windows
65-
Scenario: Clean up
66-
Given executing "oc delete project testproj" succeeds
67-
When executing "crc stop -f" succeeds
68-
Then stdout should match "(.*)[Ss]topped the OpenShift cluster"
69-
When executing "crc delete -f" succeeds
70-
Then stdout should contain "Deleted the OpenShift cluster"
66+
Scenario: Switch off CRC
67+
When executing "oc delete project testproj" succeeds
68+
Then executing "crc stop -f" succeeds
69+
And executing "crc delete -f" succeeds
70+
And executing "crc cleanup" succeeds

test/integration/features/story_marketplace.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@ Feature:
7575
Then stdout should match "(.*)[Ss]topped the OpenShift cluster"
7676
When executing "crc delete -f" succeeds
7777
Then stdout should contain "Deleted the OpenShift cluster"
78+
When executing "crc cleanup" succeeds
79+
Then stdout should contain "Cleanup finished"

test/integration/features/story_registry.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ Feature: Local image to image-registry to deployment
4343
Then stdout should match "(.*)[Ss]topped the OpenShift cluster"
4444
And executing "crc delete -f" succeeds
4545
Then stdout should contain "Deleted the OpenShift cluster"
46-
46+
When executing "crc cleanup" succeeds
47+
Then stdout should contain "Cleanup finished"

0 commit comments

Comments
 (0)