Use the lib functions to (de)activate profiles.
This commit is contained in:
parent
7ab72d8c7f
commit
2368eec16e
2 changed files with 40 additions and 20 deletions
28
nix/lib.nix
28
nix/lib.nix
|
|
@ -284,12 +284,30 @@ in
|
|||
cp ${resultImg} $out
|
||||
'';
|
||||
|
||||
mkTestPreamble = node: action: ''
|
||||
${node}.succeed("/system-manager-profile/bin/${action} 2>&1 | tee /tmp/output.log")
|
||||
${node}.succeed("grep -vF 'ERROR' /tmp/output.log")
|
||||
'';
|
||||
mkTestPreamble =
|
||||
{ node
|
||||
, profile
|
||||
, action
|
||||
}: ''
|
||||
${node}.succeed("/${profile}/bin/${action} 2>&1 | tee /tmp/output.log")
|
||||
${node}.succeed("! grep -F 'ERROR' /tmp/output.log")
|
||||
'';
|
||||
|
||||
activateProfileSnippet = node: self.lib.mkTestPreamble node "activate";
|
||||
activateProfileSnippet = { node, profile ? "system-manager-profile" }:
|
||||
self.lib.mkTestPreamble {
|
||||
inherit node profile;
|
||||
action = "activate";
|
||||
};
|
||||
deactivateProfileSnippet = { node, profile ? "system-manager-profile" }:
|
||||
self.lib.mkTestPreamble {
|
||||
inherit node profile;
|
||||
action = "deactivate";
|
||||
};
|
||||
prepopulateProfileSnippet = { node, profile ? "system-manager-profile" }:
|
||||
self.lib.mkTestPreamble {
|
||||
inherit node profile;
|
||||
action = "prepopulate";
|
||||
};
|
||||
|
||||
make-vm-test =
|
||||
name:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue