Merge ~raharper/curtin:feature/block-discover-dasd into curtin:master

Proposed by Ryan Harper
Status: Merged
Approved by: Ryan Harper
Approved revision: 7d0477a082baf1b5cb999e1d686ac55ee1f043cf
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~raharper/curtin:feature/block-discover-dasd
Merge into: curtin:master
Diff against target: 1064 lines (+931/-10)
4 files modified
curtin/block/schemas.py (+2/-1)
curtin/storage_config.py (+58/-5)
tests/data/probert_storage_dasd.json (+809/-0)
tests/unittests/test_storage_config.py (+62/-4)
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Server Team CI bot continuous-integration Approve
curtin developers Pending
Review via email: mp+379674@code.launchpad.net

Commit message

block-discover: add dasd parser and emit dasd storage config

Probert now includes a 'dasd' element in the probe data.
If present, block-discover will now parse this data and
emit type:dasd elements in the rendered storage config.

LP: #1862849

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Is it worth adding a test that a type: disk gets emitted for the dasds as well?

(For some reason looking at this makes me wonder whether there should be a udev rule that runs dasdview and adds at least the cdl/ldl/not-formatted info to the udev database but well.......)

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

So it turns out that curtin requires that the disk action for a dasd has a device_id (well, if you want to create partitions, anyway...) and that would also make life easier for subiquity.

7d0477a... by Ryan Harper

block-discover: dasd disks need device_id, vtoc if present

Refactor discover to include device_id in type: disk so
partitions can lookup the path to the disk. If the dasd
device is formatted, include ptable: vtoc. Add additional
unittests to verify this behavior.

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) wrote :

> Is it worth adding a test that a type: disk gets emitted for the dasds as
> well?

Yes, and I've added this.

>
> (For some reason looking at this makes me wonder whether there should be a
> udev rule that runs dasdview and adds at least the cdl/ldl/not-formatted info
> to the udev database but well.......)

+1 we could file a bug to track this if we want.

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

I believe I've fixed up the issue you're seeing and added some unittests to verify that type: disk entries use device_id to refer to type:dasd and also detect and include ptable: vtoc for formatted dasd devices.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

