2020-07-24 06:10:54 +00:00
|
|
|
#!/usr/bin/env atf-sh
|
|
|
|
|
|
|
|
. $(atf_get_srcdir)/test_env.sh
|
|
|
|
|
|
|
|
tests_init \
|
|
|
|
noargs \
|
|
|
|
lo_always_auto \
|
|
|
|
dual_stack \
|
|
|
|
static_ipv4 \
|
2020-07-25 07:06:21 +00:00
|
|
|
static_ipv4_netmask \
|
2020-07-24 06:10:54 +00:00
|
|
|
static_ipv6 \
|
2020-07-25 07:06:21 +00:00
|
|
|
static_ipv6_netmask \
|
2020-07-24 06:10:54 +00:00
|
|
|
inet_dhcp \
|
2020-07-24 11:04:33 +00:00
|
|
|
use_dhcp \
|
2020-07-24 06:10:54 +00:00
|
|
|
alias_eth0_home \
|
2020-07-24 10:54:13 +00:00
|
|
|
alias_eth0_work \
|
2020-07-28 20:04:27 +00:00
|
|
|
bonded_bridge \
|
|
|
|
learned_dependency
|
2020-07-24 06:10:54 +00:00
|
|
|
|
|
|
|
noargs_body() {
|
|
|
|
atf_check -s exit:1 -e ignore ifdown -S/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
lo_always_auto_body() {
|
2020-07-26 09:34:04 +00:00
|
|
|
atf_check -s exit:0 -e ignore -o match:'executors/link' \
|
|
|
|
ifdown -S/dev/null -E $EXECUTORS -i/dev/null -n -a
|
2020-07-24 06:10:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dual_stack_body() {
|
|
|
|
atf_check -s exit:0 -e ignore \
|
2020-07-26 09:34:04 +00:00
|
|
|
-o match:'executors/link' \
|
2020-07-26 09:12:02 +00:00
|
|
|
-o match:'executors/static' \
|
2020-07-25 08:50:24 +00:00
|
|
|
ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0.interfaces -n -a
|
2020-07-24 06:10:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static_ipv4_body() {
|
|
|
|
atf_check -s exit:0 -e ignore \
|
2020-07-26 09:34:04 +00:00
|
|
|
-o match:'executors/link' \
|
2020-07-26 09:12:02 +00:00
|
|
|
-o match:'executors/static' \
|
2020-07-25 08:50:24 +00:00
|
|
|
ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v4.interfaces -n -a
|
2020-07-24 06:10:54 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 07:06:21 +00:00
|
|
|
static_ipv4_netmask_body() {
|
|
|
|
atf_check -s exit:0 -e ignore \
|
2020-07-26 09:34:04 +00:00
|
|
|
-o match:'executors/link' \
|
2020-07-26 09:12:02 +00:00
|
|
|
-o match:'executors/static' \
|
2020-07-25 08:50:24 +00:00
|
|
|
ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v4-netmask.interfaces -n -a
|
2020-07-25 07:06:21 +00:00
|
|
|
}
|
|
|
|
|
2020-07-24 06:10:54 +00:00
|
|
|
static_ipv6_body() {
|
|
|
|
atf_check -s exit:0 -e ignore \
|
2020-07-26 09:34:04 +00:00
|
|
|
-o match:'executors/link' \
|
2020-07-26 09:12:02 +00:00
|
|
|
-o match:'executors/static' \
|
2020-07-25 08:50:24 +00:00
|
|
|
ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v6.interfaces -n -a
|
2020-07-24 06:10:54 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 07:06:21 +00:00
|
|
|
static_ipv6_netmask_body() {
|
|
|
|
atf_check -s exit:0 -e ignore \
|
2020-07-26 09:34:04 +00:00
|
|
|
-o match:'executors/link' \
|
2020-07-26 09:12:02 +00:00
|
|
|
-o match:'executors/static' \
|
2020-07-25 08:50:24 +00:00
|
|
|
ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v6-netmask.interfaces -n -a
|
2020-07-25 07:06:21 +00:00
|
|
|
}
|
|
|
|
|
2020-07-24 06:10:54 +00:00
|
|
|
inet_dhcp_body() {
|
|
|
|
atf_check -s exit:0 -e ignore \
|
2020-07-26 09:34:04 +00:00
|
|
|
-o match:'executors/link' \
|
2020-07-26 09:12:02 +00:00
|
|
|
-o match:'executors/dhcp' \
|
2020-07-25 08:50:24 +00:00
|
|
|
ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/dhcp-eth0.interfaces -n -a
|
2020-07-24 06:10:54 +00:00
|
|
|
}
|
|
|
|
|
2020-07-24 11:04:33 +00:00
|
|
|
use_dhcp_body() {
|
|
|
|
atf_check -s exit:0 -e ignore \
|
2020-07-26 09:34:04 +00:00
|
|
|
-o match:'executors/link' \
|
2020-07-26 09:12:02 +00:00
|
|
|
-o match:'executors/dhcp' \
|
2020-07-25 08:50:24 +00:00
|
|
|
ifdown -S/dev/null -E $EXECUTORS -i $FIXTURES/use-dhcp-eth0.interfaces -n -a
|
2020-07-24 11:04:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-24 06:10:54 +00:00
|
|
|
alias_eth0_home_body() {
|
|
|
|
atf_check -s exit:0 -e ignore \
|
2020-07-26 09:34:04 +00:00
|
|
|
-o match:'executors/link' \
|
2020-07-26 09:12:02 +00:00
|
|
|
-o match:'executors/dhcp' \
|
2020-07-24 06:10:54 +00:00
|
|
|
ifdown -S $FIXTURES/alias-home.ifstate \
|
2020-07-25 08:50:24 +00:00
|
|
|
-E $EXECUTORS -i $FIXTURES/alias-home-work.interfaces -n wlan0
|
2020-07-24 06:10:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
alias_eth0_work_body() {
|
|
|
|
atf_check -s exit:0 -e ignore \
|
2020-07-26 09:34:04 +00:00
|
|
|
-o match:'executors/link' \
|
2020-07-26 09:12:02 +00:00
|
|
|
-o match:'executors/static' \
|
2020-07-24 06:10:54 +00:00
|
|
|
ifdown -S $FIXTURES/alias-work.ifstate \
|
2020-07-25 08:50:24 +00:00
|
|
|
-E $EXECUTORS -i $FIXTURES/alias-home-work.interfaces -n wlan0
|
2020-07-24 06:10:54 +00:00
|
|
|
}
|
2020-07-24 10:54:13 +00:00
|
|
|
|
|
|
|
bonded_bridge_body() {
|
|
|
|
atf_check -s exit:0 -e ignore \
|
2020-07-26 09:34:04 +00:00
|
|
|
-o match:'executors/link' \
|
2020-07-26 09:12:02 +00:00
|
|
|
-o match:'executors/bond' \
|
|
|
|
-o match:'executors/bridge' \
|
|
|
|
-o match:'executors/static' \
|
2020-07-24 10:54:13 +00:00
|
|
|
ifdown -S $FIXTURES/bonded-bridge.ifstate \
|
2020-07-25 08:50:24 +00:00
|
|
|
-E $EXECUTORS -i $FIXTURES/bonded-bridge.interfaces -n br0
|
2020-07-24 10:54:13 +00:00
|
|
|
}
|
2020-07-28 20:04:27 +00:00
|
|
|
|
|
|
|
learned_dependency_body() {
|
|
|
|
atf_check -s exit:0 -o ignore \
|
|
|
|
-e match:"eth0" \
|
|
|
|
-e match:"eth1" \
|
|
|
|
-e match:"eth2" \
|
|
|
|
-e match:"eth3" \
|
|
|
|
-e match:"eth4" \
|
|
|
|
ifdown -n -S $FIXTURES/mock-dependency-generator.ifstate \
|
|
|
|
-E $EXECUTORS \
|
|
|
|
-i $FIXTURES/mock-dependency-generator.interfaces br0
|
|
|
|
}
|