Skip to content

Commit

Permalink
test: Update volume tests to reflect new threshold values for sizing (l…
Browse files Browse the repository at this point in the history
  • Loading branch information
ykim-1 authored Sep 20, 2024
1 parent 7886c08 commit b85cc93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions tests/integration/volumes/test_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@
delete_target_id,
exec_failing_test_command,
exec_test_command,
get_random_text,
)

BASE_CMD = ["linode-cli", "volumes"]
timestamp = str(time.time_ns())
label = get_random_text(8)
unique_tag = str(time.time_ns()) + "-tag"


@pytest.fixture(scope="package")
def test_volume_id():
label = get_random_text(8)
volume_id = (
exec_test_command(
BASE_CMD
+ [
"create",
"--label",
"A" + timestamp,
label,
"--region",
"us-ord",
"--size",
Expand Down Expand Up @@ -52,7 +54,7 @@ def test_fail_to_create_volume_under_10gb():
+ [
"create",
"--label",
"A" + timestamp,
label,
"--region",
"us-ord",
"--size",
Expand All @@ -68,7 +70,7 @@ def test_fail_to_create_volume_under_10gb():
) or "dev" == os.environ.get("TEST_ENVIRONMENT", None):
assert "size Must be 10-1024" in result
else:
assert "size Must be 10-10240" in result
assert "size Must be 10-16384" in result


def test_fail_to_create_volume_without_region():
Expand All @@ -77,7 +79,7 @@ def test_fail_to_create_volume_without_region():
+ [
"create",
"--label",
"A" + timestamp,
label,
"--size",
"10",
"--text",
Expand Down Expand Up @@ -113,11 +115,11 @@ def test_fail_to_create_volume_over_1024gb_in_size():
+ [
"create",
"--label",
"A" + timestamp,
label,
"--region",
"us-ord",
"--size",
"10241",
"19000",
"--text",
"--no-headers",
],
Expand All @@ -128,7 +130,7 @@ def test_fail_to_create_volume_over_1024gb_in_size():
) or "dev" == os.environ.get("TEST_ENVIRONMENT", None):
assert "size Must be 10-1024" in result
else:
assert "size Must be 10-10240" in result
assert "size Must be 10-16384" in result


def test_fail_to_create_volume_with_all_numberic_label():
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/volumes/test_volumes_resize.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_resize_fails_to_volume_larger_than_1024gb(test_volume_id):
)
else:
assert (
"Storage volumes cannot be resized larger than 10240 gigabytes"
"Storage volumes cannot be resized larger than 16384 gigabytes"
in result
)

Expand Down

0 comments on commit b85cc93

Please sign in to comment.