summaryrefslogtreecommitdiffstats
path: root/debian/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:36 +0000
commit7128f60963e2a90b202a701ca40b532323770208 (patch)
treee0cafdc1e23d465dd4e128f858110cb3bb225065 /debian/tests
parentAdding upstream version 9.1. (diff)
downloadfrr-7128f60963e2a90b202a701ca40b532323770208.tar.xz
frr-7128f60963e2a90b202a701ca40b532323770208.zip
Adding debian version 9.1-0.1.debian/9.1-0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests')
-rwxr-xr-xdebian/tests/bgpd-snmp-rpki22
-rw-r--r--debian/tests/control14
-rwxr-xr-xdebian/tests/py-frr-reload36
-rwxr-xr-xdebian/tests/zebra-lo16
4 files changed, 88 insertions, 0 deletions
diff --git a/debian/tests/bgpd-snmp-rpki b/debian/tests/bgpd-snmp-rpki
new file mode 100755
index 0000000..930b8c2
--- /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
+pgrep watchfrr
+pgrep zebra
+pgrep 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
new file mode 100644
index 0000000..6cb5b02
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,14 @@
+Tests: zebra-lo
+Depends: frr
+Restrictions: needs-root, isolation-container
+
+Tests: bgpd-snmp-rpki
+Depends: frr,
+ frr-rpki-rtrlib,
+ frr-snmp
+Restrictions: needs-root, isolation-container
+
+Tests: py-frr-reload
+Depends: frr,
+ frr-pythontools
+Restrictions: needs-root, isolation-container
diff --git a/debian/tests/py-frr-reload b/debian/tests/py-frr-reload
new file mode 100755
index 0000000..6dfef33
--- /dev/null
+++ b/debian/tests/py-frr-reload
@@ -0,0 +1,36 @@
+#!/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
+pgrep watchfrr
+pgrep zebra
+pgrep 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
+
+# wait for the new config to load
+for __t in $(seq 1 10); do
+ if vtysh -c 'show running-config' | grep -q 'ip route 198.51.100.64/28 127.0.0.1'; then
+ break
+ fi
+ sleep "$__t"
+done
+
+# fail if the old config is still loaded
+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 0000000..2a388d5
--- /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
+pgrep watchfrr
+pgrep zebra
+pgrep 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