test: add container support

This commit is contained in:
Erik Arvstedt 2020-09-27 12:43:28 +02:00
parent e99b7edb8e
commit fcc67da9f4
No known key found for this signature in database
GPG key ID: 33312B944DD97846
5 changed files with 129 additions and 1 deletions

View file

@ -25,6 +25,14 @@
# This starts the testing VM and drops you into a Python REPL where you can
# manually execute the tests from ./tests.py
#
# Run a test scenario in a container
# sudo ./run-tests.sh [--scenario <scenario>] container
#
# This is useful for quick experiments; containers start much faster than VMs.
# Running the Python test suite in containers is not yet supported.
# For now, creating NixOS containers requires root permissions.
# See ./lib/make-container.sh for a complete documentation.
#
# To add custom scenarios, set the environment variable `scenarioOverridesFile`.
set -eo pipefail
@ -108,6 +116,10 @@ debug() {
run --interactive
}
container() {
. "$testDir/lib/make-container.sh" "$@"
}
# Run the test by building the test derivation
buildTest() {
if [[ $outLinkPrefix ]]; then