Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: lsblk --json output changes mountpoint key to mountpoinst [] #1261

Merged
merged 1 commit into from
Feb 10, 2022
Merged
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
21 changes: 16 additions & 5 deletions tests/integration_tests/modules/test_disk_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ def test_device_alias(self, create_disk, client: IntegrationInstance):
sdb = [x for x in lsblk["blockdevices"] if x["name"] == "sdb"][0]
assert len(sdb["children"]) == 2
assert sdb["children"][0]["name"] == "sdb1"
assert sdb["children"][0]["mountpoint"] == "/mnt1"
assert sdb["children"][1]["name"] == "sdb2"
assert sdb["children"][1]["mountpoint"] == "/mnt2"
if "mountpoint" in sdb["children"][0]:
assert sdb["children"][0]["mountpoint"] == "/mnt1"
assert sdb["children"][1]["mountpoint"] == "/mnt2"
else:
assert sdb["children"][0]["mountpoints"] == ["/mnt1"]
assert sdb["children"][1]["mountpoints"] == ["/mnt2"]
result = client.execute("mount -a")
assert result.return_code == 0
assert result.stdout.strip() == ""
Expand Down Expand Up @@ -137,9 +141,13 @@ def _verify_first_disk_setup(self, client, log):
sdb = [x for x in lsblk["blockdevices"] if x["name"] == "sdb"][0]
assert len(sdb["children"]) == 2
assert sdb["children"][0]["name"] == "sdb1"
assert sdb["children"][0]["mountpoint"] == "/mnt1"
assert sdb["children"][1]["name"] == "sdb2"
assert sdb["children"][1]["mountpoint"] == "/mnt2"
if "mountpoint" in sdb["children"][0]:
assert sdb["children"][0]["mountpoint"] == "/mnt1"
assert sdb["children"][1]["mountpoint"] == "/mnt2"
else:
assert sdb["children"][0]["mountpoints"] == ["/mnt1"]
assert sdb["children"][1]["mountpoints"] == ["/mnt2"]

# Not bionic because the LXD agent gets in the way of us
# changing the userdata
Expand Down Expand Up @@ -183,7 +191,10 @@ def test_disk_setup_when_mounted(
sdb = [x for x in lsblk["blockdevices"] if x["name"] == "sdb"][0]
assert len(sdb["children"]) == 1
assert sdb["children"][0]["name"] == "sdb1"
assert sdb["children"][0]["mountpoint"] == "/mnt3"
if "mountpoint" in sdb["children"][0]:
assert sdb["children"][0]["mountpoint"] == "/mnt3"
else:
assert sdb["children"][0]["mountpoints"] == ["/mnt3"]

def test_disk_setup_no_partprobe(
self, create_disk, client: IntegrationInstance
Expand Down