diff --git a/cloudbaseinit/tests/utils/windows/test_vfat.py b/cloudbaseinit/tests/utils/windows/test_vfat.py index d0d821fb..ebfd8786 100644 --- a/cloudbaseinit/tests/utils/windows/test_vfat.py +++ b/cloudbaseinit/tests/utils/windows/test_vfat.py @@ -67,8 +67,12 @@ class TestVfat(unittest.TestCase): expected_response=expected_response) def test_is_vfat_drive_different_label(self): - expected_logging = [] - execute_process_value = (b"Volume label is config", None, 0) + mock_out = b"Volume label is config" + expected_logging = [ + "Obtained label information for drive %r: %r" + % (mock.sentinel.drive, mock_out) + ] + execute_process_value = (mock_out, None, 0) expected_response = False self._test_is_vfat_drive(execute_process_value=execute_process_value, @@ -76,8 +80,12 @@ class TestVfat(unittest.TestCase): expected_response=expected_response) def test_is_vfat_drive_works(self): - expected_logging = [] - execute_process_value = (b"Volume label is config-2 \r\n", None, 0) + mock_out = b"Volume label is config-2 \r\n" + expected_logging = [ + "Obtained label information for drive %r: %r" + % (mock.sentinel.drive, mock_out) + ] + execute_process_value = (mock_out, None, 0) expected_response = True self._test_is_vfat_drive(execute_process_value=execute_process_value, diff --git a/cloudbaseinit/utils/windows/vfat.py b/cloudbaseinit/utils/windows/vfat.py index c9fac8d7..69992177 100644 --- a/cloudbaseinit/utils/windows/vfat.py +++ b/cloudbaseinit/utils/windows/vfat.py @@ -54,6 +54,7 @@ def is_vfat_drive(osutils, drive_path): LOG.warning("mlabel failed with error %r", err) return False + LOG.info("Obtained label information for drive %r: %r", drive_path, out) out = out.decode().strip() match = VOLUME_LABEL_REGEX.search(out) return match.group(1) == CONFIG_DRIVE_LABEL