toolbox/test/system
2020-02-18 13:18:51 +01:00
..
001-basics.bats Add system test scripts 2020-01-22 15:54:31 +01:00
101-create.bats Add system test scripts 2020-01-22 15:54:31 +01:00
102-list.bats Add system test scripts 2020-01-22 15:54:31 +01:00
103-remove.bats Add system test scripts 2020-01-22 15:54:31 +01:00
104-run.bats Add system test scripts 2020-01-22 15:54:31 +01:00
helpers.bash Add system test scripts 2020-01-22 15:54:31 +01:00
README.md test/system/README.md: Tweak 2020-02-18 13:18:51 +01:00

System tests

These tests are built with BATS (Bash Automated Testing System). They are strongly influenced by the libpod project.

The tests are meant to ensure that Toolbox's functionality remains stable throughout updates of both Toolbox and Podman/libpod.

Structure

  • Basic Tests

    • [] output version number (Toolbox + Podman)
    • show help screen when no command is given
    • create the default container
    • create a container with a custom name
    • create a container from a custom image
    • list containers (no present)
    • list default container and default image
    • list containers (some present; different name patterns)
    • list images (no present)
    • list images (some present; different name patterns)
    • remove a specific container
    • try to remove nonexistent container
    • try to remove a running container
    • remove all containers
    • try to remove all containers (running)
    • remove a specific image
    • remove all images
    • run a command inside of an existing container
  • Advanced Tests

    • create several containers with various configuration and then list them
    • create several containers and hop between them (series of enter/exit)
    • create a container, enter it, run a series of basic commands (id, whoami, dnf, top, systemctl,..)
    • enter a container and test basic set of networking tools (ping, traceroute,..)

The list of tests is stil rather basic. We welcome PRs with test suggestions or even their implementation.

Convention

  • All tests that start with Try to.. expect non-zero return value.

How to run the tests

Make sure you have bats and podman with toolbox installed on your system.

  • Enter the toolbox root folder
  • Invoke command bats ./test/system/ and the test suite should fire up

By default the test suite uses the system versions of podman and toolbox.

If you have a podman or toolbox installed in a nonstandard location then you can use the PODMAN and TOOLBOX environmental variables to set the path to the binaries. So the command to invoke the test suite could look something like this: PODMAN=/usr/libexec/podman TOOLBOX=./toolbox bats ./test/system/.