diskimage-builder/diskimage_builder/block_device/tests
Ian Wienand 5d5fa06e5c Sync after writing partition table
We introduced the "settle" in
I90103b59357edebbac7a641e8980cb282d37561b thinking that maybe kpartx
had not finished writing the partition.  This probably wasn't a bad
first assumption, since we used to have this -- but is seems
insufficient.

The other failiure here seems to be if kpartx hasn't actually seen the
updated partition table in the image, so it has correctly (in it's
mind) not mounted the partition.

Looking at strace of fdisk run manually on a loopback, it will do a
fsync on the raw device after writing and then a global sync as it
exits.

This replicates this; we flush and fsync in mbr.py in the exit handler
after writing the partition, before closing the file (i've updated one
of the unit tests to double-check the call).  In the partitioning.py
caller we execute a sync call too.

Since it does seem unlikely the "-s" option of kpartx is not working,
I've removed the udev settle work-around too.

Change-Id: Ia77a0ffe4c76854b326ed76490479d9c691b49aa
Partial-Bug: #1698337
2017-06-19 17:13:36 +10:00
..
config Move rollback into NodeBase object 2017-06-08 17:14:20 +10:00
plugin Move rollback into NodeBase object 2017-06-08 17:14:20 +10:00
__init__.py Refactor: block-device handling (local loop) 2016-09-08 04:31:01 +00:00
test_base.py Add state object, rename "results", add unit tests 2017-05-30 20:39:00 +10:00
test_config.py Move global mount tracking into state 2017-06-08 17:13:28 +10:00
test_mbr.py Sync after writing partition table 2017-06-19 17:13:36 +10:00
test_mkfs.py Use global state to check for duplicate fs labels 2017-06-08 17:13:28 +10:00
test_mount_order.py Move rollback into NodeBase object 2017-06-08 17:14:20 +10:00
test_state.py Move rollback into NodeBase object 2017-06-08 17:14:20 +10:00
test_utils.py Move "functional" unit tests under block-device 2017-06-05 12:22:52 +10:00