aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2024-11-20 10:02:55 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2024-11-20 10:02:55 +0000
commit3e2a7a2cbeb272b891c6931f2ae54ee6e5ec2c7d (patch)
tree8d3e1dfde4eb95c48e9006605084292e718e0e20 /libexec
parent3e502866073f8d922eecb9016920a56b90c35e38 (diff)
Diffstat (limited to 'libexec')
-rw-r--r--libexec/nuageinit/tests/adduser_passwd.lua20
-rw-r--r--libexec/nuageinit/tests/nuage.sh3
2 files changed, 23 insertions, 0 deletions
diff --git a/libexec/nuageinit/tests/adduser_passwd.lua b/libexec/nuageinit/tests/adduser_passwd.lua
new file mode 100644
index 000000000000..e2d9395d679d
--- /dev/null
+++ b/libexec/nuageinit/tests/adduser_passwd.lua
@@ -0,0 +1,20 @@
+#!/usr/libexec/flua
+
+local n = require("nuage")
+
+local pw = {}
+pw.name = "foo"
+pw.plain_text_passwd = "bar"
+local res = n.adduser(pw)
+if not res then
+ n.err("valid user should return a path")
+end
+
+local pw2 = {}
+pw2.name = "foocrypted"
+-- barcrypted
+pw2.passwd = "$6$ZY8faYcEfyoEZnNX$FuAZA2SKhIfYLebhEtbmjptQNrenr6mJhji35Ru.zqdaa6G/gkKiHoQuh0vYZTKrjaykyohR8W4Q5ZF56yt8u1"
+res = n.adduser(pw2)
+if not res then
+ n.err("valid user should return a path")
+end
diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh
index a5451561202f..f2753d6d91e6 100644
--- a/libexec/nuageinit/tests/nuage.sh
+++ b/libexec/nuageinit/tests/nuage.sh
@@ -60,6 +60,9 @@ adduser_passwd_body()
passhash=`awk -F ':' '/^foo:/ {print $2}' etc/master.passwd`
atf_check -s exit:0 -o inline:$passhash \
$(atf_get_srcdir)/crypt $passhash "bar"
+ passhash=`awk -F ':' '/^foocrypted:/ {print $2}' etc/master.passwd`
+ atf_check -s exit:0 -o inline:$passhash \
+ $(atf_get_srcdir)/crypt $passhash "barcrypted"
}
addgroup_body()