Import Debian changes 1.2.2-1
[quagga-debian.git] / debian / tests / daemons
1 #!/bin/bash
2 #---------------
3 # Testing quagga
4 #---------------
5 set -eu
6
7 DAEMONS=("bgpd" "isisd" "ospf6d" "ospfd" "pimd" "ripd" "ripngd")
8
9 # configure
10 for daemon in "${DAEMONS[@]}" zebra
11 do
12     cp /usr/share/doc/quagga-core/examples/${daemon}.conf.sample \
13       /etc/quagga/${daemon}.conf
14 done
15
16 # start (no zebra - it's brought up automaticall as a dependency)
17 for daemon in "${DAEMONS[@]}"
18 do
19     systemctl start ${daemon}
20 done
21
22 # reload quagga by restarting zebra - dependent daemons will restart.
23 systemctl restart zebra
24
25 # wait for things to settle
26 sleep 5
27
28 # check daemons
29 for daemon in "${DAEMONS[@]}" zebra
30 do
31     echo -n "check ${daemon}  -  "
32     if systemctl -q is-active ${daemon}; then
33         echo "${daemon} OK"
34     else
35         echo "ERROR: ${daemon} IS NOT RUNNING"
36         exit 1
37     fi
38 done