summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_datasource/test_configdrive.py6
-rw-r--r--tests/unittests/test_ds_identify.py17
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/unittests/test_datasource/test_configdrive.py b/tests/unittests/test_datasource/test_configdrive.py
index 6ef5a35c..68400f22 100644
--- a/tests/unittests/test_datasource/test_configdrive.py
+++ b/tests/unittests/test_datasource/test_configdrive.py
@@ -458,6 +458,12 @@ class TestConfigDriveDataSource(CiTestCase):
self.assertEqual(["/dev/vdb3"],
ds.find_candidate_devs())
+ # Verify that uppercase labels are also found.
+ devs_with_answers = {"TYPE=vfat": [],
+ "TYPE=iso9660": ["/dev/vdb"],
+ "LABEL=CONFIG-2": ["/dev/vdb"]}
+ self.assertEqual(["/dev/vdb"], ds.find_candidate_devs())
+
finally:
util.find_devs_with = orig_find_devs_with
util.is_partition = orig_is_partition
diff --git a/tests/unittests/test_ds_identify.py b/tests/unittests/test_ds_identify.py
index c9234edd..ad6c5cf4 100644
--- a/tests/unittests/test_ds_identify.py
+++ b/tests/unittests/test_ds_identify.py
@@ -232,6 +232,11 @@ class TestDsIdentify(CiTestCase):
self._test_ds_found('ConfigDrive')
return
+ def test_config_drive_upper(self):
+ """ConfigDrive datasource has a disk with LABEL=CONFIG-2."""
+ self._test_ds_found('ConfigDriveUpper')
+ return
+
def test_policy_disabled(self):
"""A Builtin policy of 'disabled' should return not found.
@@ -503,6 +508,18 @@ VALID_CFG = {
},
],
},
+ 'ConfigDriveUpper': {
+ 'ds': 'ConfigDrive',
+ 'mocks': [
+ {'name': 'blkid', 'ret': 0,
+ 'out': blkid_out(
+ [{'DEVNAME': 'vda1', 'TYPE': 'vfat', 'PARTUUID': uuid4()},
+ {'DEVNAME': 'vda2', 'TYPE': 'ext4',
+ 'LABEL': 'cloudimg-rootfs', 'PARTUUID': uuid4()},
+ {'DEVNAME': 'vdb', 'TYPE': 'vfat', 'LABEL': 'CONFIG-2'}])
+ },
+ ],
+ },
}
# vi: ts=4 expandtab