1
0
Fork 0
frr/debian/tests/py-frr-reload
Daniel Baumann 307c681470
Adding debian version 10.1.1-1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-05 10:04:12 +01:00

36 lines
962 B
Bash
Executable file

#!/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