diff options
| author | tv <tv@krebsco.de> | 2026-11-30 17:56:39 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-30 19:51:09 +0000 |
| commit | 62f857e35f94e98b3205502e410f0d727fa5ecc5 (patch) | |
| tree | 9f1197abecef97948480d710cfa4b01ad0dacf47 /tests/common/mod.rs | |
| parent | 94c73688f08dd4a6bb25c75e62cdaf7849f6c0a1 (diff) | |
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.
Diffstat (limited to 'tests/common/mod.rs')
| -rw-r--r-- | tests/common/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
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<u8>), 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<String> { self.store() |
