summaryrefslogtreecommitdiff
path: root/tests/integration_tests/bugs/test_lp1901011.py
diff options
context:
space:
mode:
authorJames Falcon <james.falcon@canonical.com>2021-12-15 20:16:38 -0600
committerGitHub <noreply@github.com>2021-12-15 19:16:38 -0700
commitbae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf (patch)
tree1fbb3269fc87e39832e3286ef42eefd2b23fcd44 /tests/integration_tests/bugs/test_lp1901011.py
parent2bcf4fa972fde686c2e3141c58e640640b44dd00 (diff)
downloadvyos-cloud-init-bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf.tar.gz
vyos-cloud-init-bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf.zip
Adopt Black and isort (SC-700) (#1157)
Applied Black and isort, fixed any linting issues, updated tox.ini and CI.
Diffstat (limited to 'tests/integration_tests/bugs/test_lp1901011.py')
-rw-r--r--tests/integration_tests/bugs/test_lp1901011.py49
1 files changed, 29 insertions, 20 deletions
diff --git a/tests/integration_tests/bugs/test_lp1901011.py b/tests/integration_tests/bugs/test_lp1901011.py
index 2b47f0a8..7de8bd77 100644
--- a/tests/integration_tests/bugs/test_lp1901011.py
+++ b/tests/integration_tests/bugs/test_lp1901011.py
@@ -10,12 +10,16 @@ from tests.integration_tests.clouds import IntegrationCloud
@pytest.mark.azure
-@pytest.mark.parametrize('instance_type,is_ephemeral', [
- ('Standard_DS1_v2', True),
- ('Standard_D2s_v4', False),
-])
-def test_ephemeral(instance_type, is_ephemeral,
- session_cloud: IntegrationCloud, setup_image):
+@pytest.mark.parametrize(
+ "instance_type,is_ephemeral",
+ [
+ ("Standard_DS1_v2", True),
+ ("Standard_D2s_v4", False),
+ ],
+)
+def test_ephemeral(
+ instance_type, is_ephemeral, session_cloud: IntegrationCloud, setup_image
+):
if is_ephemeral:
expected_log = (
"Ephemeral resource disk '/dev/disk/cloud/azure_resource' exists. "
@@ -29,30 +33,35 @@ def test_ephemeral(instance_type, is_ephemeral,
)
with session_cloud.launch(
- launch_kwargs={'instance_type': instance_type}
+ launch_kwargs={"instance_type": instance_type}
) as client:
# Verify log file
- log = client.read_from_file('/var/log/cloud-init.log')
+ log = client.read_from_file("/var/log/cloud-init.log")
assert expected_log in log
# Verify devices
- dev_links = client.execute('ls /dev/disk/cloud')
- assert 'azure_root' in dev_links
- assert 'azure_root-part1' in dev_links
+ dev_links = client.execute("ls /dev/disk/cloud")
+ assert "azure_root" in dev_links
+ assert "azure_root-part1" in dev_links
if is_ephemeral:
- assert 'azure_resource' in dev_links
- assert 'azure_resource-part1' in dev_links
+ assert "azure_resource" in dev_links
+ assert "azure_resource-part1" in dev_links
# Verify mounts
- blks = client.execute('lsblk -pPo NAME,TYPE,MOUNTPOINT')
+ blks = client.execute("lsblk -pPo NAME,TYPE,MOUNTPOINT")
root_device = client.execute(
- 'realpath /dev/disk/cloud/azure_root-part1'
+ "realpath /dev/disk/cloud/azure_root-part1"
+ )
+ assert (
+ 'NAME="{}" TYPE="part" MOUNTPOINT="/"'.format(root_device) in blks
)
- assert 'NAME="{}" TYPE="part" MOUNTPOINT="/"'.format(
- root_device) in blks
if is_ephemeral:
ephemeral_device = client.execute(
- 'realpath /dev/disk/cloud/azure_resource-part1'
+ "realpath /dev/disk/cloud/azure_resource-part1"
+ )
+ assert (
+ 'NAME="{}" TYPE="part" MOUNTPOINT="/mnt"'.format(
+ ephemeral_device
+ )
+ in blks
)
- assert 'NAME="{}" TYPE="part" MOUNTPOINT="/mnt"'.format(
- ephemeral_device) in blks