Import Debian changes 1.2.2-1
[quagga-debian.git] / debian / tests / daemons
diff --git a/debian/tests/daemons b/debian/tests/daemons
new file mode 100755 (executable)
index 0000000..4d02475
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+#---------------
+# Testing quagga
+#---------------
+set -eu
+
+DAEMONS=("bgpd" "isisd" "ospf6d" "ospfd" "pimd" "ripd" "ripngd")
+
+# configure
+for daemon in "${DAEMONS[@]}" zebra
+do
+    cp /usr/share/doc/quagga-core/examples/${daemon}.conf.sample \
+      /etc/quagga/${daemon}.conf
+done
+
+# start (no zebra - it's brought up automaticall as a dependency)
+for daemon in "${DAEMONS[@]}"
+do
+    systemctl start ${daemon}
+done
+
+# reload quagga by restarting zebra - dependent daemons will restart.
+systemctl restart zebra
+
+# wait for things to settle
+sleep 5
+
+# check daemons
+for daemon in "${DAEMONS[@]}" zebra
+do
+    echo -n "check ${daemon}  -  "
+    if systemctl -q is-active ${daemon}; then
+        echo "${daemon} OK"
+    else
+        echo "ERROR: ${daemon} IS NOT RUNNING"
+        exit 1
+    fi
+done