summaryrefslogtreecommitdiffstats
path: root/pw/tests
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-07-05 10:11:35 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-07-05 10:11:35 +0000
commite29923cf879be6e046865ccfe4c63c843b55e9b7 (patch)
tree65e5f1e77773621f56b7def3fb14f6cc46144797 /pw/tests
parentede1c7addbd047595d4ca1701f0d4f9b143694ed (diff)
downloadpw-darwin-e29923cf879be6e046865ccfe4c63c843b55e9b7.tar.gz
pw-darwin-e29923cf879be6e046865ccfe4c63c843b55e9b7.tar.zst
pw-darwin-e29923cf879be6e046865ccfe4c63c843b55e9b7.zip
Also validate hours via strptime_l(3)
Simplify the code, by only using one parser, ensure the dates (hours and dates) are valid
Diffstat (limited to 'pw/tests')
-rwxr-xr-xpw/tests/pw_useradd.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/pw/tests/pw_useradd.sh b/pw/tests/pw_useradd.sh
index 93cde50..d059828 100755
--- a/pw/tests/pw_useradd.sh
+++ b/pw/tests/pw_useradd.sh
@@ -199,6 +199,12 @@ user_add_expiration_body() {
${PW} useradd foo -e 20-Foo-2043
atf_check -e inline:"pw: Invalid date\n" -s exit:1 \
${PW} useradd foo -e 20-13-2043
+ atf_check -s exit:0 ${PW} useradd foo -e "12:00 20-03-2043"
+ atf_check -s exit:0 ${PW} userdel foo
+ atf_check -e inline:"pw: Invalid date\n" -s exit:1 \
+ ${PW} useradd foo -e "12 20-03-2043"
+ atf_check -s exit:0 ${PW} useradd foo -e "20-03-2043 12:00"
+ atf_check -s exit:0 ${PW} userdel foo
}
atf_init_test_cases() {