Page MenuHomeFreeBSD

Move libcasper tests.
ClosedPublic

Authored by oshogbo on Sep 2 2016, 9:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 11:00 AM
Unknown Object (File)
Thu, Nov 7, 12:15 PM
Unknown Object (File)
Wed, Oct 30, 7:27 PM
Unknown Object (File)
Tue, Oct 29, 11:52 AM
Unknown Object (File)
Sun, Oct 20, 7:24 PM
Unknown Object (File)
Oct 16 2024, 3:19 AM
Unknown Object (File)
Oct 15 2024, 7:34 AM
Unknown Object (File)
Oct 13 2024, 2:48 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

Lint
Lint Skipped
Unit
Tests Skipped

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

intended?

lib/libcasper/services/cap_dns/Makefile
18

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

lib/libcasper/Makefile
6–7

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

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

Please use

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

?

228

(Picking a random item)

These hardcoded addresses/ports should really be #defines.

230

What if this happens? Should the test exit?

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

260

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

Bleh.. I don't like this assumption.

302

Check the result of inet_pton?

314–315

Same comments as above.

lib/libcasper/services/cap_grp/tests/Makefile
3

grp_test please.

lib/libcasper/services/cap_grp/tests/grp.c
67–68

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

144

Why is the return value of this function being ignored?

168

Same as above.

191–195

Hardcoded group names... should be #defines.

266

nitems(cmds) - 1 instead of 7?

267

nitems(names) - 1

294–296

Use

nitems(...) - 1

here?

lib/libcasper/services/cap_sysctl/tests/Makefile
3

sysctl_test ?

lib/libcasper/services/cap_sysctl/tests/sysctl.c
186

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.