in libazureinit/src/status.rs [301:322]
fn test_mark_provisioning_complete() {
let (test_config, test_dir) = create_test_config();
let mock_vm_id_path = test_dir.path().join("mock_product_uuid");
fs::write(&mock_vm_id_path, "550e8400-e29b-41d4-a716-446655440000")
.unwrap();
let vm_id = private_get_vm_id(
Some(mock_vm_id_path.to_str().unwrap()),
None,
None,
)
.unwrap();
let file_path = test_dir.path().join(format!("{}.provisioned", vm_id));
assert!(
!file_path.exists(),
"File should not exist before provisioning"
);
mark_provisioning_complete(Some(&test_config), &vm_id).unwrap();
assert!(file_path.exists(), "Provisioning file should be created");
}