Automated tests for Plash
Plash contains the following sets of automated tests:
- tests/run-tests.pl: Functional tests that test pola-run and pola-shell. These use Unix tools such as bash and cat. This tends to make it difficult to debug why tests fail.
tests/libc_test.py: This is being introduced as part of Story6. Each test is a small fragment of C for testing a specific glibc function. For convenience, the C code is embedded in the Python script. These are much closer to unit tests. Though the tests don't mock out the server side, it's possible to check that specific FsOp methods have been called. As well as testing against the full libc.so, it will test against an LD_PRELOADed version of the Plash libc code, which keeps PlashGlibc's dynamic linker out of the loop.
- The glibc test suite. These tests have not proven as useful as I hoped.
- Many of these tests expect to be run inside the glibc build process, in order to find input files via relative paths.
- Some tests unset LD_LIBRARY_PATH, which stops them working under Plash.
- There are a lot of tests and they are not documented, so it requires some effort to determine what each test case does.
There should also be a set of tests for the environment that Plash runs under. For example, test that bind() does not follow symlinks when creating a domain socket.
See also:
Running the test suite
Python test suite
Run tests against the build tree:
./run-uninstalled.sh python tests/all_tests.py
Run tests against installed package:
python tests/all_tests.py
Older Perl-based tests
To run the older Perl-based tests in-place (without installing):
./run-tests.sh
They can also be run against an installed version of Plash:
cd tests ./run-tests.pl
