diff --git a/tests/test-upstart-job.sh b/tests/test-upstart-job.sh index 86be01bf602..d0fba23d625 100755 --- a/tests/test-upstart-job.sh +++ b/tests/test-upstart-job.sh @@ -1,29 +1,20 @@ #! /bin/sh -e -tmpDir=/tmp/event.d - -mkdir -p /tmp/event.d - -if test "$(readlink -f /etc/event.d)" != /tmp/event.d; then - cp -prd "$(readlink -f /etc/event.d)"/* /tmp/event.d/ -fi - for i in $*; do echo "building job $i..." - nix-build /etc/nixos/nixos -A "tests.upstartJobs.$i" -o $tmpDir/.result - ln -sfn $(readlink -f $tmpDir/.result)/etc/event.d/* /tmp/event.d/ + nix-build /etc/nixos/nixos -A "config.jobs.$i" -o $tmpDir/.result + # !!! Here we assume that the attribute name equals the Upstart + # job name. + ln -sfn $(readlink -f $tmpDir/.result) /etc/init/"$i".conf done -ln -sfn /tmp/event.d /etc/event.d - echo "restarting init..." -kill -TERM 1 +initctl reload-configuration sleep 1 for i in $*; do echo "restarting job $i..." - initctl stop "$i" - sleep 1 + initctl stop "$i" || true initctl start "$i" done