Use the lib functions to (de)activate profiles.

This commit is contained in:
r-vdp 2023-07-05 14:58:06 +02:00
parent 7ab72d8c7f
commit 2368eec16e
No known key found for this signature in database
2 changed files with 40 additions and 20 deletions

View file

@ -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: