98 lines
2.5 KiB
Text
Executable file
98 lines
2.5 KiB
Text
Executable file
#!/usr/bin/env atf-sh
|
|
|
|
. $(atf_get_srcdir)/test_env.sh
|
|
|
|
tests_init \
|
|
noargs \
|
|
lo_always_auto \
|
|
dual_stack \
|
|
static_ipv4 \
|
|
static_ipv4_netmask \
|
|
static_ipv6 \
|
|
static_ipv6_netmask \
|
|
inet_dhcp \
|
|
use_dhcp \
|
|
alias_eth0_home \
|
|
alias_eth0_work \
|
|
bonded_bridge
|
|
|
|
noargs_body() {
|
|
atf_check -s exit:1 -e ignore ifup -S/dev/null
|
|
}
|
|
|
|
lo_always_auto_body() {
|
|
atf_check -s exit:0 -e ignore -o match:'executors/link' \
|
|
ifup -S/dev/null -E $EXECUTORS -i/dev/null -n -a
|
|
}
|
|
|
|
dual_stack_body() {
|
|
atf_check -s exit:0 -e ignore \
|
|
-o match:'executors/link' \
|
|
-o match:'executors/static' \
|
|
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0.interfaces -n -a
|
|
}
|
|
|
|
static_ipv4_body() {
|
|
atf_check -s exit:0 -e ignore \
|
|
-o match:'executors/link' \
|
|
-o match:'executors/static' \
|
|
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v4.interfaces -n -a
|
|
}
|
|
|
|
static_ipv4_netmask_body() {
|
|
atf_check -s exit:0 -e ignore \
|
|
-o match:'executors/link' \
|
|
-o match:'executors/static' \
|
|
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v4-netmask.interfaces -n -a
|
|
}
|
|
|
|
static_ipv6_body() {
|
|
atf_check -s exit:0 -e ignore \
|
|
-o match:'executors/link' \
|
|
-o match:'executors/static' \
|
|
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v6.interfaces -n -a
|
|
}
|
|
|
|
static_ipv6_netmask_body() {
|
|
atf_check -s exit:0 -e ignore \
|
|
-o match:'executors/link' \
|
|
-o match:'executors/static' \
|
|
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v6-netmask.interfaces -n -a
|
|
}
|
|
|
|
inet_dhcp_body() {
|
|
atf_check -s exit:0 -e ignore \
|
|
-o match:'executors/link' \
|
|
-o match:'executors/dhcp' \
|
|
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/dhcp-eth0.interfaces -n -a
|
|
}
|
|
|
|
use_dhcp_body() {
|
|
atf_check -s exit:0 -e ignore \
|
|
-o match:'executors/link' \
|
|
-o match:'executors/dhcp' \
|
|
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/use-dhcp-eth0.interfaces -n -a
|
|
}
|
|
|
|
alias_eth0_home_body() {
|
|
atf_check -s exit:0 -e ignore \
|
|
-o match:'executors/link' \
|
|
-o match:'executors/dhcp' \
|
|
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/alias-home-work.interfaces -n wlan0=home
|
|
}
|
|
|
|
alias_eth0_work_body() {
|
|
atf_check -s exit:0 -e ignore \
|
|
-o match:'executors/link' \
|
|
-o match:'executors/static' \
|
|
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/alias-home-work.interfaces -n wlan0=work
|
|
}
|
|
|
|
bonded_bridge_body() {
|
|
atf_check -s exit:0 -e ignore \
|
|
-o match:'executors/link' \
|
|
-o match:'executors/bond' \
|
|
-o match:'executors/bridge' \
|
|
-o match:'executors/static' \
|
|
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/bonded-bridge.interfaces -n br0
|
|
}
|