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()