tree: 0b907661c59facad77f3dfb597a4b537d6865832
  1. testdata/
  2. bootstrap-get-images.sh
  3. capabilities.bats
  4. cgroup_delegation.bats
  5. cgroups.bats
  6. checkpoint.bats
  7. cpu_affinity.bats
  8. create.bats
  9. cwd.bats
  10. debug.bats
  11. delete.bats
  12. dev.bats
  13. env.bats
  14. events.bats
  15. exec.bats
  16. get-images.sh
  17. help.bats
  18. helpers.bash
  19. hooks.bats
  20. hooks_so.bats
  21. host-mntns.bats
  22. idmap.bats
  23. ioprio.bats
  24. kill.bats
  25. list.bats
  26. mask.bats
  27. memorypolicy.bats
  28. mounts.bats
  29. mounts_propagation.bats
  30. mounts_recursive.bats
  31. mounts_sshfs.bats
  32. netdev.bats
  33. no_pivot.bats
  34. pause.bats
  35. personality.bats
  36. pidfd-socket.bats
  37. ps.bats
  38. README.md
  39. rlimits.bats
  40. root.bats
  41. run.bats
  42. scheduler.bats
  43. seccomp-notify-compat.bats
  44. seccomp-notify.bats
  45. seccomp.bats
  46. selinux.bats
  47. spec.bats
  48. start.bats
  49. start_detached.bats
  50. start_hello.bats
  51. state.bats
  52. timens.bats
  53. tty.bats
  54. umask.bats
  55. update.bats
  56. userns.bats
  57. version.bats
tests/integration/README.md

runc Integration Tests

Integration tests provide end-to-end testing of runc.

Note that integration tests do not replace unit tests.

As a rule of thumb, code should be tested thoroughly with unit tests. Integration tests on the other hand are meant to test a specific feature end to end.

Integration tests are written in bash using the bats (Bash Automated Testing System) framework. Please see bats documentation for more details.

Running integration tests

The easiest way to run integration tests is with Docker:

make integration

Alternatively, you can run integration tests directly on your host through make:

sudo make localintegration

Or you can just run them directly using bats

sudo bats tests/integration

To run a single test bucket:

make integration TESTPATH="/checkpoint.bats"

To run them on your host, you need to set up a development environment plus bats (Bash Automated Testing System).

For example:

cd ~/go/src/github.com
git clone https://github.com/bats-core/bats-core.git
cd bats-core
./install.sh /usr/local

Writing integration tests

Helper functions are provided in order to facilitate writing tests.

Please see existing tests for examples.