← Back to team overview

curtin-dev team mailing list archive

[Merge] ~mwhudson/curtin:fix-integration-block_meta-4k-tests into curtin:master

 

Michael Hudson-Doyle has proposed merging ~mwhudson/curtin:fix-integration-block_meta-4k-tests into curtin:master.

Commit message:
fix block meta 4k integration tests with recentish losetup

In recent releases of util-linux, --sector-size and --partscan don't
play well together, so drop the --partscan and call partprobe after
losetup returns. This is fixed in util-linux master but not the latest
release.



Requested reviews:
  curtin developers (curtin-dev)

For more details, see:
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/433755
-- 
Your team curtin developers is requested to review the proposed merge of ~mwhudson/curtin:fix-integration-block_meta-4k-tests into curtin:master.
diff --git a/tests/integration/test_block_meta.py b/tests/integration/test_block_meta.py
index 5f7434f..81df400 100644
--- a/tests/integration/test_block_meta.py
+++ b/tests/integration/test_block_meta.py
@@ -11,7 +11,7 @@ import sys
 from typing import Optional
 import yaml
 
-from curtin import block, udev, util
+from curtin import block, log, udev, util
 
 from curtin.commands.block_meta import _get_volume_fstype
 from curtin.commands.block_meta_v2 import ONE_MIB_BYTES
@@ -27,9 +27,11 @@ class IntegrationTestCase(CiTestCase):
 @contextlib.contextmanager
 def loop_dev(image, sector_size=512):
     dev = util.subp([
-        'losetup', '--show', '--find', '--partscan',
-        '--sector-size', str(sector_size), image,
+        'losetup',
+        '--show', '--find', '--sector-size', str(sector_size),
+        image,
         ], capture=True, decode='ignore')[0].strip()
+    util.subp(['partprobe', dev])
     try:
         udev.udevadm_trigger([dev])
         yield dev
@@ -196,6 +198,7 @@ class StorageConfigBuilder:
 class TestBlockMeta(IntegrationTestCase):
     def setUp(self):
         self.data = self.random_string()
+        log.basicConfig(verbosity=3)
 
     def assertPartitions(self, *args):
         with loop_dev(self.img) as dev:

Follow ups