Change the name of the dm device for the correct_custom_roothash test
Each tests in apkdmverity.test creates a device mapper block device
having a specific name. Since the name is a global resource, multiple
tests shouldn't share the same name, otherwise a run of a test might
affect a run of another test.
The newly added test `correct_custom_roothash` incorrectly used the name
'correct' which is already being used by `correct_inputs`. Use a
different name.
Bug: 199801708
Test: monitor TH
Change-Id: Ie2d297b817da7a2a8edd0b7e23c9b5ce4843d598
diff --git a/apkdmverity/src/main.rs b/apkdmverity/src/main.rs
index cabeb35..5597e22 100644
--- a/apkdmverity/src/main.rs
+++ b/apkdmverity/src/main.rs
@@ -359,11 +359,17 @@
let apk = include_bytes!("../testdata/test.apk");
let idsig = include_bytes!("../testdata/test.apk.idsig");
let roothash = V4Signature::from(Cursor::new(&idsig)).unwrap().hashing_info.raw_root_hash;
- run_test_with_hash(apk.as_ref(), idsig.as_ref(), "correct", Some(&roothash), |ctx| {
- let verity = fs::read(&ctx.result.mapper_device).unwrap();
- let original = fs::read(&ctx.result.data_device).unwrap();
- assert_eq!(verity.len(), original.len()); // fail fast
- assert_eq!(verity.as_slice(), original.as_slice());
- });
+ run_test_with_hash(
+ apk.as_ref(),
+ idsig.as_ref(),
+ "correct_custom_roothash",
+ Some(&roothash),
+ |ctx| {
+ let verity = fs::read(&ctx.result.mapper_device).unwrap();
+ let original = fs::read(&ctx.result.data_device).unwrap();
+ assert_eq!(verity.len(), original.len()); // fail fast
+ assert_eq!(verity.as_slice(), original.as_slice());
+ },
+ );
}
}