mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
nixos/tests/machinectl: Add declarative shared container
This commit is contained in:
parent
bdd7e48646
commit
f4f99bf8cc
@ -42,8 +42,18 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||
|
||||
virtualisation.additionalPaths = [ containerSystem ];
|
||||
|
||||
# not needed, but we want to test the nspawn file generation
|
||||
systemd.nspawn.${containerName} = { };
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /var/lib/machines/shared-decl 0755 root root - -"
|
||||
];
|
||||
systemd.nspawn.shared-decl = {
|
||||
execConfig = {
|
||||
Boot = false;
|
||||
Parameters = "${containerSystem}/init";
|
||||
};
|
||||
filesConfig = {
|
||||
BindReadOnly = "/nix/store";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."systemd-nspawn@${containerName}" = {
|
||||
serviceConfig.Environment = [
|
||||
@ -63,6 +73,11 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||
start_all()
|
||||
machine.wait_for_unit("default.target");
|
||||
|
||||
# Test machinectl start stop of shared-decl
|
||||
machine.succeed("machinectl start shared-decl");
|
||||
machine.wait_until_succeeds("systemctl -M shared-decl is-active default.target");
|
||||
machine.succeed("machinectl stop shared-decl");
|
||||
|
||||
# create containers root
|
||||
machine.succeed("mkdir -p ${containerRoot}");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user