Merge lp://qastaging/~raharper/curtin/set_bcache_cache_mode into lp://qastaging/~curtin-dev/curtin/trunk

Proposed by Ryan Harper
Status: Merged
Merged at revision: 292
Proposed branch: lp://qastaging/~raharper/curtin/set_bcache_cache_mode
Merge into: lp://qastaging/~curtin-dev/curtin/trunk
Diff against target: 104 lines (+44/-1)
3 files modified
curtin/commands/block_meta.py (+37/-0)
examples/tests/mdadm_bcache.yaml (+1/-0)
tests/vmtests/test_mdadm_bcache.py (+6/-1)
To merge this branch: bzr merge lp://qastaging/~raharper/curtin/set_bcache_cache_mode
Reviewer Review Type Date Requested Status
Scott Moser (community) Approve
Review via email: mp+276194@code.qastaging.launchpad.net

Description of the change

Update curtin to write out cache mode for bcache devices if 'cache_mode' is present in storage config for bcache devices.
Update vmtest for bcache to confirm that we can set cache_mode; note it also confirms that the setting is persistent since we reboot between curtin install and vmtest validation.

Fixes: lp:1510334

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

one suggestion in line. other than that, looks good.
and if i'm wrong on that, then go ahead and commit anyway.

review: Approve
296. By Ryan Harper

Find bcache device name via backing device holders

Add function get_holders which reads /sys/class/block/<dev>/holders
Use get_holders to list the bcache backing device holders to find the
assigned bcache device name

297. By Ryan Harper

vmtest: switch bcache test to use check_file_stripped_line

Use common check function in bcache testcase

298. By Ryan Harper

make check fixes for bcache cache_mode changes

Apply cleanups as found by make check

299. By Ryan Harper

vmtest: switch bcache test to use regex

After looking at how stripped line output works, using a
regex is more flexible in the face of bcache adding/removing
cache modes.

Revision history for this message
Ryan Harper (raharper) wrote :

I've addressed two things:

1) Blake highlighted that relying the the bcache storage config id isn't robust; it could be any string though in practice it tends to the the correct value. Instead, use the backing device to look up the bcache device name via sysfs holders dir.

2) Switch testcase to use check_file_regex

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches