tests: add tests for ipv6-ra executor
This commit is contained in:
parent
5f078537bf
commit
d35a3e3b38
3 changed files with 21 additions and 2 deletions
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
${MOCK} echo 1 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
|
${MOCK} /bin/sh -c "echo 1 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra"
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
${MOCK} echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
|
${MOCK} /bin/sh -c "echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra"
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -z "$VERBOSE" ] || set -x
|
[ -z "$VERBOSE" ] || set -x
|
||||||
|
|
|
@ -3,3 +3,4 @@ syntax(2)
|
||||||
test_suite('ifupdown-ng')
|
test_suite('ifupdown-ng')
|
||||||
|
|
||||||
atf_test_program{name='link_test'}
|
atf_test_program{name='link_test'}
|
||||||
|
atf_test_program{name='ipv6-ra_test'}
|
||||||
|
|
18
tests/linux/ipv6-ra_test
Executable file
18
tests/linux/ipv6-ra_test
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env atf-sh
|
||||||
|
|
||||||
|
. $(atf_get_srcdir)/../test_env.sh
|
||||||
|
EXECUTOR="$(atf_get_srcdir)/../../executor-scripts/linux/ipv6-ra"
|
||||||
|
|
||||||
|
tests_init up down
|
||||||
|
|
||||||
|
up_body() {
|
||||||
|
export IFACE=lo PHASE=up MOCK=echo MOCK_ESC=\\
|
||||||
|
atf_check -s exit:0 -o match:'echo 1 > /proc/sys/net/ipv6/conf/lo/accept_ra' \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
down_body() {
|
||||||
|
export IFACE=lo PHASE=down MOCK=echo MOCK_ESC=\\
|
||||||
|
atf_check -s exit:0 -o match:'echo 0 > /proc/sys/net/ipv6/conf/lo/accept_ra' \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
Loading…
Reference in a new issue