summaryrefslogtreecommitdiff
path: root/tests/integration_tests/conftest.py
diff options
context:
space:
mode:
authorJames Falcon <TheRealFalcon@users.noreply.github.com>2020-11-30 10:20:15 -0600
committerGitHub <noreply@github.com>2020-11-30 11:20:15 -0500
commit2bd34bda9543c1b66f53eaf26706f0de887db187 (patch)
treef22548313ac2d9c81a38502ed9bf855cebfbc29c /tests/integration_tests/conftest.py
parentde3183c1ff4660dda23f2624c1cc24bb76de5bf5 (diff)
downloadvyos-cloud-init-2bd34bda9543c1b66f53eaf26706f0de887db187.tar.gz
vyos-cloud-init-2bd34bda9543c1b66f53eaf26706f0de887db187.zip
Delete image snapshots created for integration tests (#682)
Integration tests have been leaving behind snapshot images, so now we clean them up. Also, in testing, found that in Azure, deleting a resource group will automatically delete the instance, so if KEEP_INSTANCE is True, we no longer delete the resource group. Co-authored-by: Daniel Watkins <oddbloke@ubuntu.com>
Diffstat (limited to 'tests/integration_tests/conftest.py')
-rw-r--r--tests/integration_tests/conftest.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py
index 6e1465be..d7e0fca2 100644
--- a/tests/integration_tests/conftest.py
+++ b/tests/integration_tests/conftest.py
@@ -81,7 +81,10 @@ def session_cloud():
cloud = platforms[integration_settings.PLATFORM]()
cloud.emit_settings_to_log()
yield cloud
- cloud.destroy()
+ try:
+ cloud.delete_snapshot()
+ finally:
+ cloud.destroy()
@pytest.fixture(scope='session', autouse=True)