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

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Dan Bungert
Approved revision: 890820e88266eb626f07d1a5d0e834bda4dc42ff
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:fix-integration-block_meta-4k-tests
Merge into: curtin:master
Diff against target: 35 lines (+6/-3)
1 file modified
tests/integration/test_block_meta.py (+6/-3)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Dan Bungert Approve
Review via email: mp+433755@code.launchpad.net

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.

To post a comment you must log in.
Revision history for this message
Dan Bungert (dbungert) :
review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/integration/test_block_meta.py b/tests/integration/test_block_meta.py
2index 5f7434f..81df400 100644
3--- a/tests/integration/test_block_meta.py
4+++ b/tests/integration/test_block_meta.py
5@@ -11,7 +11,7 @@ import sys
6 from typing import Optional
7 import yaml
8
9-from curtin import block, udev, util
10+from curtin import block, log, udev, util
11
12 from curtin.commands.block_meta import _get_volume_fstype
13 from curtin.commands.block_meta_v2 import ONE_MIB_BYTES
14@@ -27,9 +27,11 @@ class IntegrationTestCase(CiTestCase):
15 @contextlib.contextmanager
16 def loop_dev(image, sector_size=512):
17 dev = util.subp([
18- 'losetup', '--show', '--find', '--partscan',
19- '--sector-size', str(sector_size), image,
20+ 'losetup',
21+ '--show', '--find', '--sector-size', str(sector_size),
22+ image,
23 ], capture=True, decode='ignore')[0].strip()
24+ util.subp(['partprobe', dev])
25 try:
26 udev.udevadm_trigger([dev])
27 yield dev
28@@ -196,6 +198,7 @@ class StorageConfigBuilder:
29 class TestBlockMeta(IntegrationTestCase):
30 def setUp(self):
31 self.data = self.random_string()
32+ log.basicConfig(verbosity=3)
33
34 def assertPartitions(self, *args):
35 with loop_dev(self.img) as dev:

Subscribers

People subscribed via source and target branches