summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-07-13 13:13:36 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-07-13 13:19:42 +0200
commit420f69566a25fe83136269445d81a85a35cb053c (patch)
tree9dd01e3ed5cd67ca175a005602216b84a9605ebb /tests
parent2d8899bb38173c60d5ea7377f0970919874d77c9 (diff)
downloadalpine-conf-420f69566a25fe83136269445d81a85a35cb053c.zip
libalpine.sh: add test for askpass
Diffstat (limited to 'tests')
-rwxr-xr-xtests/libalpine_test14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/libalpine_test b/tests/libalpine_test
index 993104e..2601a1b 100755
--- a/tests/libalpine_test
+++ b/tests/libalpine_test
@@ -5,7 +5,8 @@ init_tests \
libalpine_isin \
libalpine_available_ifaces \
libalpine_available_ifaces_bond \
- libalpine_available_ifaces_bridge
+ libalpine_available_ifaces_bridge \
+ libalpine_askpass
libalpine=$(atf_get_srcdir)/../libalpine.sh
@@ -53,3 +54,14 @@ libalpine_available_ifaces_bridge_body() {
-o match:"lo br0" \
sh -c ". $libalpine; available_ifaces"
}
+
+libalpine_askpass_body() {
+ init_env
+ echo foo >answer
+ atf_check \
+ -o match:"enter password" \
+ -o match:"stty -echo" \
+ -o match:"stty echo" \
+ -o match:"resp=foo" \
+ sh -c ". $libalpine; askpass 'enter password'<answer; echo resp=\$resp"
+}