test: Add a semaphore shell test
This test tests new language features and as a fan in-out graph.
This commit is contained in:
15
test/shell/sema-2.mcl
Normal file
15
test/shell/sema-2.mcl
Normal 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
8
test/shell/sema-2.sh
Executable 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 $?
|
||||||
Reference in New Issue
Block a user