Page MenuHomeFreeBSD

Move libcasper tests.
ClosedPublic

Authored by oshogbo on Sep 2 2016, 9:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 10 2024, 1:37 AM
Unknown Object (File)
Mar 2 2024, 9:39 AM
Unknown Object (File)
Mar 2 2024, 9:39 AM
Unknown Object (File)
Feb 22 2024, 10:13 PM
Unknown Object (File)
Feb 20 2024, 9:41 PM
Unknown Object (File)
Feb 20 2024, 11:17 AM
Unknown Object (File)
Feb 13 2024, 10:47 PM
Unknown Object (File)
Jan 19 2024, 3:12 PM
Subscribers
None

Details

Summary

Move libcasper tests from regression/capsicum/libcasper/ to the lib/libcasper/service/${service_name}/tests .
Change Makefiles to produce kyua tests.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

oshogbo retitled this revision from to Move libcasper tests..
oshogbo updated this object.
oshogbo edited the test plan for this revision. (Show Details)
oshogbo added reviewers: ngie, allanjude, emaste.
oshogbo changed the visibility from "Public (No Login Required)" to "All Users".
lib/libcasper/Makefile
6–7 ↗(On Diff #19978)

intended?

lib/libcasper/services/cap_dns/Makefile
18 ↗(On Diff #19978)

It seems src.opts.mk is most often included at the top of the Makefile

lib/libcasper/Makefile
6–7 ↗(On Diff #19978)

Agreed. This looks incorrect, potentially. If there's an issue with ordering of the subdirectories, it should be:

SUBDIR_PARALLEL=
SUBDIR_DEPEND_services=libcasper
lib/libcasper/services/cap_dns/Makefile
18 ↗(On Diff #19978)

Make sure LIBDIR is correct though before doing that to avoid incorrectly installing it to /usr/lib .

lib/libcasper/services/cap_dns/tests/Makefile
3 ↗(On Diff #19978)

Please use

dns_test
lib/libcasper/services/cap_dns/tests/dns.c
128–130 ↗(On Diff #19978)
errx(1, "...");

?

228 ↗(On Diff #19978)

(Picking a random item)

These hardcoded addresses/ports should really be #defines.

230 ↗(On Diff #19978)

What if this happens? Should the test exit?

Also, what happens if the kernel was compiled with !INET?

260 ↗(On Diff #19978)

Uhhhhhhh... why 25 (smtp)? Some IT groups might specifically block port 25. Is there an alternate port that can be used?

Also, this could use "getservbyname" for clarity.

298–300 ↗(On Diff #19978)

Bleh.. I don't like this assumption.

302 ↗(On Diff #19978)

Check the result of inet_pton?

314–315 ↗(On Diff #19978)

Same comments as above.

lib/libcasper/services/cap_grp/tests/Makefile
3 ↗(On Diff #19978)

grp_test please.

lib/libcasper/services/cap_grp/tests/grp.c
67–68 ↗(On Diff #19978)

Ew? Is there a better way we could be using than this?

144 ↗(On Diff #19978)

Why is the return value of this function being ignored?

168 ↗(On Diff #19978)

Same as above.

191–195 ↗(On Diff #19978)

Hardcoded group names... should be #defines.

266 ↗(On Diff #19978)

nitems(cmds) - 1 instead of 7?

267 ↗(On Diff #19978)

nitems(names) - 1

294–296 ↗(On Diff #19978)

Use

nitems(...) - 1

here?

lib/libcasper/services/cap_sysctl/tests/Makefile
3 ↗(On Diff #19978)

sysctl_test ?

lib/libcasper/services/cap_sysctl/tests/sysctl.c
186 ↗(On Diff #19978)

Can these subtests please be broken down a bit further (even if they're in separate functions)? It'll make converting them to ATF much easier..

oshogbo changed the visibility from "All Users" to "Public (No Login Required)".

Fix some issue pointed out by emaste@ and ngie@ with moving tests to different directory.

@ngie Thank you very much for all those comments. This patch suppose only to move tests to different directory.
You made a lot of good points about those tests, so I will fix them in next patch. Do you think I should first fix all problems you pointed out? Or can I commit moving patch and then do fixes?

I think it's fair to move the tests first, and follow up with improvements in subsequent commits.

Mark comments which was fixed.

Also, LGTM for me for the move

This revision was automatically updated to reflect the committed changes.