diff --git a/tests/fixtures/static-eth0-v4-netmask.interfaces b/tests/fixtures/static-eth0-v4-netmask.interfaces new file mode 100644 index 0000000..e9207e8 --- /dev/null +++ b/tests/fixtures/static-eth0-v4-netmask.interfaces @@ -0,0 +1,5 @@ +auto eth0 +iface eth0 + address 203.0.113.2 + netmask 255.255.255.248 + gateway 203.0.113.1 diff --git a/tests/fixtures/static-eth0-v6-netmask.interfaces b/tests/fixtures/static-eth0-v6-netmask.interfaces new file mode 100644 index 0000000..3707e80 --- /dev/null +++ b/tests/fixtures/static-eth0-v6-netmask.interfaces @@ -0,0 +1,5 @@ +auto eth0 +iface eth0 + address 2001:db8:1000:2::2 + netmask 112 + gateway 2001:db8:1000:2::1 diff --git a/tests/ifdown_test b/tests/ifdown_test index 8813359..0104361 100755 --- a/tests/ifdown_test +++ b/tests/ifdown_test @@ -7,7 +7,9 @@ tests_init \ lo_always_auto \ dual_stack \ static_ipv4 \ + static_ipv4_netmask \ static_ipv6 \ + static_ipv6_netmask \ inet_dhcp \ use_dhcp \ alias_eth0_home \ @@ -43,6 +45,15 @@ static_ipv4_body() { ifdown -S/dev/null -i $FIXTURES/static-eth0-v4.interfaces -n -a } +static_ipv4_netmask_body() { + atf_check -s exit:0 -e ignore \ + -o match:'ip link set down dev lo' \ + -o match:'ip link set down dev eth0' \ + -o match:'del 203.0.113.2/29 dev eth0' \ + -o match:'default via 203.0.113.1' \ + ifdown -S/dev/null -i $FIXTURES/static-eth0-v4-netmask.interfaces -n -a +} + static_ipv6_body() { atf_check -s exit:0 -e ignore \ -o match:'ip link set down dev lo' \ @@ -52,6 +63,15 @@ static_ipv6_body() { ifdown -S/dev/null -i $FIXTURES/static-eth0-v6.interfaces -n -a } +static_ipv6_netmask_body() { + atf_check -s exit:0 -e ignore \ + -o match:'ip link set down dev lo' \ + -o match:'ip link set down dev eth0' \ + -o match:'del 2001:db8:1000:2::2/112 dev eth0' \ + -o match:'default via 2001:db8:1000:2::1' \ + ifdown -S/dev/null -i $FIXTURES/static-eth0-v6-netmask.interfaces -n -a +} + inet_dhcp_body() { atf_check -s exit:0 -e ignore \ -o match:'ip link set down dev lo' \ diff --git a/tests/ifup_test b/tests/ifup_test index 2091d0f..9b35d21 100755 --- a/tests/ifup_test +++ b/tests/ifup_test @@ -7,7 +7,9 @@ tests_init \ lo_always_auto \ dual_stack \ static_ipv4 \ + static_ipv4_netmask \ static_ipv6 \ + static_ipv6_netmask \ inet_dhcp \ use_dhcp \ alias_eth0_home \ @@ -43,6 +45,15 @@ static_ipv4_body() { ifup -S/dev/null -i $FIXTURES/static-eth0-v4.interfaces -n -a } +static_ipv4_netmask_body() { + atf_check -s exit:0 -e ignore \ + -o match:'ip link set up dev lo' \ + -o match:'ip link set up dev eth0' \ + -o match:'add 203.0.113.2/29 dev eth0' \ + -o match:'default via 203.0.113.1' \ + ifup -S/dev/null -i $FIXTURES/static-eth0-v4-netmask.interfaces -n -a +} + static_ipv6_body() { atf_check -s exit:0 -e ignore \ -o match:'ip link set up dev lo' \ @@ -52,6 +63,15 @@ static_ipv6_body() { ifup -S/dev/null -i $FIXTURES/static-eth0-v6.interfaces -n -a } +static_ipv6_netmask_body() { + atf_check -s exit:0 -e ignore \ + -o match:'ip link set up dev lo' \ + -o match:'ip link set up dev eth0' \ + -o match:'add 2001:db8:1000:2::2/112 dev eth0' \ + -o match:'default via 2001:db8:1000:2::1' \ + ifup -S/dev/null -i $FIXTURES/static-eth0-v6-netmask.interfaces -n -a +} + inet_dhcp_body() { atf_check -s exit:0 -e ignore \ -o match:'ip link set up dev lo' \