forked from lix-project/hydra
feat(t/evaluator/hydra-eval-jobs): add basic evaluation test for hydra-eval-jobs
This commit is contained in:
parent
90769ab5ad
commit
2c909c038f
25
t/evaluator/evaluate-oom-job.t
Normal file
25
t/evaluator/evaluate-oom-job.t
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Setup;
|
||||||
|
use Test2::V0;
|
||||||
|
use Hydra::Helper::Exec;
|
||||||
|
|
||||||
|
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");
|
||||||
|
like(
|
||||||
|
$stderr,
|
||||||
|
qr/^child process \(\d+?\) killed by signal=9$/m,
|
||||||
|
"The stderr record includes a relevant error message"
|
||||||
|
);
|
||||||
|
|
||||||
|
done_testing;
|
Loading…
Reference in a new issue