Previously we parsed a v7 pw string using "%a+:" in the match pattern,
which matches a string of letters preceeding a colon. This would fail
for userids ending in a digit or _. Instead, match runs of non-colons
using "[^:]*".
While here, correct the error string from an existing test.
adduser("plop") should fail because adduser requires a table, not a
string. Report this as the failure reason, rather than claiming that
the faulre was due to an empty value.
Reported by: llm-postcr
Sponsored by: The FreeBSD FoundationDetails
Details
- Reviewers
bapt dtxdf - Commits
- rG30e3fd1811e3: nuageinit: Split pw line on :s
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Hi @emaste
Test for adduser is failing:
...
Standard output:
Executing command [ /usr/libexec/flua /usr/obj/var/freebsd-tree/user/src/amd64.amd64/libexec/nuageinit/tests/checkdir/usr/tests/libexec/nuag
einit/adduser.lua ]
Standard error:
Fail: incorrect exit status: 1, expected: 0
stdout:
stderr:
nuageinit: Argument should be a table
nuageinit: Argument should be a table
nuageinit: no path returned for username ending with _
...Comment Actions
If I run the test directly it passes:
emaste@framework:~/src/freebsd-src/wipbsd $ /usr/libexec/flua /usr/obj/home/emaste/src/freebsd-src/wipbsd/amd64.amd64/libexec/nuageinit/tests/checkdir/usr/tests/libexec/nuageinit/adduser.lua nuageinit: Argument should be a table nuageinit: Argument should be a table emaste@framework:~/src/freebsd-src/wipbsd $ echo $? 0
Unfortunately our test suite makes it difficult to debug.
Comment Actions
Try this as root:
# pwd /var/freebsd-tree/user/src/libexec/nuageinit # make check; echo $? 1
And this as your user (I use doas, but maybe you should use sudo):
$ kyua report --verbose --results-file $(doas make check | grep 'Results saved to' | sed -Ee 's/Results saved to //')Comment Actions
Thanks, this works with mdo -- but so very convoluted.
kyua report --verbose --results-file $(mdo make -C libexec/nuageinit check | grep 'Results saved to' | sed -Ee 's/Results saved to //')
| libexec/nuageinit/tests/adduser.lua | ||
|---|---|---|
| 12 | as an aside I'm not sure why we have this impossible_username test, which is actually an acceptable username | |