summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup-timezone.in2
-rwxr-xr-xtests/setup_timezone_test16
2 files changed, 17 insertions, 1 deletions
diff --git a/setup-timezone.in b/setup-timezone.in
index ae7d141..01a5e37 100644
--- a/setup-timezone.in
+++ b/setup-timezone.in
@@ -29,7 +29,7 @@ show_tz_list() {
local path="$zroot/$1"
[ -d "$path" ] || return 1
- for i in $(find $path -maxdepth 1); do
+ for i in $(find $path/ -maxdepth 1); do
case $i in
*.tab|*/) continue;;
esac
diff --git a/tests/setup_timezone_test b/tests/setup_timezone_test
index 93eb137..391760d 100755
--- a/tests/setup_timezone_test
+++ b/tests/setup_timezone_test
@@ -7,6 +7,7 @@ init_tests \
setup_timezone_install \
setup_timezone_z_compat \
setup_timezone_none \
+ setup_timezone_interactive
setup_timezone_usage_body() {
test_usage setup-timezone
@@ -54,3 +55,18 @@ setup_timezone_none_body() {
setup-timezone none
}
+setup_timezone_interactive_body() {
+ init_env
+ mkdir -p usr/share/zoneinfo/Europe
+ touch usr/share/zoneinfo/Europe/Oslo
+ ( echo "Europe"
+ echo "?"
+ echo "Oslo"
+ ) > answers
+ atf_check -s exit:0 \
+ -o match:"apk add .*tzdata" \
+ -o match:"apk del" \
+ -e empty \
+ setup-timezone < answers
+}
+