summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/build.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/build.rs b/tests/build.rs
index fd919a0..d278bce 100644
--- a/tests/build.rs
+++ b/tests/build.rs
@@ -89,3 +89,23 @@ fn refuses_to_reuse_an_existing_workspace() {
assert!(error.to_string().contains("workspace already exists"));
assert!(installer.requests.borrow().is_empty());
}
+
+#[test]
+fn rejects_a_missing_apt_configuration_before_creating_the_workspace() {
+ let fixture = tempdir().expect("fixture directory");
+ let spec = ImageSpec::load(std::path::Path::new("profiles/alt-controller.toml"))
+ .expect("load controller spec");
+ let plan = BuildPlan::compile(spec).expect("compile build plan");
+ let installer = FixtureInstaller::default();
+ let mut executor = BuildExecutor::new(&installer, FixtureInitramfsBuilder);
+ let workspace = fixture.path().join("work");
+ let missing_apt_config = fixture.path().join("missing-apt.conf");
+
+ let error = executor
+ .execute(&plan, &workspace, &missing_apt_config, fixture.path().join("image.tar"))
+ .expect_err("missing APT configuration must be rejected");
+
+ assert!(error.to_string().contains("APT configuration does not exist"));
+ assert!(!workspace.exists());
+ assert!(installer.requests.borrow().is_empty());
+}