--- /dev/null
+#!/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
-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
+++ /dev/null
-#!/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
--- /dev/null
+#!/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
--- /dev/null
+#!/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