LGTM now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/block/schemas.py b/curtin/block/schemas.py
2index fc7e522..34c4400 100644
3--- a/curtin/block/schemas.py
4+++ b/curtin/block/schemas.py
5@@ -100,7 +100,7 @@ DASD = {
6 },
7 'disk_layout': {
8 'type': ['string'],
9- 'enum': ['cdl', 'ldl'],
10+ 'enum': ['cdl', 'ldl', 'not-formatted'],
11 },
12 },
13 }
14@@ -122,6 +122,7 @@ DISK = {
15 'id': {'$ref': '#/definitions/id'},
16 'name': {'$ref': '#/definitions/name'},
17 'multipath': {'type': 'string'},
18+ 'device_id': {'type': 'string'},
19 'preserve': {'$ref': '#/definitions/preserve'},
20 'wipe': {'$ref': '#/definitions/wipe'},
21 'type': {'const': 'disk'},
22diff --git a/curtin/storage_config.py b/curtin/storage_config.py
23index cdfdb70..545b50c 100644
24--- a/curtin/storage_config.py
25+++ b/curtin/storage_config.py
26@@ -126,7 +126,7 @@ def _stype_to_deps(stype):
27 depends_keys = {
28 'bcache': {'backing_device', 'cache_device'},
29 'dasd': set(),
30- 'disk': {'device_id'},
31+ 'disk': set(),
32 'dm_crypt': {'volume'},
33 'format': {'volume'},
34 'lvm_partition': {'volgroup'},
35@@ -144,6 +144,7 @@ def _stype_to_order_key(stype):
36 default_sort = {'id'}
37 order_key = {
38 'bcache': {'name'},
39+ 'dasd': default_sort,
40 'disk': default_sort,
41 'dm_crypt': default_sort,
42 'format': default_sort,
43@@ -170,7 +171,7 @@ def _validate_dep_type(source_id, dep_key, dep_id, sconfig):
44 'bcache': {'bcache', 'disk', 'dm_crypt', 'lvm_partition',
45 'partition', 'raid'},
46 'dasd': {},
47- 'disk': {'device_id'},
48+ 'disk': {'dasd'},
49 'dm_crypt': {'bcache', 'disk', 'dm_crypt', 'lvm_partition',
50 'partition', 'raid'},
51 'format': {'bcache', 'disk', 'dm_crypt', 'lvm_partition',
52@@ -753,6 +754,19 @@ class BlockdevParser(ProbertParser):
53 # set wwn, serial, and path
54 entry.update(uniq_ids)
55
56+ # disk entry for dasds needs device_id and check for vtoc ptable
57+ if devname.startswith('/dev/dasd'):
58+ device_id = (
59+ blockdev_data.get('ID_PATH', '').replace('ccw-', ''))
60+ if device_id:
61+ entry['device_id'] = device_id
62+
63+ # if dasd has been formatted, attrs.size is non-zero
64+ # formatted dasds have ptable type of 'vtoc'
65+ dasd_size = blockdev_data.get('attrs', {}).get('size')
66+ if dasd_size and dasd_size != "0":
67+ entry['ptable'] = 'vtoc'
68+
69 if 'ID_PART_TABLE_TYPE' in blockdev_data:
70 ptype = blockdev_data['ID_PART_TABLE_TYPE']
71 if ptype in schemas._ptables:
72@@ -843,7 +857,7 @@ class FilesystemParser(ProbertParser):
73 continue
74
75 # ignore types that we cannot create
76- if data['TYPE'] not in schemas._fstypes:
77+ if data.get('TYPE') not in schemas._fstypes:
78 continue
79
80 entry = self.asdict(volume_id, data)
81@@ -940,6 +954,43 @@ class LvmParser(ProbertParser):
82 return (configs, errors)
83
84
85+class DasdParser(ProbertParser):
86+
87+ probe_data_key = 'dasd'
88+
89+ def asdict(self, dasd_config):
90+ dasd_name = os.path.basename(dasd_config['name'])
91+ device_id = dasd_config['device_id']
92+ blocksize = dasd_config['blocksize']
93+ disk_layout = dasd_config['disk_layout']
94+
95+ return {'type': 'dasd',
96+ 'id': 'dasd-%s' % dasd_name,
97+ 'device_id': device_id,
98+ 'blocksize': blocksize,
99+ 'mode': 'full' if disk_layout == 'not-formatted' else 'quick',
100+ 'disk_layout': disk_layout}
101+
102+ def parse(self):
103+ """parse probert 'dasd' data format.
104+
105+ returns tuple of lists: (configs, errors)
106+ contain configs of type:dasd and any errors.
107+ """
108+ configs = []
109+ errors = []
110+ for dasd_name, dasd_config in self.class_data.items():
111+ entry = self.asdict(dasd_config)
112+ if entry:
113+ try:
114+ validate_config(entry)
115+ except ValueError as e:
116+ errors.append(e)
117+ continue
118+ configs.append(entry)
119+ return (configs, errors)
120+
121+
122 class DmcryptParser(ProbertParser):
123
124 probe_data_key = 'dmcrypt'
125@@ -1201,6 +1252,7 @@ def extract_storage_config(probe_data, strict=False):
126 convert_map = {
127 'bcache': BcacheParser,
128 'blockdev': BlockdevParser,
129+ 'dasd': DasdParser,
130 'dmcrypt': DmcryptParser,
131 'filesystem': FilesystemParser,
132 'lvm': LvmParser,
133@@ -1218,6 +1270,7 @@ def extract_storage_config(probe_data, strict=False):
134 errors.extend(found_errs)
135
136 LOG.debug('Sorting extracted configurations')
137+ dasd = [cfg for cfg in configs if cfg.get('type') == 'dasd']
138 disk = [cfg for cfg in configs if cfg.get('type') == 'disk']
139 part = [cfg for cfg in configs if cfg.get('type') == 'partition']
140 format = [cfg for cfg in configs if cfg.get('type') == 'format']
141@@ -1230,8 +1283,8 @@ def extract_storage_config(probe_data, strict=False):
142 zpool = [cfg for cfg in configs if cfg.get('type') == 'zpool']
143 zfs = [cfg for cfg in configs if cfg.get('type') == 'zfs']
144
145- ordered = (disk + part + format + lvols + lparts + raids + dmcrypts +
146- mounts + bcache + zpool + zfs)
147+ ordered = (dasd + disk + part + format + lvols + lparts + raids +
148+ dmcrypts + mounts + bcache + zpool + zfs)
149
150 final_config = {'storage': {'version': 1, 'config': ordered}}
151 try:
152diff --git a/tests/data/probert_storage_dasd.json b/tests/data/probert_storage_dasd.json
153new file mode 100644
154index 0000000..052d285
155--- /dev/null
156+++ b/tests/data/probert_storage_dasd.json
157@@ -0,0 +1,809 @@
158+{
159+ "storage": {
160+ "bcache": {
161+ "backing": {},
162+ "caching": {}
163+ },
164+ "blockdev": {
165+ "/dev/dasda": {
166+ "DEVLINKS": "/dev/disk/by-path/ccw-0.0.1522 /dev/disk/by-id/ccw-IBM.750000000DXP71.1500.22 /dev/disk/by-id/ccw-0X1522",
167+ "DEVNAME": "/dev/dasda",
168+ "DEVPATH": "/devices/css0/0.0.0182/0.0.1522/block/dasda",
169+ "DEVTYPE": "disk",
170+ "DM_MULTIPATH_DEVICE_PATH": "0",
171+ "ID_BUS": "ccw",
172+ "ID_PATH": "ccw-0.0.1522",
173+ "ID_PATH_TAG": "ccw-0_0_1522",
174+ "ID_SERIAL": "0X1522",
175+ "ID_TYPE": "disk",
176+ "ID_UID": "IBM.750000000DXP71.1500.22",
177+ "ID_XUID": "IBM.750000000DXP71.1500.22",
178+ "MAJOR": "94",
179+ "MINOR": "0",
180+ "MPATH_SBIN_PATH": "/sbin",
181+ "SUBSYSTEM": "block",
182+ "TAGS": ":systemd:",
183+ "USEC_INITIALIZED": "9673909",
184+ "attrs": {
185+ "alignment_offset": "0",
186+ "bdi": null,
187+ "capability": "10",
188+ "dev": "94:0",
189+ "device": null,
190+ "discard_alignment": "0",
191+ "ext_range": "4",
192+ "hidden": "0",
193+ "inflight": " 0 0",
194+ "range": "4",
195+ "removable": "0",
196+ "ro": "0",
197+ "size": "7385333760",
198+ "stat": " 4147 0 362632 30170 0 0 0 0 0 65899730 65946590",
199+ "subsystem": "block",
200+ "uevent": "MAJOR=94\nMINOR=0\nDEVNAME=dasda\nDEVTYPE=disk"
201+ }
202+ },
203+ "/dev/dasda1": {
204+ "DEVLINKS": "/dev/disk/by-path/ccw-0.0.1522-part1 /dev/disk/by-id/ccw-0X1522-part1 /dev/disk/by-id/ccw-IBM.750000000DXP71.1500.22-part1",
205+ "DEVNAME": "/dev/dasda1",
206+ "DEVPATH": "/devices/css0/0.0.0182/0.0.1522/block/dasda/dasda1",
207+ "DEVTYPE": "partition",
208+ "DM_MULTIPATH_DEVICE_PATH": "0",
209+ "ID_BUS": "ccw",
210+ "ID_PATH": "ccw-0.0.1522",
211+ "ID_PATH_TAG": "ccw-0_0_1522",
212+ "ID_SCSI": "1",
213+ "ID_SERIAL": "0X1522",
214+ "ID_TYPE": "disk",
215+ "ID_UID": "IBM.750000000DXP71.1500.22",
216+ "ID_XUID": "IBM.750000000DXP71.1500.22",
217+ "MAJOR": "94",
218+ "MINOR": "1",
219+ "PARTN": "1",
220+ "SUBSYSTEM": "block",
221+ "TAGS": ":systemd:",
222+ "USEC_INITIALIZED": "2787550366261",
223+ "attrs": {
224+ "alignment_offset": "0",
225+ "dev": "94:1",
226+ "discard_alignment": "0",
227+ "inflight": " 0 0",
228+ "partition": "1",
229+ "ro": "0",
230+ "size": "2147598336",
231+ "start": "192",
232+ "stat": " 261 0 27104 650 0 0 0 0 0 890 940",
233+ "subsystem": "block",
234+ "uevent": "MAJOR=94\nMINOR=1\nDEVNAME=dasda1\nDEVTYPE=partition\nPARTN=1"
235+ }
236+ },
237+ "/dev/dasda2": {
238+ "DEVLINKS": "/dev/disk/by-id/ccw-0X1522-part2 /dev/disk/by-path/ccw-0.0.1522-part2 /dev/disk/by-id/ccw-IBM.750000000DXP71.1500.22-part2",
239+ "DEVNAME": "/dev/dasda2",
240+ "DEVPATH": "/devices/css0/0.0.0182/0.0.1522/block/dasda/dasda2",
241+ "DEVTYPE": "partition",
242+ "DM_MULTIPATH_DEVICE_PATH": "0",
243+ "ID_BUS": "ccw",
244+ "ID_PATH": "ccw-0.0.1522",
245+ "ID_PATH_TAG": "ccw-0_0_1522",
246+ "ID_SCSI": "1",
247+ "ID_SERIAL": "0X1522",
248+ "ID_TYPE": "disk",
249+ "ID_UID": "IBM.750000000DXP71.1500.22",
250+ "ID_XUID": "IBM.750000000DXP71.1500.22",
251+ "MAJOR": "94",
252+ "MINOR": "2",
253+ "PARTN": "2",
254+ "SUBSYSTEM": "block",
255+ "TAGS": ":systemd:",
256+ "USEC_INITIALIZED": "2787550369490",
257+ "attrs": {
258+ "alignment_offset": "0",
259+ "dev": "94:2",
260+ "discard_alignment": "0",
261+ "inflight": " 0 0",
262+ "partition": "2",
263+ "ro": "0",
264+ "size": "2147598336",
265+ "start": "4194720",
266+ "stat": " 253 0 26304 580 0 0 0 0 0 840 940",
267+ "subsystem": "block",
268+ "uevent": "MAJOR=94\nMINOR=2\nDEVNAME=dasda2\nDEVTYPE=partition\nPARTN=2"
269+ }
270+ },
271+ "/dev/dasda3": {
272+ "DEVLINKS": "/dev/disk/by-path/ccw-0.0.1522-part3 /dev/disk/by-id/ccw-0X1522-part3 /dev/disk/by-id/ccw-IBM.750000000DXP71.1500.22-part3",
273+ "DEVNAME": "/dev/dasda3",
274+ "DEVPATH": "/devices/css0/0.0.0182/0.0.1522/block/dasda/dasda3",
275+ "DEVTYPE": "partition",
276+ "DM_MULTIPATH_DEVICE_PATH": "0",
277+ "ID_BUS": "ccw",
278+ "ID_PATH": "ccw-0.0.1522",
279+ "ID_PATH_TAG": "ccw-0_0_1522",
280+ "ID_SCSI": "1",
281+ "ID_SERIAL": "0X1522",
282+ "ID_TYPE": "disk",
283+ "ID_UID": "IBM.750000000DXP71.1500.22",
284+ "ID_XUID": "IBM.750000000DXP71.1500.22",
285+ "MAJOR": "94",
286+ "MINOR": "3",
287+ "PARTN": "3",
288+ "SUBSYSTEM": "block",
289+ "TAGS": ":systemd:",
290+ "USEC_INITIALIZED": "2787550372233",
291+ "attrs": {
292+ "alignment_offset": "0",
293+ "dev": "94:3",
294+ "discard_alignment": "0",
295+ "inflight": " 0 0",
296+ "partition": "3",
297+ "ro": "0",
298+ "size": "2147598336",
299+ "start": "8389248",
300+ "stat": " 253 0 26304 730 0 0 0 0 0 900 1150",
301+ "subsystem": "block",
302+ "uevent": "MAJOR=94\nMINOR=3\nDEVNAME=dasda3\nDEVTYPE=partition\nPARTN=3"
303+ }
304+ },
305+ "/dev/dasdb": {
306+ "DEVLINKS": "/dev/disk/by-path/ccw-0.0.1520 /dev/disk/by-id/ccw-0X1520 /dev/disk/by-id/ccw-IBM.750000000DXP71.1500.20",
307+ "DEVNAME": "/dev/dasdb",
308+ "DEVPATH": "/devices/css0/0.0.0180/0.0.1520/block/dasdb",
309+ "DEVTYPE": "disk",
310+ "DM_MULTIPATH_DEVICE_PATH": "0",
311+ "ID_BUS": "ccw",
312+ "ID_PATH": "ccw-0.0.1520",
313+ "ID_PATH_TAG": "ccw-0_0_1520",
314+ "ID_SERIAL": "0X1520",
315+ "ID_TYPE": "disk",
316+ "ID_UID": "IBM.750000000DXP71.1500.20",
317+ "ID_XUID": "IBM.750000000DXP71.1500.20",
318+ "MAJOR": "94",
319+ "MINOR": "4",
320+ "MPATH_SBIN_PATH": "/sbin",
321+ "SUBSYSTEM": "block",
322+ "TAGS": ":systemd:",
323+ "USEC_INITIALIZED": "9682643",
324+ "attrs": {
325+ "alignment_offset": "0",
326+ "bdi": null,
327+ "capability": "10",
328+ "dev": "94:4",
329+ "device": null,
330+ "discard_alignment": "0",
331+ "ext_range": "4",
332+ "hidden": "0",
333+ "inflight": " 0 0",
334+ "range": "4",
335+ "removable": "0",
336+ "ro": "0",
337+ "size": "7385333760",
338+ "stat": " 1337 0 109632 7030 0 0 0 0 0 65890790 65891590",
339+ "subsystem": "block",
340+ "uevent": "MAJOR=94\nMINOR=4\nDEVNAME=dasdb\nDEVTYPE=disk"
341+ }
342+ },
343+ "/dev/dasdb1": {
344+ "DEVLINKS": "/dev/disk/by-id/ccw-IBM.750000000DXP71.1500.20-part1 /dev/disk/by-label/dasd_root /dev/disk/by-path/ccw-0.0.1520-part1 /dev/disk/by-id/ccw-0X1520-part1 /dev/disk/by-uuid/7ac5930d-1798-460e-ba58-ccf536acc6be",
345+ "DEVNAME": "/dev/dasdb1",
346+ "DEVPATH": "/devices/css0/0.0.0180/0.0.1520/block/dasdb/dasdb1",
347+ "DEVTYPE": "partition",
348+ "DM_MULTIPATH_DEVICE_PATH": "0",
349+ "ID_BUS": "ccw",
350+ "ID_FS_LABEL": "dasd_root",
351+ "ID_FS_LABEL_ENC": "dasd_root",
352+ "ID_FS_TYPE": "ext4",
353+ "ID_FS_USAGE": "filesystem",
354+ "ID_FS_UUID": "7ac5930d-1798-460e-ba58-ccf536acc6be",
355+ "ID_FS_UUID_ENC": "7ac5930d-1798-460e-ba58-ccf536acc6be",
356+ "ID_FS_VERSION": "1.0",
357+ "ID_PATH": "ccw-0.0.1520",
358+ "ID_PATH_TAG": "ccw-0_0_1520",
359+ "ID_SCSI": "1",
360+ "ID_SERIAL": "0X1520",
361+ "ID_TYPE": "disk",
362+ "ID_UID": "IBM.750000000DXP71.1500.20",
363+ "ID_XUID": "IBM.750000000DXP71.1500.20",
364+ "MAJOR": "94",
365+ "MINOR": "5",
366+ "PARTN": "1",
367+ "SUBSYSTEM": "block",
368+ "TAGS": ":systemd:",
369+ "USEC_INITIALIZED": "2787546035084",
370+ "attrs": {
371+ "alignment_offset": "0",
372+ "dev": "94:5",
373+ "discard_alignment": "0",
374+ "inflight": " 0 0",
375+ "partition": "1",
376+ "ro": "0",
377+ "size": "3221323776",
378+ "start": "192",
379+ "stat": " 210 0 15880 160 0 0 0 0 0 380 410",
380+ "subsystem": "block",
381+ "uevent": "MAJOR=94\nMINOR=5\nDEVNAME=dasdb1\nDEVTYPE=partition\nPARTN=1"
382+ }
383+ },
384+ "/dev/dasdc": {
385+ "DEVLINKS": "/dev/disk/by-id/ccw-IBM.750000000DXP71.1500.1f /dev/disk/by-id/ccw-0X151F /dev/disk/by-path/ccw-0.0.151f",
386+ "DEVNAME": "/dev/dasdc",
387+ "DEVPATH": "/devices/css0/0.0.017f/0.0.151f/block/dasdc",
388+ "DEVTYPE": "disk",
389+ "DM_MULTIPATH_DEVICE_PATH": "0",
390+ "ID_BUS": "ccw",
391+ "ID_PATH": "ccw-0.0.151f",
392+ "ID_PATH_TAG": "ccw-0_0_151f",
393+ "ID_SERIAL": "0X151F",
394+ "ID_TYPE": "disk",
395+ "ID_UID": "IBM.750000000DXP71.1500.1f",
396+ "ID_XUID": "IBM.750000000DXP71.1500.1f",
397+ "MAJOR": "94",
398+ "MINOR": "8",
399+ "MPATH_SBIN_PATH": "/sbin",
400+ "SUBSYSTEM": "block",
401+ "TAGS": ":systemd:",
402+ "USEC_INITIALIZED": "9670665",
403+ "attrs": {
404+ "alignment_offset": "0",
405+ "bdi": null,
406+ "capability": "10",
407+ "dev": "94:8",
408+ "device": null,
409+ "discard_alignment": "0",
410+ "ext_range": "4",
411+ "hidden": "0",
412+ "inflight": " 0 0",
413+ "range": "4",
414+ "removable": "0",
415+ "ro": "0",
416+ "size": "7385333760",
417+ "stat": " 2797 0 239184 23300 0 0 0 0 0 65889970 65918210",
418+ "subsystem": "block",
419+ "uevent": "MAJOR=94\nMINOR=8\nDEVNAME=dasdc\nDEVTYPE=disk"
420+ }
421+ },
422+ "/dev/dasdc1": {
423+ "DEVLINKS": "/dev/disk/by-id/ccw-0X151F-part1 /dev/disk/by-uuid/304972bd-27be-471b-9695-429851622e2d /dev/disk/by-path/ccw-0.0.151f-part1 /dev/disk/by-id/ccw-IBM.750000000DXP71.1500.1f-part1",
424+ "DEVNAME": "/dev/dasdc1",
425+ "DEVPATH": "/devices/css0/0.0.017f/0.0.151f/block/dasdc/dasdc1",
426+ "DEVTYPE": "partition",
427+ "DM_MULTIPATH_DEVICE_PATH": "0",
428+ "ID_BUS": "ccw",
429+ "ID_FS_TYPE": "crypto_LUKS",
430+ "ID_FS_USAGE": "crypto",
431+ "ID_FS_UUID": "304972bd-27be-471b-9695-429851622e2d",
432+ "ID_FS_UUID_ENC": "304972bd-27be-471b-9695-429851622e2d",
433+ "ID_FS_VERSION": "2",
434+ "ID_PATH": "ccw-0.0.151f",
435+ "ID_PATH_TAG": "ccw-0_0_151f",
436+ "ID_SCSI": "1",
437+ "ID_SERIAL": "0X151F",
438+ "ID_TYPE": "disk",
439+ "ID_UID": "IBM.750000000DXP71.1500.1f",
440+ "ID_XUID": "IBM.750000000DXP71.1500.1f",
441+ "MAJOR": "94",
442+ "MINOR": "9",
443+ "PARTN": "1",
444+ "SUBSYSTEM": "block",
445+ "TAGS": ":systemd:",
446+ "USEC_INITIALIZED": "343420823392",
447+ "attrs": {
448+ "alignment_offset": "0",
449+ "dev": "94:9",
450+ "discard_alignment": "0",
451+ "inflight": " 0 0",
452+ "partition": "1",
453+ "ro": "0",
454+ "size": "2147598336",
455+ "start": "192",
456+ "stat": " 111 0 10800 70 0 0 0 0 0 250 250",
457+ "subsystem": "block",
458+ "uevent": "MAJOR=94\nMINOR=9\nDEVNAME=dasdc1\nDEVTYPE=partition\nPARTN=1"
459+ }
460+ },
461+ "/dev/dasdc2": {
462+ "DEVLINKS": "/dev/disk/by-label/dasd_boot /dev/disk/by-path/ccw-0.0.151f-part2 /dev/disk/by-id/ccw-0X151F-part2 /dev/disk/by-id/ccw-IBM.750000000DXP71.1500.1f-part2 /dev/disk/by-uuid/6077f46f-106e-4714-9e3d-ca4f4c588144",
463+ "DEVNAME": "/dev/dasdc2",
464+ "DEVPATH": "/devices/css0/0.0.017f/0.0.151f/block/dasdc/dasdc2",
465+ "DEVTYPE": "partition",
466+ "DM_MULTIPATH_DEVICE_PATH": "0",
467+ "ID_BUS": "ccw",
468+ "ID_FS_LABEL": "dasd_boot",
469+ "ID_FS_LABEL_ENC": "dasd_boot",
470+ "ID_FS_TYPE": "ext4",
471+ "ID_FS_USAGE": "filesystem",
472+ "ID_FS_UUID": "6077f46f-106e-4714-9e3d-ca4f4c588144",
473+ "ID_FS_UUID_ENC": "6077f46f-106e-4714-9e3d-ca4f4c588144",
474+ "ID_FS_VERSION": "1.0",
475+ "ID_PATH": "ccw-0.0.151f",
476+ "ID_PATH_TAG": "ccw-0_0_151f",
477+ "ID_SCSI": "1",
478+ "ID_SERIAL": "0X151F",
479+ "ID_TYPE": "disk",
480+ "ID_UID": "IBM.750000000DXP71.1500.1f",
481+ "ID_XUID": "IBM.750000000DXP71.1500.1f",
482+ "MAJOR": "94",
483+ "MINOR": "10",
484+ "PARTN": "2",
485+ "SUBSYSTEM": "block",
486+ "TAGS": ":systemd:",
487+ "USEC_INITIALIZED": "343420828721",
488+ "attrs": {
489+ "alignment_offset": "0",
490+ "dev": "94:10",
491+ "discard_alignment": "0",
492+ "inflight": " 0 0",
493+ "partition": "2",
494+ "ro": "0",
495+ "size": "536985600",
496+ "start": "4194720",
497+ "stat": " 243 0 17296 380 0 0 0 0 0 660 720",
498+ "subsystem": "block",
499+ "uevent": "MAJOR=94\nMINOR=10\nDEVNAME=dasdc2\nDEVTYPE=partition\nPARTN=2"
500+ }
501+ },
502+ "/dev/dasdc3": {
503+ "DEVLINKS": "/dev/disk/by-id/ccw-0X151F-part3 /dev/disk/by-id/ccw-IBM.750000000DXP71.1500.1f-part3 /dev/disk/by-path/ccw-0.0.151f-part3",
504+ "DEVNAME": "/dev/dasdc3",
505+ "DEVPATH": "/devices/css0/0.0.017f/0.0.151f/block/dasdc/dasdc3",
506+ "DEVTYPE": "partition",
507+ "DM_MULTIPATH_DEVICE_PATH": "0",
508+ "ID_BUS": "ccw",
509+ "ID_PATH": "ccw-0.0.151f",
510+ "ID_PATH_TAG": "ccw-0_0_151f",
511+ "ID_SCSI": "1",
512+ "ID_SERIAL": "0X151F",
513+ "ID_TYPE": "disk",
514+ "ID_UID": "IBM.750000000DXP71.1500.1f",
515+ "ID_XUID": "IBM.750000000DXP71.1500.1f",
516+ "MAJOR": "94",
517+ "MINOR": "11",
518+ "PARTN": "3",
519+ "SUBSYSTEM": "block",
520+ "TAGS": ":systemd:",
521+ "USEC_INITIALIZED": "343420856969",
522+ "attrs": {
523+ "alignment_offset": "0",
524+ "dev": "94:11",
525+ "discard_alignment": "0",
526+ "inflight": " 0 0",
527+ "partition": "3",
528+ "ro": "0",
529+ "size": "2147598336",
530+ "start": "5243520",
531+ "stat": " 294 0 28520 260 0 0 0 0 0 570 630",
532+ "subsystem": "block",
533+ "uevent": "MAJOR=94\nMINOR=11\nDEVNAME=dasdc3\nDEVTYPE=partition\nPARTN=3"
534+ }
535+ },
536+ "/dev/dasdd": {
537+ "DEVLINKS": "/dev/disk/by-id/ccw-0X1544 /dev/disk/by-id/ccw-IBM.750000000DXP71.1500.44 /dev/disk/by-path/ccw-0.0.1544",
538+ "DEVNAME": "/dev/dasdd",
539+ "DEVPATH": "/devices/css0/0.0.01a4/0.0.1544/block/dasdd",
540+ "DEVTYPE": "disk",
541+ "DM_MULTIPATH_DEVICE_PATH": "0",
542+ "ID_BUS": "ccw",
543+ "ID_PATH": "ccw-0.0.1544",
544+ "ID_PATH_TAG": "ccw-0_0_1544",
545+ "ID_SERIAL": "0X1544",
546+ "ID_TYPE": "disk",
547+ "ID_UID": "IBM.750000000DXP71.1500.44",
548+ "ID_XUID": "IBM.750000000DXP71.1500.44",
549+ "MAJOR": "94",
550+ "MINOR": "12",
551+ "MPATH_SBIN_PATH": "/sbin",
552+ "SUBSYSTEM": "block",
553+ "TAGS": ":systemd:",
554+ "USEC_INITIALIZED": "9115416",
555+ "attrs": {
556+ "alignment_offset": "0",
557+ "bdi": null,
558+ "capability": "10",
559+ "dev": "94:12",
560+ "device": null,
561+ "discard_alignment": "0",
562+ "ext_range": "4",
563+ "hidden": "0",
564+ "inflight": " 0 0",
565+ "range": "4",
566+ "removable": "0",
567+ "ro": "0",
568+ "size": "22156001280",
569+ "stat": " 30819 8613 1477104 291110 442189 346221 19369344 633810 0 2792925220 2801319660",
570+ "subsystem": "block",
571+ "uevent": "MAJOR=94\nMINOR=12\nDEVNAME=dasdd\nDEVTYPE=disk"
572+ }
573+ },
574+ "/dev/dasdd1": {
575+ "DEVLINKS": "/dev/disk/by-id/ccw-IBM.750000000DXP71.1500.44-part1 /dev/disk/by-id/ccw-0X1544-part1 /dev/disk/by-uuid/0ef8a516-dcab-43d4-84d5-b3fd9d355ca8 /dev/disk/by-path/ccw-0.0.1544-part1",
576+ "DEVNAME": "/dev/dasdd1",
577+ "DEVPATH": "/devices/css0/0.0.01a4/0.0.1544/block/dasdd/dasdd1",
578+ "DEVTYPE": "partition",
579+ "DM_MULTIPATH_DEVICE_PATH": "0",
580+ "ID_BUS": "ccw",
581+ "ID_FS_TYPE": "ext4",
582+ "ID_FS_USAGE": "filesystem",
583+ "ID_FS_UUID": "0ef8a516-dcab-43d4-84d5-b3fd9d355ca8",
584+ "ID_FS_UUID_ENC": "0ef8a516-dcab-43d4-84d5-b3fd9d355ca8",
585+ "ID_FS_VERSION": "1.0",
586+ "ID_PATH": "ccw-0.0.1544",
587+ "ID_PATH_TAG": "ccw-0_0_1544",
588+ "ID_SCSI": "1",
589+ "ID_SERIAL": "0X1544",
590+ "ID_TYPE": "disk",
591+ "ID_UID": "IBM.750000000DXP71.1500.44",
592+ "ID_XUID": "IBM.750000000DXP71.1500.44",
593+ "MAJOR": "94",
594+ "MINOR": "13",
595+ "PARTN": "1",
596+ "SUBSYSTEM": "block",
597+ "TAGS": ":systemd:",
598+ "USEC_INITIALIZED": "9184782",
599+ "attrs": {
600+ "alignment_offset": "0",
601+ "dev": "94:13",
602+ "discard_alignment": "0",
603+ "inflight": " 0 0",
604+ "partition": "1",
605+ "ro": "0",
606+ "size": "22155804672",
607+ "start": "192",
608+ "stat": " 30639 8613 1456680 290220 442189 346221 19369344 633810 0 319010 1173570",
609+ "subsystem": "block",
610+ "uevent": "MAJOR=94\nMINOR=13\nDEVNAME=dasdd1\nDEVTYPE=partition\nPARTN=1"
611+ }
612+ },
613+ "/dev/dasde": {
614+ "DEVLINKS": "/dev/disk/by-path/ccw-0.0.2520",
615+ "DEVNAME": "/dev/dasde",
616+ "DEVPATH": "/devices/css0/0.0.05e0/0.0.2520/block/dasde",
617+ "DEVTYPE": "disk",
618+ "DM_MULTIPATH_DEVICE_PATH": "0",
619+ "ID_PATH": "ccw-0.0.2520",
620+ "ID_PATH_TAG": "ccw-0_0_2520",
621+ "MAJOR": "94",
622+ "MINOR": "16",
623+ "MPATH_SBIN_PATH": "/sbin",
624+ "SUBSYSTEM": "block",
625+ "TAGS": ":systemd:",
626+ "USEC_INITIALIZED": "9132745",
627+ "attrs": {
628+ "alignment_offset": "0",
629+ "bdi": null,
630+ "capability": "10",
631+ "dev": "94:16",
632+ "device": null,
633+ "discard_alignment": "0",
634+ "ext_range": "4",
635+ "hidden": "0",
636+ "inflight": " 0 0",
637+ "range": "4",
638+ "removable": "0",
639+ "ro": "0",
640+ "size": "0",
641+ "stat": " 0 0 0 0 0 0 0 0 0 0 0",
642+ "subsystem": "block",
643+ "uevent": "MAJOR=94\nMINOR=16\nDEVNAME=dasde\nDEVTYPE=disk"
644+ }
645+ }
646+ },
647+ "dasd": {
648+ "/dev/dasda": {
649+ "blocksize": 4096,
650+ "device_id": "0.0.1522",
651+ "disk_layout": "cdl",
652+ "name": "/dev/dasda"
653+ },
654+ "/dev/dasdb": {
655+ "blocksize": 4096,
656+ "device_id": "0.0.1520",
657+ "disk_layout": "cdl",
658+ "name": "/dev/dasdb"
659+ },
660+ "/dev/dasdc": {
661+ "blocksize": 4096,
662+ "device_id": "0.0.151f",
663+ "disk_layout": "cdl",
664+ "name": "/dev/dasdc"
665+ },
666+ "/dev/dasdd": {
667+ "blocksize": 4096,
668+ "device_id": "0.0.1544",
669+ "disk_layout": "cdl",
670+ "name": "/dev/dasdd"
671+ },
672+ "/dev/dasde": {
673+ "blocksize": 512,
674+ "device_id": "0.0.2520",
675+ "disk_layout": "not-formatted",
676+ "name": "/dev/dasde"
677+ }
678+ },
679+ "dmcrypt": {},
680+ "filesystem": {
681+ "/dev/dasdb1": {
682+ "LABEL": "dasd_root",
683+ "LABEL_ENC": "dasd_root",
684+ "TYPE": "ext4",
685+ "USAGE": "filesystem",
686+ "UUID": "7ac5930d-1798-460e-ba58-ccf536acc6be",
687+ "UUID_ENC": "7ac5930d-1798-460e-ba58-ccf536acc6be",
688+ "VERSION": "1.0"
689+ },
690+ "/dev/dasdc2": {
691+ "LABEL": "dasd_boot",
692+ "LABEL_ENC": "dasd_boot",
693+ "TYPE": "ext4",
694+ "USAGE": "filesystem",
695+ "UUID": "6077f46f-106e-4714-9e3d-ca4f4c588144",
696+ "UUID_ENC": "6077f46f-106e-4714-9e3d-ca4f4c588144",
697+ "VERSION": "1.0"
698+ },
699+ "/dev/dasdd1": {
700+ "TYPE": "ext4",
701+ "USAGE": "filesystem",
702+ "UUID": "0ef8a516-dcab-43d4-84d5-b3fd9d355ca8",
703+ "UUID_ENC": "0ef8a516-dcab-43d4-84d5-b3fd9d355ca8",
704+ "VERSION": "1.0"
705+ }
706+ },
707+ "lvm": {},
708+ "mount": [
709+ {
710+ "children": [
711+ {
712+ "children": [
713+ {
714+ "fstype": "securityfs",
715+ "options": "rw,nosuid,nodev,noexec,relatime",
716+ "source": "securityfs",
717+ "target": "/sys/kernel/security"
718+ },
719+ {
720+ "children": [
721+ {
722+ "fstype": "cgroup2",
723+ "options": "rw,nosuid,nodev,noexec,relatime",
724+ "source": "cgroup2",
725+ "target": "/sys/fs/cgroup/unified"
726+ },
727+ {
728+ "fstype": "cgroup",
729+ "options": "rw,nosuid,nodev,noexec,relatime,xattr,name=systemd",
730+ "source": "cgroup",
731+ "target": "/sys/fs/cgroup/systemd"
732+ },
733+ {
734+ "fstype": "cgroup",
735+ "options": "rw,nosuid,nodev,noexec,relatime,perf_event",
736+ "source": "cgroup",
737+ "target": "/sys/fs/cgroup/perf_event"
738+ },
739+ {
740+ "fstype": "cgroup",
741+ "options": "rw,nosuid,nodev,noexec,relatime,blkio",
742+ "source": "cgroup",
743+ "target": "/sys/fs/cgroup/blkio"
744+ },
745+ {
746+ "fstype": "cgroup",
747+ "options": "rw,nosuid,nodev,noexec,relatime,hugetlb",
748+ "source": "cgroup",
749+ "target": "/sys/fs/cgroup/hugetlb"
750+ },
751+ {
752+ "fstype": "cgroup",
753+ "options": "rw,nosuid,nodev,noexec,relatime,freezer",
754+ "source": "cgroup",
755+ "target": "/sys/fs/cgroup/freezer"
756+ },
757+ {
758+ "fstype": "cgroup",
759+ "options": "rw,nosuid,nodev,noexec,relatime,rdma",
760+ "source": "cgroup",
761+ "target": "/sys/fs/cgroup/rdma"
762+ },
763+ {
764+ "fstype": "cgroup",
765+ "options": "rw,nosuid,nodev,noexec,relatime,net_cls,net_prio",
766+ "source": "cgroup",
767+ "target": "/sys/fs/cgroup/net_cls,net_prio"
768+ },
769+ {
770+ "fstype": "cgroup",
771+ "options": "rw,nosuid,nodev,noexec,relatime,pids",
772+ "source": "cgroup",
773+ "target": "/sys/fs/cgroup/pids"
774+ },
775+ {
776+ "fstype": "cgroup",
777+ "options": "rw,nosuid,nodev,noexec,relatime,cpu,cpuacct",
778+ "source": "cgroup",
779+ "target": "/sys/fs/cgroup/cpu,cpuacct"
780+ },
781+ {
782+ "fstype": "cgroup",
783+ "options": "rw,nosuid,nodev,noexec,relatime,cpuset",
784+ "source": "cgroup",
785+ "target": "/sys/fs/cgroup/cpuset"
786+ },
787+ {
788+ "fstype": "cgroup",
789+ "options": "rw,nosuid,nodev,noexec,relatime,devices",
790+ "source": "cgroup",
791+ "target": "/sys/fs/cgroup/devices"
792+ },
793+ {
794+ "fstype": "cgroup",
795+ "options": "rw,nosuid,nodev,noexec,relatime,memory",
796+ "source": "cgroup",
797+ "target": "/sys/fs/cgroup/memory"
798+ }
799+ ],
800+ "fstype": "tmpfs",
801+ "options": "ro,nosuid,nodev,noexec,mode=755",
802+ "source": "tmpfs",
803+ "target": "/sys/fs/cgroup"
804+ },
805+ {
806+ "fstype": "bpf",
807+ "options": "rw,nosuid,nodev,noexec,relatime,mode=700",
808+ "source": "bpf",
809+ "target": "/sys/fs/bpf"
810+ },
811+ {
812+ "children": [
813+ {
814+ "fstype": "tracefs",
815+ "options": "rw,nosuid,nodev,noexec,relatime",
816+ "source": "tracefs",
817+ "target": "/sys/kernel/debug/tracing"
818+ }
819+ ],
820+ "fstype": "debugfs",
821+ "options": "rw,nosuid,nodev,noexec,relatime",
822+ "source": "debugfs",
823+ "target": "/sys/kernel/debug"
824+ },
825+ {
826+ "fstype": "fusectl",
827+ "options": "rw,nosuid,nodev,noexec,relatime",
828+ "source": "fusectl",
829+ "target": "/sys/fs/fuse/connections"
830+ },
831+ {
832+ "fstype": "configfs",
833+ "options": "rw,nosuid,nodev,noexec,relatime",
834+ "source": "configfs",
835+ "target": "/sys/kernel/config"
836+ }
837+ ],
838+ "fstype": "sysfs",
839+ "options": "rw,nosuid,nodev,noexec,relatime",
840+ "source": "sysfs",
841+ "target": "/sys"
842+ },
843+ {
844+ "children": [
845+ {
846+ "fstype": "autofs",
847+ "options": "rw,relatime,fd=27,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=33414",
848+ "source": "systemd-1",
849+ "target": "/proc/sys/fs/binfmt_misc"
850+ }
851+ ],
852+ "fstype": "proc",
853+ "options": "rw,nosuid,nodev,noexec,relatime",
854+ "source": "proc",
855+ "target": "/proc"
856+ },
857+ {
858+ "children": [
859+ {
860+ "fstype": "devpts",
861+ "options": "rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000",
862+ "source": "devpts",
863+ "target": "/dev/pts"
864+ },
865+ {
866+ "fstype": "tmpfs",
867+ "options": "rw,nosuid,nodev",
868+ "source": "tmpfs",
869+ "target": "/dev/shm"
870+ },
871+ {
872+ "fstype": "mqueue",
873+ "options": "rw,nosuid,nodev,noexec,relatime",
874+ "source": "mqueue",
875+ "target": "/dev/mqueue"
876+ },
877+ {
878+ "fstype": "hugetlbfs",
879+ "options": "rw,relatime,pagesize=1M",
880+ "source": "hugetlbfs",
881+ "target": "/dev/hugepages"
882+ }
883+ ],
884+ "fstype": "devtmpfs",
885+ "options": "rw,nosuid,relatime,size=1932980k,nr_inodes=483245,mode=755",
886+ "source": "udev",
887+ "target": "/dev"
888+ },
889+ {
890+ "children": [
891+ {
892+ "fstype": "tmpfs",
893+ "options": "rw,nosuid,nodev,noexec,relatime,size=5120k",
894+ "source": "tmpfs",
895+ "target": "/run/lock"
896+ },
897+ {
898+ "fstype": "tmpfs",
899+ "options": "rw,nosuid,nodev,relatime,size=388824k,mode=700,uid=1001,gid=1002",
900+ "source": "tmpfs",
901+ "target": "/run/user/1001"
902+ },
903+ {
904+ "children": [
905+ {
906+ "fstype": "nsfs",
907+ "options": "rw",
908+ "source": "nsfs[mnt:[4026532054]]",
909+ "target": "/run/snapd/ns/lxd.mnt"
910+ }
911+ ],
912+ "fstype": "tmpfs",
913+ "options": "rw,nosuid,noexec,relatime,size=388828k,mode=755",
914+ "source": "tmpfs[/snapd/ns]",
915+ "target": "/run/snapd/ns"
916+ }
917+ ],
918+ "fstype": "tmpfs",
919+ "options": "rw,nosuid,noexec,relatime,size=388828k,mode=755",
920+ "source": "tmpfs",
921+ "target": "/run"
922+ },
923+ {
924+ "fstype": "squashfs",
925+ "options": "ro,nodev,relatime",
926+ "source": "/dev/loop2",
927+ "target": "/snap/core/8687"
928+ },
929+ {
930+ "fstype": "squashfs",
931+ "options": "ro,nodev,relatime",
932+ "source": "/dev/loop3",
933+ "target": "/snap/lxd/13473"
934+ },
935+ {
936+ "fstype": "squashfs",
937+ "options": "ro,nodev,relatime",
938+ "source": "/dev/loop0",
939+ "target": "/snap/lxd/13460"
940+ },
941+ {
942+ "fstype": "squashfs",
943+ "options": "ro,nodev,relatime",
944+ "source": "/dev/loop4",
945+ "target": "/snap/core/8591"
946+ },
947+ {
948+ "fstype": "fuse.lxcfs",
949+ "options": "rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other",
950+ "source": "lxcfs",
951+ "target": "/var/lib/lxcfs"
952+ }
953+ ],
954+ "fstype": "ext4",
955+ "options": "rw,relatime,errors=remount-ro",
956+ "source": "/dev/dasdd1",
957+ "target": "/"
958+ }
959+ ],
960+ "multipath": {},
961+ "raid": {},
962+ "zfs": {
963+ "zpools": {}
964+ }
965+ }
966+}
967diff --git a/tests/unittests/test_storage_config.py b/tests/unittests/test_storage_config.py
968index 199dd68..da83fec 100644
969--- a/tests/unittests/test_storage_config.py
970+++ b/tests/unittests/test_storage_config.py
971@@ -4,9 +4,9 @@ import json
972 from .helpers import CiTestCase, skipUnlessJsonSchema
973 from curtin import storage_config
974 from curtin.storage_config import ProbertParser as baseparser
975-from curtin.storage_config import (BcacheParser, BlockdevParser, DmcryptParser,
976- FilesystemParser, LvmParser, RaidParser,
977- MountParser, ZfsParser)
978+from curtin.storage_config import (BcacheParser, BlockdevParser, DasdParser,
979+ DmcryptParser, FilesystemParser, LvmParser,
980+ RaidParser, MountParser, ZfsParser)
981 from curtin import util
982
983
984@@ -426,6 +426,30 @@ class TestBlockdevParser(CiTestCase):
985 result = self.bdevp.blockdev_to_id(blockdev)
986 self.assertEqual('disk-sda', result)
987
988+ def test_blockdev_detects_dasd_device_id_and_vtoc_ptable(self):
989+ self.probe_data = _get_data('probert_storage_dasd.json')
990+ self.bdevp = BlockdevParser(self.probe_data)
991+ blockdev = self.bdevp.blockdev_data['/dev/dasdd']
992+ expected_dict = {
993+ 'device_id': '0.0.1544',
994+ 'id': 'disk-dasdd',
995+ 'path': '/dev/dasdd',
996+ 'ptable': 'vtoc',
997+ 'serial': '0X1544',
998+ 'type': 'disk'}
999+ self.assertDictEqual(expected_dict, self.bdevp.asdict(blockdev))
1000+
1001+ def test_blockdev_detects_dasd_device_id_and_unformatted_no_ptable(self):
1002+ self.probe_data = _get_data('probert_storage_dasd.json')
1003+ self.bdevp = BlockdevParser(self.probe_data)
1004+ blockdev = self.bdevp.blockdev_data['/dev/dasde']
1005+ expected_dict = {
1006+ 'device_id': '0.0.2520',
1007+ 'id': 'disk-dasde',
1008+ 'path': '/dev/dasde',
1009+ 'type': 'disk'}
1010+ self.assertDictEqual(expected_dict, self.bdevp.asdict(blockdev))
1011+
1012
1013 class TestFilesystemParser(CiTestCase):
1014
1015@@ -560,6 +584,40 @@ class TestRaidParser(CiTestCase):
1016 self.assertEqual(0, len(errors))
1017
1018
1019+class TestDasdParser(CiTestCase):
1020+
1021+ def setUp(self):
1022+ super(TestDasdParser, self).setUp()
1023+ self.probe_data = _get_data('probert_storage_dasd.json')
1024+ self.dasd = DasdParser(self.probe_data)
1025+
1026+ def test_dasd_parser(self):
1027+ """ DasdParser 'class_data' on instance matches input. """
1028+ self.assertDictEqual(self.probe_data['dasd'],
1029+ self.dasd.class_data)
1030+
1031+ def test_dasd_asdict(self):
1032+ """ DasdParser converts known dasd_data to expected dict. """
1033+ devname = "/dev/dasda"
1034+ expected_dict = {
1035+ 'type': 'dasd',
1036+ 'id': 'dasd-dasda',
1037+ 'device_id': '0.0.1522',
1038+ 'blocksize': 4096,
1039+ 'mode': 'quick',
1040+ 'disk_layout': 'cdl',
1041+ }
1042+ dasd_data = self.dasd.class_data[devname]
1043+ self.assertDictEqual(expected_dict, self.dasd.asdict(dasd_data))
1044+
1045+ @skipUnlessJsonSchema()
1046+ def test_dasd_parser_parses_all_dasd_devs(self):
1047+ """ DasdParser returns expected dicts for known dasd probe data."""
1048+ configs, errors = self.dasd.parse()
1049+ self.assertEqual(5, len(configs))
1050+ self.assertEqual(0, len(errors))
1051+
1052+
1053 class TestDmCryptParser(CiTestCase):
1054
1055 def setUp(self):
1056@@ -587,7 +645,7 @@ class TestDmCryptParser(CiTestCase):
1057
1058 @skipUnlessJsonSchema()
1059 def test_dmcrypt_parser_parses_all_crypt_devs(self):
1060- """ DmcryptParser returns expected dicts for known raid probe data."""
1061+ """ DmcryptParser returns expected dicts for known crypt probe data."""
1062 configs, errors = self.dmcrypt.parse()
1063 self.assertEqual(1, len(configs))
1064 self.assertEqual(0, len(errors))

Subscribers

People subscribed via source and target branches