max / alloy
- Co-Authored-By
- Claude Opus 5 (1M context) <noreply@anthropic.com>
1 file changed,
+24 insertions,
-0 deletions
| @@ -5527,6 +5527,13 @@ | |||
| 5527 | 5527 | // had just installed to, once udev had settled. A hand-written fixture | |
| 5528 | 5528 | // cannot show that the GUID the code matches on is the one bootc sets; | |
| 5529 | 5529 | // this can, and it is the whole reason the discovery exists. | |
| 5530 | + | // | |
| 5531 | + | // Per-architecture, because the root GUID is: DPS assigns a different one | |
| 5532 | + | // to each, so a single fixture pins the constant on the arch it was | |
| 5533 | + | // captured from and fails on the other. Both spell the GUID out rather | |
| 5534 | + | // than interpolating ROOT_PARTITION_TYPE -- interpolating it would compare | |
| 5535 | + | // the constant against itself and pass whatever it held. | |
| 5536 | + | #[cfg(target_arch = "x86_64")] | |
| 5530 | 5537 | #[test] | |
| 5531 | 5538 | fn a_real_bootc_layout_yields_its_root_partition() { | |
| 5532 | 5539 | let listing = r#"{"blockdevices":[ | |
| @@ -5538,6 +5545,23 @@ | |||
| 5538 | 5545 | assert_eq!(root_partition(listing).unwrap(), "/dev/nbd0p3"); | |
| 5539 | 5546 | } | |
| 5540 | 5547 | ||
| 5548 | + | // The aarch64 counterpart. Same layout, and the root GUID is the one DPS | |
| 5549 | + | // assigns to "Root Partition (64-bit ARM/AArch64)"; the BIOS-boot and ESP | |
| 5550 | + | // GUIDs above are architecture-independent, so they carry over unchanged. | |
| 5551 | + | // Taken from the specification rather than a capture, since no aarch64 | |
| 5552 | + | // bootc install has been read back here yet. | |
| 5553 | + | #[cfg(target_arch = "aarch64")] | |
| 5554 | + | #[test] | |
| 5555 | + | fn a_real_bootc_layout_yields_its_root_partition() { | |
| 5556 | + | let listing = r#"{"blockdevices":[ | |
| 5557 | + | {"path": "/dev/nbd0", "parttype": null}, | |
| 5558 | + | {"path": "/dev/nbd0p1", "parttype": "21686148-6449-6e6f-744e-656564454649"}, | |
| 5559 | + | {"path": "/dev/nbd0p2", "parttype": "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"}, | |
| 5560 | + | {"path": "/dev/nbd0p3", "parttype": "b921b045-1df0-41c3-af44-4c6f280d3fae"} | |
| 5561 | + | ]}"#; | |
| 5562 | + | assert_eq!(root_partition(listing).unwrap(), "/dev/nbd0p3"); | |
| 5563 | + | } | |
| 5564 | + | ||
| 5541 | 5565 | // The same disk a moment earlier, before udev caught up with the table | |
| 5542 | 5566 | // bootc had written. Every parttype reads null, so the discovery reports | |
| 5543 | 5567 | // a disk that was in fact deployed as undeployed. install_plan waits on |