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)
Wed, Apr 10, 8:31 PM
Unknown Object (File)
Dec 20 2023, 7:52 AM
Unknown Object (File)
Aug 29 2023, 4:01 AM
Unknown Object (File)
Aug 11 2023, 1:49 PM
Unknown Object (File)
Jul 9 2023, 7:33 PM
Unknown Object (File)
Jul 8 2023, 2:46 AM
Unknown Object (File)
Jun 12 2023, 1:46 AM
Unknown Object (File)
Jan 10 2023, 7:24 PM
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 13615
Build 13838: 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
6

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
40

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.