run-test.sh 755 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. set -eu
  3. cd "$(dirname "$0")"
  4. . ../igr_functions.sh
  5. # Tests around before/after link functionality.
  6. rm -rf "$IGR_OUTPUT"/*
  7. spawn_dinit
  8. # service2 depends on service1, and service1 is "before" service2
  9. run_dinitctl $QUIET reload service2
  10. # however, we'll remove the depends-on dependency before starting both
  11. run_dinitctl $QUIET rm-dep need service2 service1
  12. run_dinitctl $QUIET start --no-wait service1
  13. run_dinitctl $QUIET start service2
  14. # Note service1 takes longer to start, but has a "before" service2 so should still start first.
  15. if ! compare_text "$IGR_OUTPUT"/script-output "$(printf "one\ntwo\n")"; then
  16. error "$IGR_OUTPUT/script-output didn't contain expected result!"
  17. fi
  18. rm "$IGR_OUTPUT"/script-output
  19. stop_dinit
  20. exit 0