summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-07-05 17:44:21 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-07-05 17:50:29 +0200
commit970db2474f94f73b5c5a5ede89c6310df21ef758 (patch)
tree46ee404b5a81415f56f621691aa9e5de69e83abc /tests
parent8ffc2ca8735b2d670614dea9bcccb1211ad7d213 (diff)
downloadalpine-conf-970db2474f94f73b5c5a5ede89c6310df21ef758.zip
setup-interfaces: don't install legacy vlan package
Don't install vlan package if ifupdown-ng package is used. Add tests for this. fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10495
Diffstat (limited to 'tests')
-rwxr-xr-xtests/setup_interfaces_test51
1 files changed, 50 insertions, 1 deletions
diff --git a/tests/setup_interfaces_test b/tests/setup_interfaces_test
index c09968c..a2e03d6 100755
--- a/tests/setup_interfaces_test
+++ b/tests/setup_interfaces_test
@@ -4,7 +4,9 @@
init_tests \
setup_interfaces_usage \
setup_interfaces_interactive_dhcp \
- setup_interfaces_interactive_vlan
+ setup_interfaces_interactive_vlan \
+ setup_interfaces_interactive_vlan_ng \
+ setup_interfaces_interactive_vlan0_ng
setup_interfaces_usage_body() {
test_usage setup-interfaces
@@ -53,3 +55,50 @@ setup_interfaces_interactive_vlan_body() {
-o match:"apk add.*vlan" \
setup-interfaces <answers
}
+
+setup_interfaces_interactive_vlan_ng_body() {
+ init_env
+ create_fake_ifaces lo eth0
+
+ mkdir -p usr/libexec/ifupdown-ng
+ touch usr/libexec/ifupdown-ng/link
+
+ (
+ # Which one do you want to initialize? (or '?' or 'done') [eth0]
+ echo eth0.5
+ # Ip address for eth0.5? (or 'dhcp', 'none', '?') [dhcp]
+ echo dhcp
+ # Which one do you want to initialize? (or '?' or 'done') [eth0]
+ echo done
+ # Do you want to do any manual network configuration? (y/n) [n]
+ echo n
+ )>answers
+ atf_check -s exit:0 \
+ -o not-match:"apk add.*vlan" \
+ setup-interfaces <answers
+}
+
+setup_interfaces_interactive_vlan0_ng_body() {
+ init_env
+ create_fake_ifaces lo eth0
+
+ mkdir -p usr/libexec/ifupdown-ng
+ touch usr/libexec/ifupdown-ng/link
+
+ (
+ # Which one do you want to initialize? (or '?' or 'done') [eth0]
+ echo vlan0
+ # Which one do you want use for vlan0? (or 'done') [eth0]
+ echo eth0
+ # Ip address for vlan0? (or 'dhcp', 'none', '?') [dhcp]
+ echo dhcp
+ # Which one do you want to initialize? (or '?' or 'done') [eth0]
+ echo done
+ # Do you want to do any manual network configuration? (y/n) [n]
+ echo n
+ )>answers
+ atf_check -s exit:0 \
+ -o match:"Available raw devices are: eth0" \
+ -o not-match:"apk add.*vlan" \
+ setup-interfaces <answers
+}