test: Add a semaphore shell test

This test tests new language features and as a fan in-out graph.
This commit is contained in:
James Shubin
2019-01-17 19:20:35 -05:00
parent 354a1c23b0
commit 88498695ac
2 changed files with 23 additions and 0 deletions

15
test/shell/sema-2.mcl Normal file
View File

@@ -0,0 +1,15 @@
# fan in-out
exec ["exec1", "exec2", "exec3", "exec4", "exec5", "exec6", "exec7",] {
cmd => "sleep 10s",
shell => "",
timeout => 0,
Meta:sema => ["s:2",],
}
Exec["exec1"] -> Exec["exec4"]
Exec["exec2"] -> Exec["exec4"]
Exec["exec3"] -> Exec["exec4"]
Exec["exec4"] -> Exec["exec5"]
Exec["exec4"] -> Exec["exec6"]
Exec["exec4"] -> Exec["exec7"]

8
test/shell/sema-2.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash -e
# should take at least 55s, but fail if we block this
# TODO: it would be nice to make sure this test doesn't exit too early!
$timeout --kill-after=120s 110s "$MGMT" run --converged-timeout=5 --no-watch --no-pgp --tmp-prefix lang --lang sema-2.mcl &
pid=$!
wait $pid # get exit status
exit $?