tunnel: improve validation of options
This commit is contained in:
parent
59ba50ba4e
commit
cd1b0d5833
2 changed files with 24 additions and 7 deletions
|
@ -8,12 +8,12 @@ tests_init \
|
|||
tunnel_teardown
|
||||
|
||||
tunnel_bringup_body() {
|
||||
export MOCK=echo IFACE=tun0 PHASE=pre-up IF_TUNNEL_TYPE=gre \
|
||||
export MOCK=echo IFACE=tun0 PHASE=pre-up IF_TUNNEL_MODE=gre \
|
||||
IF_TUNNEL_LOCAL=1.2.3.4 IF_TUNNEL_REMOTE=5.6.7.8 \
|
||||
IF_TUNNEL_TTL=255
|
||||
atf_check -s exit:0 \
|
||||
-o match:"ip tunnel add tun0" \
|
||||
-o match:"type 'gre'" \
|
||||
-o match:"ip -4 tunnel add tun0" \
|
||||
-o match:"mode 'gre'" \
|
||||
-o match:"ttl '255'" \
|
||||
-o match:"local '1.2.3.4'" \
|
||||
-o match:"remote '5.6.7.8'" \
|
||||
|
@ -21,10 +21,10 @@ tunnel_bringup_body() {
|
|||
}
|
||||
|
||||
tunnel_teardown_body() {
|
||||
export MOCK=echo IFACE=tun0 PHASE=post-down IF_TUNNEL_TYPE=gre \
|
||||
export MOCK=echo IFACE=tun0 PHASE=post-down IF_TUNNEL_MODE=gre \
|
||||
IF_TUNNEL_LOCAL=1.2.3.4 IF_TUNNEL_REMOTE=5.6.7.8 \
|
||||
IF_TUNNEL_TTL=255
|
||||
atf_check -s exit:0 \
|
||||
-o match:"ip tunnel del tun0" \
|
||||
-o match:"ip -4 tunnel del tun0" \
|
||||
${EXECUTOR}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue