Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/integration/linodes/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
19 changes: 12 additions & 7 deletions tests/integration/linodes/test_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"

Expand All @@ -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",
Expand Down Expand Up @@ -157,18 +164,16 @@ 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",
",",
"--no-headers",
]
)
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]+,"
Comment thread
mawilk90 marked this conversation as resolved.
+ new_snapshot_label,
result,
)
Expand Down
Loading