Are there any test suites available for the small programs usually shipped with the operating system? Specifically, programs like cp, cat, dd etc (anything in /bin/) on Linux or BSD; OpenBSD being the preferred option. I know that md5 has a testing script built in however I can't find any others. The regression testing suite from OpenBSD doesn't have tests for all the utilities.

  • What is it you'd like to test? – Kusalananda Jul 19 '19 at 7:07
  • I'm writing custom versions of a few coreutils with the same interface. – user3927312 Jul 20 '19 at 16:06

On GNU/Linux, these utilities are a part of the coreutils, the test suite can be found in the source repository under tests.

Note: Linux is just the kernel, the rest of the system is developed by different entities, such as GNU.

GNU is an operating system that is free software...consists of GNU packages (programs specifically released by the GNU Project) as well as free software released by third parties.

On BSD, the whole operating system is developed together in one repository.

For OpenBSD, there do not appear to be any tests for these utilities in their source repository.

  • 1
    github.com/openbsd/src/tree/master/regress They do have regression tests for a few of the utilities. – user3927312 Jul 19 '19 at 0:33
  • Any idea how to run the tests? I need the tests to run on OpenBSD using my custom coreutils implementation. – user3927312 Aug 27 '19 at 21:50
  • 1
    Per the Makefile, # To run full regression tests you just need one step: # make regress. Note that you will probably need to use bmake if running on Linux. – rage Aug 28 '19 at 3:00
  • 1
    I was actually asking about the coreutils since it doesn't seem to work easily without having first built coreutils but it is possible with a few modifications. The OpenBSD regression suite is easier to run as you noted but it doesn't cover all the utilities. I ended up using a combination of tests from GNU coreutils, busybox and the OpenBSD regression tests. – user3927312 Aug 28 '19 at 3:38

The POSIX test suites provide full coverage of the standard utilities, which won't be everything in /bin on most systems. It will cover all of the tools you list, however. As well as only covering the standard utilities, the suite will only cover their specified behaviours, and any extensions above POSIX would be ignored (at best).

You would want the VSC suite, "for Shell and Utilities", rather than the one for system interfaces. These are available for a fee to trademark licensees, but you can get a time-limited licence as an open-source project implementing the standard for free with what doesn't appear to be an onerous licence agreement.

There are open suites for much of the system interfaces, but I'm not aware of one for the utilities (and the ones I know of are quite dated as well).

  • 1
    The POSIX test suite seems like a good fit. Also FreeBSD ships with a test suite and it might be closest to the utilities for OpenBSD (wiki.freebsd.org/TestSuite). I'm trying to figure out how I can pull that into OpenBSD. – user3927312 Jul 19 '19 at 0:39
  • The issue with the VSC suite is that I'd need to contact the Open group for the test suite. I ended up using the GNU coreutils tests and the test suite from busybox. – user3927312 Aug 28 '19 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.