mirror of
https://github.com/troglobit/finit.git
synced 2026-11-01 13:10:32 +00:00
test: minor, replace 'texec sh -c' -> 'run'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
5a9cafc2fc
commit
b6769356b2
21 files changed
+170
-165
No files matched your search
+22
-22
@@ -22,7 +22,7 @@ test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
say "Running test teardown."
|
||||
texec rm -f "$TEST_CONF"
|
||||
run "rm -f $TEST_CONF"
|
||||
}
|
||||
|
||||
test_one()
|
||||
@@ -32,60 +32,60 @@ test_one()
|
||||
|
||||
sleep 5
|
||||
say 'Enable finit debug, try to figure out what is going on ...'
|
||||
texec sh -c "initctl debug"
|
||||
run "initctl debug"
|
||||
|
||||
say "Add stanza '$stanza' to $TEST_CONF ..."
|
||||
texec sh -c "echo '$stanza' > $TEST_CONF"
|
||||
run "echo '$stanza' > $TEST_CONF"
|
||||
|
||||
texec sh -c "ls -l /run/ /run/finit/"
|
||||
run "ls -l /run/ /run/finit/"
|
||||
say 'Reload Finit'
|
||||
texec sh -c "initctl ls"
|
||||
texec sh -c "initctl reload"
|
||||
texec sh -c "initctl status"
|
||||
texec sh -c "ps"
|
||||
run "initctl ls"
|
||||
run "initctl reload"
|
||||
run "initctl status"
|
||||
run "ps"
|
||||
|
||||
date
|
||||
sleep 2
|
||||
date
|
||||
texec sh -c "ls -l /run/ /run/finit/"
|
||||
run "ls -l /run/ /run/finit/"
|
||||
say 'Asserting condition'
|
||||
texec sh -c "initctl cond set $cond"
|
||||
run "initctl cond set $cond"
|
||||
|
||||
date
|
||||
sleep 2
|
||||
date
|
||||
texec sh -c "ls -l /run/ /run/finit/"
|
||||
texec sh -c "initctl status"
|
||||
texec sh -c "ps"
|
||||
texec sh -c "initctl status task.sh"
|
||||
run "ls -l /run/ /run/finit/"
|
||||
run "initctl status"
|
||||
run "ps"
|
||||
run "initctl status task.sh"
|
||||
|
||||
sleep 1
|
||||
texec sh -c "echo Hej; cat /run/task.state"
|
||||
run "echo Hej; cat /run/task.state"
|
||||
|
||||
assert_file_contains /run/task.state 1
|
||||
|
||||
say 'Reload Finit'
|
||||
texec sh -c "initctl reload"
|
||||
run "initctl reload"
|
||||
sleep 1
|
||||
say 'Ensure task has not run again ...'
|
||||
assert_file_contains /run/task.state 1
|
||||
|
||||
say 'Switch to another runlevel ...'
|
||||
texec sh -c "initctl runlevel 3"
|
||||
run "initctl runlevel 3"
|
||||
sleep 1
|
||||
say 'Ensure task has run again ...'
|
||||
assert_file_contains /run/task.state 2
|
||||
|
||||
say 'Touch task.sh .conf file and reload Finit ...'
|
||||
texec sh -c "touch $TEST_CONF"
|
||||
texec sh -c "initctl reload"
|
||||
run "touch $TEST_CONF"
|
||||
run "initctl reload"
|
||||
sleep 1
|
||||
# texec sh -c "initctl status task.sh"
|
||||
# run "initctl status task.sh"
|
||||
assert_file_contains /run/task.state 3
|
||||
|
||||
say "Done, drop stanza from $TEST_CONF ..."
|
||||
texec sh -c "rm $TEST_CONF"
|
||||
texec sh -c "initctl reload"
|
||||
run "rm $TEST_CONF"
|
||||
run "initctl reload"
|
||||
}
|
||||
|
||||
test_one "hello" "task <usr/hello> task.sh -- Hello task"
|
||||
Reference in new issue
Block a user