| 1 |
#!/usr/bin/env atf-sh |
| 2 |
|
| 3 |
. $(atf_get_srcdir)/test_env.sh |
| 4 |
|
| 5 |
tests_init \ |
| 6 |
noargs \ |
| 7 |
lo_always_auto \ |
| 8 |
dual_stack \ |
| 9 |
static_ipv4 \ |
| 10 |
static_ipv4_netmask \ |
| 11 |
static_ipv6 \ |
| 12 |
static_ipv6_netmask \ |
| 13 |
inet_dhcp \ |
| 14 |
use_dhcp \ |
| 15 |
alias_eth0_home \ |
| 16 |
alias_eth0_work \ |
| 17 |
bonded_bridge \ |
| 18 |
learned_dependency \ |
| 19 |
learned_dependency_2 \ |
| 20 |
learned_executor \ |
| 21 |
implicit_vlan \ |
| 22 |
teardown_dep_ordering \ |
| 23 |
dependency_loop_breaking |
| 24 |
|
| 25 |
noargs_body() { |
| 26 |
atf_check -s exit:1 -e ignore ifup -S/dev/null |
| 27 |
} |
| 28 |
|
| 29 |
lo_always_auto_body() { |
| 30 |
atf_check -s exit:0 -e ignore -o match:'executors/link' \ |
| 31 |
ifup -S/dev/null -E $EXECUTORS -i/dev/null -n -a |
| 32 |
} |
| 33 |
|
| 34 |
dual_stack_body() { |
| 35 |
atf_check -s exit:0 -e ignore \ |
| 36 |
-o match:'executors/link' \ |
| 37 |
-o match:'executors/static' \ |
| 38 |
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0.interfaces -n -a |
| 39 |
} |
| 40 |
|
| 41 |
static_ipv4_body() { |
| 42 |
atf_check -s exit:0 -e ignore \ |
| 43 |
-o match:'executors/link' \ |
| 44 |
-o match:'executors/static' \ |
| 45 |
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v4.interfaces -n -a |
| 46 |
} |
| 47 |
|
| 48 |
static_ipv4_netmask_body() { |
| 49 |
atf_check -s exit:0 -e ignore \ |
| 50 |
-o match:'executors/link' \ |
| 51 |
-o match:'executors/static' \ |
| 52 |
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v4-netmask.interfaces -n -a |
| 53 |
} |
| 54 |
|
| 55 |
static_ipv6_body() { |
| 56 |
atf_check -s exit:0 -e ignore \ |
| 57 |
-o match:'executors/link' \ |
| 58 |
-o match:'executors/static' \ |
| 59 |
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v6.interfaces -n -a |
| 60 |
} |
| 61 |
|
| 62 |
static_ipv6_netmask_body() { |
| 63 |
atf_check -s exit:0 -e ignore \ |
| 64 |
-o match:'executors/link' \ |
| 65 |
-o match:'executors/static' \ |
| 66 |
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/static-eth0-v6-netmask.interfaces -n -a |
| 67 |
} |
| 68 |
|
| 69 |
inet_dhcp_body() { |
| 70 |
atf_check -s exit:0 -e ignore \ |
| 71 |
-o match:'executors/link' \ |
| 72 |
-o match:'executors/dhcp' \ |
| 73 |
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/dhcp-eth0.interfaces -n -a |
| 74 |
} |
| 75 |
|
| 76 |
use_dhcp_body() { |
| 77 |
atf_check -s exit:0 -e ignore \ |
| 78 |
-o match:'executors/link' \ |
| 79 |
-o match:'executors/dhcp' \ |
| 80 |
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/use-dhcp-eth0.interfaces -n -a |
| 81 |
} |
| 82 |
|
| 83 |
alias_eth0_home_body() { |
| 84 |
atf_check -s exit:0 -e ignore \ |
| 85 |
-o match:'executors/link' \ |
| 86 |
-o match:'executors/dhcp' \ |
| 87 |
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/alias-home-work.interfaces -n wlan0=home |
| 88 |
} |
| 89 |
|
| 90 |
alias_eth0_work_body() { |
| 91 |
atf_check -s exit:0 -e ignore \ |
| 92 |
-o match:'executors/link' \ |
| 93 |
-o match:'executors/static' \ |
| 94 |
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/alias-home-work.interfaces -n wlan0=work |
| 95 |
} |
| 96 |
|
| 97 |
bonded_bridge_body() { |
| 98 |
atf_check -s exit:0 -e ignore \ |
| 99 |
-o match:'executors/link' \ |
| 100 |
-o match:'executors/bond' \ |
| 101 |
-o match:'executors/bridge' \ |
| 102 |
-o match:'executors/static' \ |
| 103 |
ifup -S/dev/null -E $EXECUTORS -i $FIXTURES/bonded-bridge.interfaces -n br0 |
| 104 |
} |
| 105 |
|
| 106 |
learned_dependency_body() { |
| 107 |
atf_check -s exit:0 -o ignore \ |
| 108 |
-e match:"eth0" \ |
| 109 |
-e match:"eth1" \ |
| 110 |
-e match:"eth2" \ |
| 111 |
-e match:"eth3" \ |
| 112 |
-e match:"eth4" \ |
| 113 |
ifup -n -S/dev/null -E $EXECUTORS -i $FIXTURES/mock-dependency-generator.interfaces br0 |
| 114 |
} |
| 115 |
|
| 116 |
learned_dependency_2_body() { |
| 117 |
atf_check -s exit:0 -o ignore \ |
| 118 |
-e match:"bond0" \ |
| 119 |
-e match:"eth0" \ |
| 120 |
-e match:"eth1" \ |
| 121 |
ifup -n -S/dev/null -E $EXECUTORS -i $FIXTURES/mock-dependency-generator-2.interfaces br0 |
| 122 |
} |
| 123 |
|
| 124 |
learned_executor_body() { |
| 125 |
atf_check -s exit:0 -o ignore \ |
| 126 |
-e match:"attempting to run mock executor" \ |
| 127 |
ifup -n -S/dev/null -E $EXECUTORS -i $FIXTURES/mock-dependency-generator-2.interfaces br0 |
| 128 |
} |
| 129 |
|
| 130 |
implicit_vlan_body() { |
| 131 |
atf_check -s exit:0 -o ignore \ |
| 132 |
-e match:"attempting to run vlan executor" \ |
| 133 |
-e match:"attempting to run link executor" \ |
| 134 |
ifup -n -S/dev/null -E $EXECUTORS -i $FIXTURES/vlan.interfaces eth0.8 |
| 135 |
} |
| 136 |
|
| 137 |
teardown_dep_ordering_body() { |
| 138 |
atf_check -s exit:0 -o ignore \ |
| 139 |
-e match:"skipping auto interface bat" \ |
| 140 |
-e match:"skipping auto interface dummy" \ |
| 141 |
ifup -n -i $FIXTURES/teardown-dep-ordering.interfaces -E $EXECUTORS -a |
| 142 |
} |
| 143 |
|
| 144 |
dependency_loop_breaking_body() { |
| 145 |
atf_check -s exit:0 -o ignore \ |
| 146 |
-e match:"ifup: skipping auto interface a \\(already configured\\), use --force to force configuration" \ |
| 147 |
ifup -n -i $FIXTURES/dependency-loop.interfaces -E $EXECUTORS -a |
| 148 |
} |