Merge lp:~wesley-wiedenmeier/curtin/1597923 into lp:~curtin-dev/curtin/trunk

Proposed by Wesley Wiedenmeier
Status: Merged
Merged at revision: 408
Proposed branch: lp:~wesley-wiedenmeier/curtin/1597923
Merge into: lp:~curtin-dev/curtin/trunk
Diff against target: 46 lines (+7/-2)
3 files modified
curtin/block/mkfs.py (+1/-0)
examples/tests/basic.yaml (+4/-0)
tests/unittests/test_block_mkfs.py (+2/-2)
To merge this branch: bzr merge lp:~wesley-wiedenmeier/curtin/1597923
Reviewer Review Type Date Requested Status
Ryan Harper (community) Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+298841@code.launchpad.net

Description of the change

For mkfs.vfat commands, add the flag -I to force the command to work if told to format a whole disk instead of just a partition.

Note, I did not add a whole disk fat filesystem to any of the vmtests, because whole disk formatting is tested quite a bit in storagetests, so it shouldn't really be needed.

To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

Good catch and nice fix + unittest.

Can you add it to say basic vmtest since storagetests hasn't yet landed? We could pick this up until the storagetests end up landing as well.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
402. By Wesley Wiedenmeier

Added creation of whole disk fat32 filesystem to basic unit test to check for
(LP: 1597923)

Revision history for this message
Wesley Wiedenmeier (wesley-wiedenmeier) wrote :

Thanks, I added a whole disk format in on the spare disk in test_basic, so we should be good on verification now.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ryan Harper (raharper) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'curtin/block/mkfs.py'
2--- curtin/block/mkfs.py 2016-04-14 19:24:47 +0000
3+++ curtin/block/mkfs.py 2016-06-30 22:31:57 +0000
4@@ -78,6 +78,7 @@
5 "swap": "--uuid"},
6 "force": {"btrfs": "--force",
7 "ext": "-F",
8+ "fat": "-I",
9 "ntfs": "--force",
10 "reiserfs": "-f",
11 "swap": "--force",
12
13=== modified file 'examples/tests/basic.yaml'
14--- examples/tests/basic.yaml 2016-04-04 16:03:32 +0000
15+++ examples/tests/basic.yaml 2016-06-30 22:31:57 +0000
16@@ -42,6 +42,10 @@
17 path: /dev/vdc
18 name: sparedisk
19 wipe: superblock
20+ - id: sparedisk_fat_fmt_id
21+ type: format
22+ fstype: fat32
23+ volume: sparedisk_id
24 - id: btrfs_disk_id
25 type: disk
26 path: /dev/vdd
27
28=== modified file 'tests/unittests/test_block_mkfs.py'
29--- tests/unittests/test_block_mkfs.py 2016-04-07 20:47:33 +0000
30+++ tests/unittests/test_block_mkfs.py 2016-06-30 22:31:57 +0000
31@@ -82,13 +82,13 @@
32
33 def test_mkfs_fat(self):
34 conf = self._get_config("fat32")
35- expected_flags = [["-n", "format1"], ["-F", "32"]]
36+ expected_flags = ["-I", ["-n", "format1"], ["-F", "32"]]
37 self._run_mkfs_with_config(conf, "mkfs.vfat", expected_flags)
38
39 def test_mkfs_vfat(self):
40 """Ensure we can use vfat without fatsize"""
41 conf = self._get_config("vfat")
42- expected_flags = [["-n", "format1"], ]
43+ expected_flags = ["-I", ["-n", "format1"], ]
44 self._run_mkfs_with_config(conf, "mkfs.vfat", expected_flags)
45
46 def test_mkfs_invalid_fstype(self):

Subscribers

People subscribed via source and target branches