tests: add tests for link executor

This commit is contained in:
Ariadne Conill 2020-07-26 03:48:37 -06:00
parent 08805f7de3
commit 5f078537bf
3 changed files with 25 additions and 0 deletions

View file

@ -5,3 +5,5 @@ test_suite('ifupdown-ng')
atf_test_program{name='ifquery_test'}
atf_test_program{name='ifup_test'}
atf_test_program{name='ifdown_test'}
include('linux/Kyuafile')

5
tests/linux/Kyuafile Normal file
View file

@ -0,0 +1,5 @@
syntax(2)
test_suite('ifupdown-ng')
atf_test_program{name='link_test'}

18
tests/linux/link_test Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env atf-sh
. $(atf_get_srcdir)/../test_env.sh
EXECUTOR="$(atf_get_srcdir)/../../executor-scripts/linux/link"
tests_init up down
up_body() {
export IFACE=lo PHASE=up MOCK=echo
atf_check -s exit:0 -o match:'ip link set up dev lo' \
${EXECUTOR}
}
down_body() {
export IFACE=lo PHASE=down MOCK=echo
atf_check -s exit:0 -o match:'ip link set down dev lo' \
${EXECUTOR}
}