Page MenuHomeFreeBSD

Add basic tests for chio(1), cp(1), domainname(1), rm(1) and sync(8)
Needs ReviewPublic

Authored by shivansh on Dec 8 2017, 8:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 18 2025, 7:22 PM
Unknown Object (File)
Jan 12 2025, 2:51 PM
Unknown Object (File)
Jan 11 2025, 1:48 PM
Unknown Object (File)
Jan 9 2025, 3:36 PM
Unknown Object (File)
Dec 5 2024, 10:00 PM
Unknown Object (File)
Nov 6 2024, 11:48 PM
Unknown Object (File)
Nov 4 2024, 4:52 AM
Unknown Object (File)
Oct 18 2024, 5:11 AM
Subscribers
None

Details

Summary

Add basic command line parsing test coverage for these utilities. The tests
were automatically generated based on their man pages. These tests can be
expanded by hand for more thorough coverage. The aim is to generate very
basic amount of test coverage for all the utilities in the base system.

Tests generated via: https://github.com/shivansh/smoketestsuite/

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 13450
Build 13677: arc lint + arc unit

Event Timeline

bin/chio/tests/chio_test.sh
4

Please add an SPDX license identifier to all new files. This is a new way to describe software licensing, recently introduced by the project. In this case, it should look like this

* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
bin/sync/tests/sync_test.sh
34

In what sense is this a failure? It's normal to use sync without any arguments.

asomers added inline comments.
bin/chio/Makefile
4

missing .include <src.opts.mk> here and in the other bin/*/Makefile files

This revision now requires changes to proceed.Dec 11 2017, 10:22 PM

Address changes requested by @asomers.

I think it's about time that I start trying to figure out how FreeBSD makefiles work to avoid such mistakes in the future. And I guess it's going to be a quite daring task, given [1] says - "and if you do look at them, make sure you have a flask of strong coffee handy!" :P

[1]: https://www.freebsd.org/doc/en/books/developers-handbook/tools-make.html

bin/domainname/tests/domainname_test.sh
41

This isn't necessarily the case. Systems that happen to be using NIS will return a nonempty string here and fail the test. The only thing that you can safely assert here is the exit:0 part.