Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
END
}
+test-service-startup-main () {
+ # Test that hippotatd was started, and that we can restart and stop it
+
+ curl http://localhost:8099/ | tee /dev/stderr | grep hippotat
+
+ dpid=$(pidof hippotatd)
+
+ service hippotatd restart
+
+ dpid2=$(pidof hippotatd)
+
+ test $dpid != $dpid2
+
+ service hippotatd stop
+
+ ( LC_MESSAGES=C nc -v localhost 8099 2>&1 ||: ) \
+ | tee /dev/stderr | grep 'Connection refused'
+}
+
filesystem-prep () {
cs=$1; shift
# expects $tmp to be set to test-specific temp dir (abs path)
# any formal documentation of it. Instead, "restart" ought to DTRT.
service hippotatd restart
-curl http://localhost:8099/ | tee /dev/stderr | grep hippotat
-
-dpid=$(pidof hippotatd)
-
-service hippotatd restart
-
-dpid2=$(pidof hippotatd)
-
-test $dpid != $dpid2
-
-service hippotatd stop
-
-( LC_MESSAGES=C nc -v localhost 8099 2>&1 ||: ) \
- | tee /dev/stderr | grep 'Connection refused'
+test-service-startup-main
t-ok