From 450572230f08ed342e306d9c495272a93da54166 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:21:42 -0600 Subject: [PATCH] included startup/shutdown --- othertests/startup-shutdown.bash | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 othertests/startup-shutdown.bash diff --git a/othertests/startup-shutdown.bash b/othertests/startup-shutdown.bash new file mode 100755 index 0000000..a699365 --- /dev/null +++ b/othertests/startup-shutdown.bash @@ -0,0 +1,35 @@ +setup() { + # Time to wait for gitwatch to respond + # shellcheck disable=SC2034 + WAITTIME=4 + # Set up directory structure and initialize remote + testdir=$(mktemp -d) + # shellcheck disable=SC2164 + cd "$testdir" + mkdir remote + # shellcheck disable=SC2164 + cd remote + git init -q --bare + # shellcheck disable=SC2103 + cd .. + # shellcheck disable=SC2164 + mkdir local + # shellcheck disable=SC2164 + cd local + git clone -q ../remote +} + +teardown() { + echo '# Teardown started' >&3 + # Remove testing directories + # shellcheck disable=SC2164 + cd /tmp + + # rm -rf $testdir + + # Make sure gitwatch script gets killed if script stopped background + # Must kill the entire tree of processes generated + pkill -15 -P "$GITWATCH_PID" + + echo '# Teardown complete' >&3 +}