/src/igr-tests/restart/basic-ran
/src/igr-tests/check-basic/output.txt
/src/igr-tests/check-cycle/output.txt
+/src/igr-tests/reload1/sd
+/src/igr-tests/reload2/sd
# Generated man pages:
/doc/manpages/*.5
int main(int argc, char **argv)
{
const char * const test_dirs[] = { "basic", "environ", "ps-environ", "chain-to", "force-stop", "restart",
- "check-basic", "check-cycle", "reload1" };
+ "check-basic", "check-cycle", "reload1", "reload2" };
constexpr int num_tests = sizeof(test_dirs) / sizeof(test_dirs[0]);
int passed = 0;
--- /dev/null
+#!/bin/sh
+
+# Similar to reload1 test, but with boot service stopped while we reload.
+
+# Start with boot depending on a,b
+rm -rf sd
+cp -R sd1 sd
+
+../../dinit -d sd -u -p socket -q &
+DINITPID=$!
+
+# Give some time for startup
+sleep 0.2
+
+../../dinitctl --quiet -p socket start hold
+
+STATUS=PASS
+
+if [ "$(../../dinitctl -p socket list)" != "$(cat initial.expected)" ]; then
+ STATUS=FAIL
+fi
+
+../../dinitctl --quiet -p socket stop boot
+
+# Put alternate descriptions in place: boot depends on b, c
+if [ "$STATUS" = PASS ]; then
+ rm -rf sd
+ cp -R sd2 sd
+
+ # This should succeed since boot is stopped
+ if [ "$(../../dinitctl -p socket reload boot 2>&1)" != "$(cat output2.expected)" ]; then
+ STATUS=FAIL
+ fi
+
+fi
+
+if [ "$STATUS" = PASS ]; then
+ ../../dinitctl --quiet -p socket start boot
+ if [ "$(../../dinitctl -p socket list)" != "$(cat output3.expected)" ]; then
+ STATUS=FAIL
+ fi
+fi
+
+../../dinitctl --quiet -p socket shutdown
+wait $DINITPID
+
+if [ $STATUS = PASS ]; then exit 0; fi
+exit 1