Page MenuHomeFreeBSD

Move libcasper tests.
ClosedPublic

Authored by oshogbo on Sep 2 2016, 9:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 29, 10:40 AM
Unknown Object (File)
Fri, Nov 29, 10:39 AM
Unknown Object (File)
Tue, Nov 26, 4:59 AM
Unknown Object (File)
Mon, Nov 25, 9:34 PM
Unknown Object (File)
Sun, Nov 24, 1:45 PM
Unknown Object (File)
Sat, Nov 23, 3:48 AM
Unknown Object (File)
Fri, Nov 22, 8:03 AM
Unknown Object (File)
Wed, Nov 20, 2:17 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.