From 62f857e35f94e98b3205502e410f0d727fa5ecc5 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Nov 2026 17:56:39 +0000 Subject: enstate: --stage, a submission for the next generation Plans against --schema, stores the snapshot under it, and puts no views in place and runs no reactions: the running generation goes on as it is, keeping what it has no slot for, and the switch (--migrate) brings the new views. The way to fill a required slot a generation adds before switching to it, and to bring a host's first state: with the new system's enstate, schema and configuration. Tests, and a subtest of the VM test that does so. --- tests/common/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/common/mod.rs') diff --git a/tests/common/mod.rs b/tests/common/mod.rs index f1f3f74..6f80d65 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -127,6 +127,17 @@ impl Host { enstate::migrate::migrate(&schema.0, &store, dry_run, &self.systemctl()).unwrap() } + /// Stages a submission for the generation of `schema`, before switching to it. + pub fn stage(&self, schema: &(Schema, Vec), dir: &Path) -> Plan { + let submission = Submission::load(dir).unwrap(); + let store = self.store(); + let lock = store.lock().unwrap(); + plan::plan(&schema.0, &store, &submission) + .unwrap() + .stage(&store, &schema.1, lock) + .unwrap() + } + /// The current snapshot's id of `channel`. pub fn snapshot(&self, channel: &str) -> Option { self.store() -- cgit v1.3.1