tests: add tests for VRF executor

This commit is contained in:
Ariadne Conill 2020-08-18 16:28:34 -06:00
parent ba2ad348ff
commit ba98705c8f
3 changed files with 39 additions and 0 deletions

View file

@ -1,4 +1,6 @@
#!/bin/sh
set -e
handle_init() {
${MOCK} /sbin/ip link $1 $IFACE type vrf table $IF_VRF_TABLE
${MOCK} /sbin/ip rule $1 iif $IFACE table $IF_VRF_TABLE
@ -15,9 +17,11 @@ case "$PHASE" in
pre-up)
[ -n "$IF_VRF_TABLE" ] && handle_init "add"
[ -n "$IF_VRF_MEMBER" ] && handle_member
exit 0
;;
post-down)
[ -n "$IF_VRF_TABLE" ] && handle_init "del"
exit 0
;;
*)
exit 0