diff options
| -rwxr-xr-x | debian/tests/bgpd-snmp-rpki | 22 | ||||
| -rw-r--r-- | debian/tests/control | 12 | ||||
| -rw-r--r-- | debian/tests/daemons | 30 | ||||
| -rwxr-xr-x | debian/tests/py-frr-reload | 28 | ||||
| -rwxr-xr-x | debian/tests/zebra-lo | 16 |
5 files changed, 76 insertions, 32 deletions
diff --git a/debian/tests/bgpd-snmp-rpki b/debian/tests/bgpd-snmp-rpki new file mode 100755 index 0000000000..91e4bdda55 --- /dev/null +++ b/debian/tests/bgpd-snmp-rpki @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +# enable bgpd with SNMP & RPKI modules +cat >> /etc/frr/daemons <<EOF +bgpd=yes +bgpd_options="-A 127.0.0.1 -Msnmp -Mrpki" +EOF + +service frr restart + +# check that it actually started +killall -0 watchfrr +killall -0 zebra +killall -0 bgpd + +# just for debugging +vtysh -c 'show modules' + +# ... and SNMP & RPKI should be loaded +vtysh -c 'show modules' | grep -q snmp +vtysh -c 'show modules' | grep -q rpki diff --git a/debian/tests/control b/debian/tests/control index 53fd537e2e..5990a69370 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,3 +1,11 @@ -Tests: daemons +Tests: zebra-lo Depends: frr -Restrictions: needs-root +Restrictions: needs-root, isolation-container + +Tests: bgpd-snmp-rpki +Depends: frr, frr-snmp, frr-rpki-rtrlib +Restrictions: needs-root, isolation-container + +Tests: py-frr-reload +Depends: frr, frr-pythontools +Restrictions: needs-root, isolation-container diff --git a/debian/tests/daemons b/debian/tests/daemons deleted file mode 100644 index ac35ecd950..0000000000 --- a/debian/tests/daemons +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -#--------------- -# Testing frr -#--------------- -set -e - -# modify config file to enable all daemons and copy config files -CONFIG_FILE=/etc/frr/daemons -DAEMONS=("zebra" "bgpd" "ospfd" "ospf6d" "ripd" "ripngd" "isisd" "pimd") - -for daemon in "${DAEMONS[@]}" -do - sed -i -e "s/${daemon}=no/${daemon}=yes/g" $CONFIG_FILE - cp /usr/share/doc/frr/examples/${daemon}.conf.sample /etc/frr/${daemon}.conf -done - -# reload frr -/etc/init.d/frr restart > /dev/null 2>&1 - -# check daemons -for daemon in "${DAEMONS[@]}" -do - echo -n "check $daemon - " - if pidof -x $daemon > /dev/null; then - echo "${daemon} OK" - else - echo "ERROR: ${daemon} IS NOT RUNNING" - exit 1 - fi -done diff --git a/debian/tests/py-frr-reload b/debian/tests/py-frr-reload new file mode 100755 index 0000000000..a50647a89d --- /dev/null +++ b/debian/tests/py-frr-reload @@ -0,0 +1,28 @@ +#!/bin/sh +set -e + +# should have been started on install, but policy may have inhibited that +service frr restart + +# these should be running by default +killall -0 watchfrr +killall -0 zebra +killall -0 staticd + +# configure interactively, save to file +vtysh -c 'configure terminal' -c 'ip route 198.51.100.0/28 127.0.0.1' +vtysh -c 'show running-config' | grep -q 'ip route 198.51.100.0/28 127.0.0.1' +vtysh -c 'write memory' + +grep -q 'ip route 198.51.100.0/28 127.0.0.1' /etc/frr/frr.conf + +# configure in file, check interactively +sed -e '/^ip route 198.51.100.0\/28 127.0.0.1/ c ip route 198.51.100.64/28 127.0.0.1' \ + -i /etc/frr/frr.conf + +service frr reload + +vtysh -c 'show running-config' | grep -q 'ip route 198.51.100.64/28 127.0.0.1' +if vtysh -c 'show running-config' | grep -q 'ip route 198.51.100.0/28 127.0.0.1'; then + exit 1 +fi diff --git a/debian/tests/zebra-lo b/debian/tests/zebra-lo new file mode 100755 index 0000000000..ffd9c72adc --- /dev/null +++ b/debian/tests/zebra-lo @@ -0,0 +1,16 @@ +#!/bin/sh +set -e + +# should have been started on install, but policy may have inhibited that +service frr status >/dev/null || service frr restart + +# these should be running by default +killall -0 watchfrr +killall -0 zebra +killall -0 staticd + +# check vtysh works at all +vtysh -c 'show version' + +# check zebra is properly talking to the kernel +vtysh -c 'show interface lo' | grep -q LOOPBACK |
