aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* enstate: refused submissions, visibletv4 days1-1/+62
| | | | | | | | | | | | | | A submission the switch refuses is moved to STATE/refused/NAME with NAME.json next to it: when, and why ("refused" if nothing more). The check's message names the waiting submission's path. --status lists what waits in the incoming directory, planned against the running generation (one the check refused stays waiting, and refuses switches while it does), and what was refused, with the reasons (and --json as data); it exits with 1 if something needs attention: a refused submission, a waiting one the running generation would refuse, an unfilled required slot, so that a deployment running it notices. --forget NAME removes a waiting or refused submission. After hrm's review.
* docs: a submission goes into the incoming directory wholetv5 days1-0/+4
| | | | | | | | Names starting with a dot are skipped there, so a provider copies a submission under one and renames it within the incoming directory: a receptor looking at it meanwhile (enstate.service, a check) never sees half a submission. Said in the design, the module's incomingDir, the store; and a test that a dot name is left alone.
* enstate: --pack --dry-run, every problem of a source listtv5 days1-0/+92
| | | | | | | | | | | Reads every source and writes nothing: every problem, not just the first, by address, with kind, location and variables, and the source, as text or JSON (--json): an item the schema has no slot for, a record in a type without records, a required slot without an item, a location that doesn't exist, a source that can't be read (with what it said), a record that isn't JSON. Exit status 1 if there are problems. --pack itself refuses with the same list; --out isn't for a dry run, --json only for one. The completion offers accordingly.
* enstate: locations in source liststv5 days1-0/+98
| | | | | | | | | A source declared once (locations, or in files of them the source list includes), which items use by name: their other fields are its variables, $(var:NAME) in its placeholders, as data (continuum's config at 45b0676). Its paths are relative to the file that declares it. A location that doesn't exist, a variable that isn't text, fields without a location, a location declared twice are errors.
* enstate: validators and renderers in a sandboxtv5 days2-1/+73
| | | | | | | | | | | By bubblewrap: everything read-only but OUT (and IN bound again after a fresh /tmp), a new /dev and /proc, namespaces of their own (no network), no capabilities, a new session, gone with the receptor. The setting sandbox is bwrap (found in the receptor's PATH, as the programs' environment is empty), or none; the module sets its bubblewrap. The tests run their programs in it where bubblewrap can make one (not in Nix's build sandbox), and a test checks that a program can't write outside OUT, nor into IN, and has no network nor environment.
* enstate: a setting the command doesn't use, as an argument, is an errortv5 days1-1/+16
| | | | | | | --state-dir and --run-dir with --pack, --systemctl but with --apply and --migrate, --unit but with --apply. From a configuration file, which holds them for every command, they are fine. The completion offers each command the settings it uses.
* enstate: --pack warns of an entry from text with placeholderstv5 days1-1/+3
| | | | | | Text loses its trailing line breaks, which a key or a certificate rarely should; a whole-value source (cmd:…, file:…, or a table) takes an entry byte-exact. The warning says so, and the entry goes in as asked.
* enstate: --apply starts the unit that runs --migrate again if it failedtv5 days1-0/+11
| | | | | | | The setting unit names it (the module: enstate.service). After a boot without state it failed; an accepted --apply starts it (--no-block, with the lock released), so it serves the views and is no longer failed.
* enstate: the state directory is root'stv5 days1-0/+7
| | | | | | The receptor makes the state directory 0700 whoever created it (a deploy copying into incoming/, say), and the module has tmpfiles keep it so.
* enstate: config with placeholders in parenthesestv5 days1-0/+7
| | | | | | The config crate at continuum's 34434f7 takes $(env:…), $(cmd:…) and $(file:…) as well as ${…}, so a source list may use either. A test packs a $(cmd: …) source.
* enstate: submissions waiting for the next switchtv5 days2-1/+71
| | | | | | | | | | | --migrate first takes the submissions in STATE/incoming, in the order of their names: planned against the schema, stored if accepted (their views follow with the rest), removed, and moved to STATE/refused if refused, which refuses the migration. A dry run (the check before a switch) does so on a copy of the snapshots, changing nothing. --stage leaves a marker, STATE/migrate-due, for the next switch to migrate even if the schema doesn't change; --migrate removes it. Scratch directories are cleaned up without following the symbolic links in them.
* enstate: --stage, a submission for the next generationtv5 days2-0/+93
| | | | | | | | | | 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.
* enstate: reactions after applying, and after a switchtv5 days3-6/+27
| | | | | | | | | | After applying, units are restarted or reloaded, and started if they aren't running: they may have failed for want of their views. That happens with the store's lock released: a unit restarted may want the one that runs --migrate, which waits for the lock. After a switch, --migrate runs from the unit that units using views are ordered after, so only running units react, without waiting for them (--no-block try-restart, try-reload-or-restart).
* enstate: --migrate, renames both ways, kept entriestv5 days3-97/+374
| | | | | | | | | | | | | What a generation sees of a snapshot accepted under another schema: same name and type, renamedFrom, a rename in the stored schema read backwards, and entries kept, with their types, in the snapshot's kept/. Plans start from what is seen, and store it under the running schema; a generation change rewrites no snapshot. --migrate (and --dry-run) says what each channel sees, refuses for required slots nothing fills, puts the views in place and runs their reactions; --materialize and --status go by what is seen, too. A view made from an unfilled required slot isn't there. The rollback cases of migrations.md that need no converters or steps are tests.
* enstate: the receptor and the provider, a first versiontv5 days1-0/+651
One program on a library: --plan and --apply of submissions (complete and partial, items required and optional, groups, removal, the chain as order), validators of types and across slots, views put in place by replacing a link, their reactions by systemctl; --status, --materialize; and --pack, a submission from a source list in JSON or TOML, by the config crate's sources. Programs by the protocol of design.md 5.2; tests with shell scripts as validators and renderers.