summaryrefslogtreecommitdiff
path: root/tests/setup_interfaces_test
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-07-06 09:03:11 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-07-13 17:30:34 +0200
commit9da508d6a39eb24fdc70eb5a525be58d2c06202a (patch)
tree44572c5a33292b3c2d84cfe884c2a602dbff7d51 /tests/setup_interfaces_test
parent420f69566a25fe83136269445d81a85a35cb053c (diff)
downloadalpine-conf-9da508d6a39eb24fdc70eb5a525be58d2c06202a.zip
setup-interfaces: add test for interactive wifi setup
Diffstat (limited to 'tests/setup_interfaces_test')
-rwxr-xr-xtests/setup_interfaces_test27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/setup_interfaces_test b/tests/setup_interfaces_test
index c189918..e210b26 100755
--- a/tests/setup_interfaces_test
+++ b/tests/setup_interfaces_test
@@ -8,7 +8,8 @@ init_tests \
setup_interfaces_interactive_vlan_ng \
setup_interfaces_interactive_vlan0_ng \
setup_interfaces_interactive_br0 \
- setup_interfaces_interactive_bond0
+ setup_interfaces_interactive_bond0 \
+ setup_interfaces_interactive_wlan0
setup_interfaces_usage_body() {
test_usage setup-interfaces
@@ -152,3 +153,27 @@ setup_interfaces_interactive_bond0_body() {
-o match:"apk add.*bonding" \
setup-interfaces <answers
}
+
+setup_interfaces_interactive_wlan0_body() {
+ init_env
+ create_fake_ifaces lo eth0 wlan2
+ mkdir -p sys/class/net/wlan2/phy80211
+
+ (
+ # Which one do you want to initialize? (or '?' or 'done') [eth0]
+ echo wlan2
+ # Type the wireless network name to connect to:
+ echo Telenor0366rar
+ # Type the "Telenor0366rar" network Pre-Shared Key (will not echo):
+ echo 0123456789
+ # Ip address for wlan0? (or 'dhcp', 'none', '?') [dhcp]
+ echo dhcp
+ # Do you want to do any manual network configuration? (y/n) [n]
+ echo n
+ )>answers
+ atf_check -s exit:0 \
+ -o match:"Available interfaces are: eth0 wlan2" \
+ -o match:"Type the \"Telenor0366rar\" network Pre-Shared Key" \
+ -o match:"Ip address for wlan2" \
+ setup-interfaces <answers
+}