sim: Add dependency tests to simulator
Create a trait `Depender` which is passed down to the image create and
verification to check and test for various types of dependency
resolution. Add a test that uses this to test the simple case of unmet
dependencies preventing an upgrade.
The actual test is disabled (with an `if false ...`) because the code
under test loops forever in this configuration.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/src/tlv.rs b/sim/src/tlv.rs
index 43dd2e2..c6f30dc 100644
--- a/sim/src/tlv.rs
+++ b/sim/src/tlv.rs
@@ -26,7 +26,7 @@
use mcuboot_sys::c;
#[repr(u8)]
-#[derive(Copy, Clone, PartialEq, Eq)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[allow(dead_code)] // TODO: For now
pub enum TlvKinds {
KEYHASH = 0x01,
@@ -74,6 +74,7 @@
fn make_tlv(self: Box<Self>) -> Vec<u8>;
}
+#[derive(Debug)]
pub struct TlvGen {
flags: u32,
kinds: Vec<TlvKinds>,
@@ -85,6 +86,7 @@
dependencies: Vec<Dependency>,
}
+#[derive(Debug)]
struct Dependency {
id: u8,
version: ImageVersion,