From 5c2e6aad2009fa08483d080d5f5cf4c2d06f8a80 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 1 Mar 2026 15:36:20 +0000 Subject: [PATCH] autopkgtests: Break out test-service-startup-main Signed-off-by: Ian Jackson --- adt/acommon | 19 +++++++++++++++++++ adt/adt-initscript | 15 +-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/adt/acommon b/adt/acommon index b0edb5d..c1da88e 100644 --- a/adt/acommon +++ b/adt/acommon @@ -50,6 +50,25 @@ test-service-startup-prep () { 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) diff --git a/adt/adt-initscript b/adt/adt-initscript index 0bf60a0..836151d 100755 --- a/adt/adt-initscript +++ b/adt/adt-initscript @@ -18,19 +18,6 @@ test-service-startup-prep # 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 -- 2.30.2