in libazureinit/src/status.rs [378:395]
fn test_get_vm_id_gen1() {
let tmpdir = TempDir::new().unwrap();
let vm_uuid_path = tmpdir.path().join("product_uuid");
fs::write(&vm_uuid_path, "550e8400-e29b-41d4-a716-446655440000")
.unwrap();
// No sysfs_efi or dev_efi path created => means neither exists => expect Gen1
let res = private_get_vm_id(
Some(vm_uuid_path.to_str().unwrap()),
Some("/this_does_not_exist"),
Some("/still_nope"),
);
assert_eq!(
res.unwrap(),
"00840e55-9be2-d441-a716-446655440000",
"Should byte-swap for Gen1"
);
}