fix(t/evaluator/evaluate-oom): convert systemd-run presence check to eval, fix indentaion, show relationships between flags and commands with indentation

This commit is contained in:
Kayla Firestack 2022-05-02 14:40:13 -04:00
parent 01ec004108
commit e917d9e546

View file

@ -4,23 +4,34 @@ use Setup;
use Test2::V0;
use Hydra::Helper::Exec;
my ($systemdrRes) = captureStdoutStderr(3, (
"systemd-run", "--user", "--collect", "--scope", "--property", "MemoryMax=25M", "--",
eval {
captureStdoutStderr(3, (
"systemd-run",
"--user",
"--collect",
"--scope",
"--property",
"MemoryMax=25M",
"--",
"true"
));
} or do {
skip_all("systemd-run does not work in this environment");
};
skip_all("systemd-run does not work in this environment") if($systemdrRes != 0);
my ($res, $stdout, $stderr) = captureStdoutStderr(60,
(
"systemd-run", "--user", "--collect", "--scope", "--property", "MemoryMax=25M", "--",
my ($res, $stdout, $stderr) = captureStdoutStderr(60, (
"systemd-run",
"--user",
"--collect",
"--scope",
"--property",
"MemoryMax=25M",
"--",
"hydra-eval-jobs",
"-I", "/dev/zero",
"-I", "./t/jobs",
"./t/jobs/oom.nix"
)
);
));
isnt($res, 0, "hydra-eval-jobs exits non-zero");
ok(utf8::decode($stderr), "Stderr output is UTF8-clean");