diff --git a/tests/integration/linodes/fixtures.py b/tests/integration/linodes/fixtures.py index 8e57df9a3..7542ae47d 100644 --- a/tests/integration/linodes/fixtures.py +++ b/tests/integration/linodes/fixtures.py @@ -86,9 +86,9 @@ def linode_backup_disabled(linode_cloud_firewall): @pytest.fixture(scope="module") -def snapshot_of_linode(): +def snapshot_of_linode(linode_cloud_firewall): # get linode id after creation and wait for "running" status - linode_id = create_linode_and_wait() + linode_id = create_linode_and_wait(firewall_id=linode_cloud_firewall) new_snapshot_label = "test_snapshot_" + get_random_text(5) result = exec_test_command( diff --git a/tests/integration/linodes/test_backups.py b/tests/integration/linodes/test_backups.py index 0949fbd5b..a4c0642c6 100755 --- a/tests/integration/linodes/test_backups.py +++ b/tests/integration/linodes/test_backups.py @@ -3,11 +3,16 @@ import pytest -from tests.integration.helpers import BASE_CMDS, exec_test_command +from tests.integration.helpers import ( + BASE_CMDS, + delete_target_id, + exec_test_command, +) from tests.integration.linodes.fixtures import ( # noqa: F401 linode_backup_disabled, linode_backup_enabled, linode_basic_with_firewall, + snapshot_of_linode, ) from tests.integration.linodes.helpers import ( check_account_settings, @@ -91,9 +96,9 @@ def test_create_backup_with_backup_enabled(linode_backup_enabled): os.environ.get("RUN_LONG_TESTS", None) != "True", reason="Skipping long-running Test, to run set RUN_LONG_TESTS=True", ) -def test_take_snapshot_of_linode(firewall_id): +def test_take_snapshot_of_linode(linode_cloud_firewall): # get linode id after creation and wait for "running" status - linode_id = create_linode_and_wait(firewall_id) + linode_id = create_linode_and_wait(firewall_id=linode_cloud_firewall) snapshot_label = "test_snapshot1" @@ -116,6 +121,8 @@ def test_take_snapshot_of_linode(firewall_id): result, ) + delete_target_id("linodes", linode_id) + @pytest.mark.skipif( os.environ.get("RUN_LONG_TESTS", None) != "True", @@ -157,10 +164,8 @@ def test_cancel_backups(snapshot_of_linode): result = exec_test_command( BASE_CMDS["linodes"] + [ - "snapshot", + "backups-list", linode_id, - "--label", - new_snapshot_label, "--text", "--delimiter", ",", @@ -168,7 +173,7 @@ def test_cancel_backups(snapshot_of_linode): ] ) assert re.search( - "[0-9]+,pending,snapshot,[0-9]+-[0-9]+-[0-9]+T[0-9]+:[0-9]+:[0-9]+," + "[0-9]+,(pending|running),snapshot,[0-9]+-[0-9]+-[0-9]+T[0-9]+:[0-9]+:[0-9]+," + new_snapshot_label, result, )