2020-01-12 22:52:40 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Modules integration test runner.
|
2020-12-24 13:29:14 +03:00
|
|
|
# The tests (defined in ./tests.nix) use the NixOS testing framework and are executed in a VM.
|
2020-01-12 22:52:40 +03:00
|
|
|
#
|
|
|
|
# Usage:
|
2020-08-21 23:36:13 +03:00
|
|
|
# Run all tests
|
|
|
|
# ./run-tests.sh
|
|
|
|
#
|
|
|
|
# Test specific scenario
|
2020-09-27 13:43:20 +03:00
|
|
|
# ./run-tests.sh --scenario|-s <scenario>
|
|
|
|
#
|
2021-01-30 12:47:01 +03:00
|
|
|
# - When <scenario> contains a space, <scenario> is treated as nix code defining
|
|
|
|
# a scenario. It is evaluated in the same context as other scenarios in ./tests.nix
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
# ./run-tests.sh -s "{ nix-bitcoin.nodeinfo.enable = true; }" container --run c nodeinfo
|
|
|
|
#
|
|
|
|
# - When <scenario> does not name a scenario, the test is run with an adhoc scenario
|
2020-09-27 13:43:20 +03:00
|
|
|
# where services.<scenario> is enabled.
|
2020-01-12 22:52:40 +03:00
|
|
|
#
|
2020-09-27 13:43:32 +03:00
|
|
|
# Example:
|
|
|
|
# ./run-tests.sh -s electrs
|
|
|
|
#
|
2020-09-28 14:09:09 +03:00
|
|
|
# Run test(s) and link results to avoid garbage collection
|
|
|
|
# ./run-tests.sh [--scenario <scenario>] --out-link-prefix /tmp/nix-bitcoin-test
|
2020-01-12 22:52:40 +03:00
|
|
|
#
|
2020-08-21 23:36:15 +03:00
|
|
|
# Pass extra args to nix-build
|
|
|
|
# ./run-tests.sh build --builders 'ssh://mybuildhost - - 15'
|
|
|
|
#
|
2020-01-12 22:52:40 +03:00
|
|
|
# Run interactive test debugging
|
2020-08-21 23:36:13 +03:00
|
|
|
# ./run-tests.sh [--scenario <scenario>] debug
|
2020-01-12 22:52:40 +03:00
|
|
|
#
|
2020-09-27 13:43:20 +03:00
|
|
|
# This starts the testing VM and drops you into a Python REPL where you can
|
|
|
|
# manually execute the tests from ./tests.py
|
|
|
|
#
|
2020-09-27 13:43:28 +03:00
|
|
|
# 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.
|
|
|
|
#
|
2021-03-27 01:23:22 +03:00
|
|
|
# Run a test scenario in a regular NixOS VM.
|
|
|
|
# No tests are executed, the machine's serial console is attached to your terminal.
|
|
|
|
# ./run-tests.sh [--scenario <scenario>] vm
|
|
|
|
#
|
|
|
|
# This is useful for directly exploring a test configuration without the
|
|
|
|
# intermediate Python REPL layer.
|
|
|
|
# Run command 'q' inside the machine for instant poweroff.
|
|
|
|
#
|
2021-02-06 11:38:58 +03:00
|
|
|
# Run tests from a snapshot copy of the source files
|
|
|
|
# ./run-tests.sh --copy-src|-c ...
|
|
|
|
#
|
|
|
|
# This allows you to continue editing the nix-bitcoin sources while tests are running
|
|
|
|
# and reading source files.
|
|
|
|
# Files are copied to /tmp, a caching scheme helps minimizing copies.
|
|
|
|
#
|
2020-09-27 13:43:20 +03:00
|
|
|
# To add custom scenarios, set the environment variable `scenarioOverridesFile`.
|
2020-01-12 22:52:40 +03:00
|
|
|
|
|
|
|
set -eo pipefail
|
|
|
|
|
2020-12-11 15:26:08 +03:00
|
|
|
scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd)
|
|
|
|
|
2021-02-06 11:38:58 +03:00
|
|
|
args=("$@")
|
2020-07-16 17:48:41 +03:00
|
|
|
scenario=
|
2020-08-21 23:36:14 +03:00
|
|
|
outLinkPrefix=
|
2020-12-11 15:26:10 +03:00
|
|
|
ciBuild=
|
2020-08-21 23:36:14 +03:00
|
|
|
while :; do
|
|
|
|
case $1 in
|
|
|
|
--scenario|-s)
|
|
|
|
if [[ $2 ]]; then
|
|
|
|
scenario=$2
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
else
|
2020-09-27 13:43:25 +03:00
|
|
|
>&2 echo "Error: $1 requires an argument."
|
2020-08-21 23:36:14 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
--out-link-prefix|-o)
|
|
|
|
if [[ $2 ]]; then
|
|
|
|
outLinkPrefix=$2
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
else
|
2020-09-27 13:43:25 +03:00
|
|
|
>&2 echo "Error: $1 requires an argument."
|
2020-08-21 23:36:14 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
2020-12-11 15:26:10 +03:00
|
|
|
--ci)
|
|
|
|
shift
|
|
|
|
ciBuild=1
|
|
|
|
;;
|
2021-02-06 11:38:58 +03:00
|
|
|
--copy-src|-c)
|
|
|
|
shift
|
2021-12-14 21:51:17 +03:00
|
|
|
if [[ ! $_nixBitcoinInCopiedSrc ]]; then
|
2021-02-06 11:38:58 +03:00
|
|
|
. "$scriptDir/lib/copy-src.sh"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
;;
|
2020-08-21 23:36:14 +03:00
|
|
|
*)
|
|
|
|
break
|
|
|
|
esac
|
|
|
|
done
|
2020-07-16 17:48:41 +03:00
|
|
|
|
2020-01-12 22:52:40 +03:00
|
|
|
numCPUs=${numCPUs:-$(nproc)}
|
|
|
|
# Min. 800 MiB needed to avoid 'out of memory' errors
|
|
|
|
memoryMiB=${memoryMiB:-2048}
|
|
|
|
|
2022-08-16 22:00:00 +03:00
|
|
|
NIX_PATH=nixpkgs=$(nix eval --raw -f "$scriptDir/../pkgs/nixpkgs-pinned.nix" nixpkgs):nix-bitcoin=$(realpath "$scriptDir/..")
|
|
|
|
export NIX_PATH
|
2021-01-30 12:47:01 +03:00
|
|
|
|
|
|
|
runAtExit=
|
|
|
|
trap 'eval "$runAtExit"' EXIT
|
|
|
|
|
|
|
|
# Support explicit scenario definitions
|
|
|
|
if [[ $scenario = *' '* ]]; then
|
2022-08-16 22:00:00 +03:00
|
|
|
scenarioOverridesFile=$(mktemp "${XDG_RUNTIME_DIR:-/tmp}/nb-scenario.XXX")
|
|
|
|
export scenarioOverridesFile
|
|
|
|
|
|
|
|
# shellcheck disable=SC2016
|
2021-01-30 12:47:01 +03:00
|
|
|
runAtExit+='rm -f "$scenarioOverridesFile";'
|
2021-03-22 15:19:48 +03:00
|
|
|
echo "{ scenarios, pkgs, lib }: with lib; { tmp = $scenario; }" > "$scenarioOverridesFile"
|
2021-01-30 12:47:01 +03:00
|
|
|
scenario=tmp
|
|
|
|
fi
|
2020-01-12 22:52:40 +03:00
|
|
|
|
|
|
|
# Run the test. No temporary files are left on the host system.
|
|
|
|
run() {
|
|
|
|
# TMPDIR is also used by the test driver for VM tmp files
|
2022-08-16 22:00:00 +03:00
|
|
|
TMPDIR=$(mktemp -d /tmp/nix-bitcoin-test.XXX)
|
|
|
|
export TMPDIR
|
|
|
|
runAtExit+="rm -rf ${TMPDIR};"
|
2020-01-12 22:52:40 +03:00
|
|
|
|
2022-08-16 22:00:00 +03:00
|
|
|
nix-build --out-link "$TMPDIR/driver" -E "((import \"$scriptDir/tests.nix\" {}).getTest \"$scenario\").vm" -A driver
|
2020-01-12 22:52:40 +03:00
|
|
|
|
|
|
|
# Variable 'tests' contains the Python code that is executed by the driver on startup
|
|
|
|
if [[ $1 == --interactive ]]; then
|
|
|
|
echo "Running interactive testing environment"
|
|
|
|
tests=$(
|
|
|
|
echo 'is_interactive = True'
|
2022-07-05 11:12:56 +03:00
|
|
|
echo 'exec(open(os.environ["testScript"]).read())'
|
2020-01-12 22:52:40 +03:00
|
|
|
# Start VM
|
2022-07-29 16:37:29 +03:00
|
|
|
echo 'if "machine" in vars(): machine.start()'
|
2022-07-05 11:12:56 +03:00
|
|
|
# Start REPL.
|
|
|
|
# Use `code.interact` for the REPL instead of the builtin test driver REPL
|
|
|
|
# because it supports low featured terminals like Emacs' shell-mode.
|
2020-01-12 22:52:40 +03:00
|
|
|
echo 'import code'
|
|
|
|
echo 'code.interact(local=globals())'
|
|
|
|
)
|
|
|
|
else
|
2022-07-05 11:12:56 +03:00
|
|
|
tests='exec(open(os.environ["testScript"]).read())'
|
2020-01-12 22:52:40 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "VM stats: CPUs: $numCPUs, memory: $memoryMiB MiB"
|
|
|
|
[[ $NB_TEST_ENABLE_NETWORK ]] || QEMU_NET_OPTS='restrict=on'
|
2022-08-16 22:00:00 +03:00
|
|
|
cd "$TMPDIR" # The VM creates a VDE control socket in $PWD
|
2020-01-12 22:52:40 +03:00
|
|
|
env -i \
|
|
|
|
NIX_PATH="$NIX_PATH" \
|
|
|
|
TMPDIR="$TMPDIR" \
|
2020-03-29 19:50:35 +03:00
|
|
|
USE_TMPDIR=1 \
|
2020-01-12 22:52:40 +03:00
|
|
|
QEMU_OPTS="-smp $numCPUs -m $memoryMiB -nographic $QEMU_OPTS" \
|
|
|
|
QEMU_NET_OPTS="$QEMU_NET_OPTS" \
|
2022-08-16 22:00:00 +03:00
|
|
|
"$TMPDIR/driver/bin/nixos-test-driver" <(echo "$tests")
|
2020-01-12 22:52:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
debug() {
|
|
|
|
run --interactive
|
|
|
|
}
|
|
|
|
|
2020-09-27 13:43:34 +03:00
|
|
|
evalTest() {
|
2021-09-03 14:19:29 +03:00
|
|
|
nix-instantiate --eval -E "($(vmTestNixExpr)).outPath"
|
2020-09-27 13:43:34 +03:00
|
|
|
}
|
|
|
|
|
2020-12-11 15:26:04 +03:00
|
|
|
instantiate() {
|
|
|
|
nix-instantiate -E "$(vmTestNixExpr)" "$@"
|
|
|
|
}
|
|
|
|
|
2020-09-27 13:43:28 +03:00
|
|
|
container() {
|
2021-01-30 12:47:01 +03:00
|
|
|
export scriptDir scenario
|
|
|
|
"$scriptDir/lib/make-container.sh" "$@"
|
2020-09-27 13:43:28 +03:00
|
|
|
}
|
|
|
|
|
2021-03-27 01:23:22 +03:00
|
|
|
# Run a regular NixOS VM
|
|
|
|
vm() {
|
2022-08-16 22:00:00 +03:00
|
|
|
TMPDIR=$(mktemp -d /tmp/nix-bitcoin-vm.XXX)
|
|
|
|
export TMPDIR
|
2021-03-27 01:23:22 +03:00
|
|
|
runAtExit+="rm -rf $TMPDIR;"
|
|
|
|
|
2022-08-16 22:00:00 +03:00
|
|
|
nix-build --out-link "$TMPDIR/vm" -E "((import \"$scriptDir/tests.nix\" {}).getTest \"$scenario\").vmWithoutTests"
|
2021-03-27 01:23:22 +03:00
|
|
|
|
|
|
|
echo "VM stats: CPUs: $numCPUs, memory: $memoryMiB MiB"
|
2022-01-03 00:37:35 +03:00
|
|
|
[[ $NB_TEST_ENABLE_NETWORK ]] || export QEMU_NET_OPTS="restrict=on,$QEMU_NET_OPTS"
|
2021-03-27 01:23:22 +03:00
|
|
|
|
2022-08-16 22:00:00 +03:00
|
|
|
# shellcheck disable=SC2211
|
2021-03-27 01:23:22 +03:00
|
|
|
USE_TMPDIR=1 \
|
|
|
|
NIX_DISK_IMAGE=$TMPDIR/img.qcow2 \
|
|
|
|
QEMU_OPTS="-smp $numCPUs -m $memoryMiB -nographic $QEMU_OPTS" \
|
2022-08-16 22:00:00 +03:00
|
|
|
"$TMPDIR"/vm/bin/run-*-vm
|
2021-03-27 01:23:22 +03:00
|
|
|
}
|
|
|
|
|
2020-12-11 15:26:09 +03:00
|
|
|
doBuild() {
|
|
|
|
name=$1
|
|
|
|
shift
|
2020-12-11 15:26:10 +03:00
|
|
|
if [[ $ciBuild ]]; then
|
2021-12-08 06:07:33 +03:00
|
|
|
"$scriptDir/ci/build-to-cachix.sh" "$@"
|
2020-08-21 23:36:14 +03:00
|
|
|
else
|
2020-12-11 15:26:10 +03:00
|
|
|
if [[ $outLinkPrefix ]]; then
|
|
|
|
outLink="--out-link $outLinkPrefix-$name"
|
|
|
|
else
|
|
|
|
outLink=--no-out-link
|
|
|
|
fi
|
|
|
|
nix-build $outLink "$@"
|
2020-08-21 23:36:14 +03:00
|
|
|
fi
|
2020-12-11 15:26:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# Run the test by building the test derivation
|
|
|
|
buildTest() {
|
2021-02-02 00:53:03 +03:00
|
|
|
vmTestNixExpr | doBuild $scenario "$@" -
|
2020-01-12 22:52:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
vmTestNixExpr() {
|
2020-12-11 15:26:10 +03:00
|
|
|
extraQEMUOpts=
|
|
|
|
|
|
|
|
if [[ $ciBuild ]]; then
|
|
|
|
# On continuous integration nodes there are few other processes running alongside the
|
|
|
|
# test, so use more memory here for maximum performance.
|
|
|
|
memoryMiB=4096
|
|
|
|
memTotalKiB=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
|
|
|
|
memAvailableKiB=$(awk '/MemAvailable/ { print $2 }' /proc/meminfo)
|
|
|
|
# Round down to nearest multiple of 50 MiB for improved test build caching
|
2022-08-16 22:00:00 +03:00
|
|
|
# shellcheck disable=SC2017
|
2020-12-11 15:26:10 +03:00
|
|
|
((memAvailableMiB = memAvailableKiB / (1024 * 50) * 50))
|
|
|
|
((memAvailableMiB < memoryMiB)) && memoryMiB=$memAvailableMiB
|
|
|
|
>&2 echo "VM stats: CPUs: $numCPUs, memory: $memoryMiB MiB"
|
|
|
|
>&2 echo "Host memory total: $((memTotalKiB / 1024)) MiB, available: $memAvailableMiB MiB"
|
|
|
|
|
|
|
|
# VMX is usually not available on CI nodes due to recursive virtualisation.
|
|
|
|
# Explicitly disable VMX, otherwise QEMU 4.20 fails with message
|
|
|
|
# "error: failed to set MSR 0x48b to 0x159ff00000000"
|
|
|
|
extraQEMUOpts="-cpu host,-vmx"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat <<EOF
|
2021-03-22 15:19:48 +03:00
|
|
|
((import "$scriptDir/tests.nix" {}).getTest "$scenario").vm.overrideAttrs (old: rec {
|
2020-01-12 22:52:40 +03:00
|
|
|
buildCommand = ''
|
2020-09-27 13:43:37 +03:00
|
|
|
export QEMU_OPTS="-smp $numCPUs -m $memoryMiB $extraQEMUOpts"
|
2020-01-12 22:52:40 +03:00
|
|
|
echo "VM stats: CPUs: $numCPUs, memory: $memoryMiB MiB"
|
|
|
|
'' + old.buildCommand;
|
|
|
|
})
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2021-12-08 06:07:31 +03:00
|
|
|
checkFlakeSupport() {
|
|
|
|
testName=$1
|
|
|
|
if [[ ! -v hasFlakes ]]; then
|
|
|
|
if [[ $(nix flake 2>&1) == *"requires a sub-command"* ]]; then
|
|
|
|
hasFlakes=1
|
|
|
|
else
|
|
|
|
hasFlakes=
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ ! $hasFlakes ]]; then
|
|
|
|
echo "Skipping test '$testName'. Nix flake support is not enabled."
|
|
|
|
return 1
|
2021-12-08 06:07:30 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-12-08 06:07:31 +03:00
|
|
|
flake() {
|
|
|
|
if ! checkFlakeSupport "flake"; then return; fi
|
|
|
|
|
|
|
|
nix flake check "$scriptDir/.."
|
|
|
|
}
|
|
|
|
|
2021-12-08 06:07:32 +03:00
|
|
|
# Test generating module documentation for search.nixos.org
|
|
|
|
nixosSearch() {
|
|
|
|
if ! checkFlakeSupport "nixosSearch"; then return; fi
|
|
|
|
|
2021-12-14 21:51:17 +03:00
|
|
|
if [[ $_nixBitcoinInCopiedSrc ]]; then
|
|
|
|
# flake-info requires that its target flake is under version control
|
|
|
|
. "$scriptDir/lib/create-git-repo.sh"
|
|
|
|
fi
|
|
|
|
|
2021-12-08 06:07:32 +03:00
|
|
|
if [[ $outLinkPrefix ]]; then
|
|
|
|
# Add gcroots for flake-info
|
2022-08-16 22:00:00 +03:00
|
|
|
nix build "$scriptDir/nixos-search#flake-info" -o "$outLinkPrefix-flake-info"
|
2021-12-08 06:07:32 +03:00
|
|
|
fi
|
2022-09-23 10:03:58 +03:00
|
|
|
"$scriptDir/nixos-search/flake-info-sandboxed.sh"
|
2021-12-08 06:07:32 +03:00
|
|
|
}
|
|
|
|
|
2020-09-28 14:09:10 +03:00
|
|
|
# A basic subset of tests to keep the total runtime within
|
2020-10-29 23:20:28 +03:00
|
|
|
# manageable bounds (<4 min on desktop systems).
|
2020-09-28 14:09:10 +03:00
|
|
|
# These are also run on the CI server.
|
|
|
|
basic() {
|
|
|
|
scenario=default buildTest "$@"
|
|
|
|
scenario=netns buildTest "$@"
|
2020-10-29 23:20:28 +03:00
|
|
|
scenario=netnsRegtest buildTest "$@"
|
2020-09-28 14:09:10 +03:00
|
|
|
}
|
|
|
|
|
2020-12-18 15:27:21 +03:00
|
|
|
# All tests that only consist of building a nix derivation.
|
|
|
|
# Their output is cached in /nix/store.
|
|
|
|
buildable() {
|
2022-01-06 15:40:52 +03:00
|
|
|
basic "$@"
|
2020-09-28 14:09:10 +03:00
|
|
|
scenario=full buildTest "$@"
|
2020-10-16 18:43:19 +03:00
|
|
|
scenario=regtest buildTest "$@"
|
2020-12-18 15:27:20 +03:00
|
|
|
scenario=hardened buildTest "$@"
|
2022-01-06 15:40:52 +03:00
|
|
|
scenario=clightningReplication buildTest "$@"
|
2020-09-28 14:09:10 +03:00
|
|
|
}
|
|
|
|
|
2020-12-18 15:27:21 +03:00
|
|
|
examples() {
|
|
|
|
script="
|
|
|
|
set -e
|
|
|
|
./deploy-container.sh
|
2021-08-15 23:41:25 +03:00
|
|
|
./deploy-container-minimal.sh
|
2020-12-18 15:27:21 +03:00
|
|
|
./deploy-qemu-vm.sh
|
2021-03-10 16:08:40 +03:00
|
|
|
./deploy-krops.sh
|
2020-12-18 15:27:21 +03:00
|
|
|
"
|
2021-08-15 12:28:39 +03:00
|
|
|
(cd "$scriptDir/../examples" && nix-shell --run "$script")
|
2020-12-18 15:27:21 +03:00
|
|
|
}
|
|
|
|
|
2022-08-16 22:00:00 +03:00
|
|
|
shellcheck() {
|
|
|
|
if ! checkFlakeSupport "shellcheck"; then return; fi
|
internal scripts: use pinned, cached pkgs
Instead of setting up the script PATH via nix-shell, use
`nix shell` with inputs from the nix-bitcoin flake.
Advantages:
- Uses the nixpkgs version from the nix-bitcoin flake instead of
`<nixpkgs>` from the user env (NIX_PATH), so the script runtime
env is reproducible.
- The pkg derivations for the runtime env are cached, which greatly
increases script startup speed.
This commit was generated by running the following script inside the
repo root dir:
def transform(path, src)
if src =~ /#! *nix-shell +-i +bash +-p +(.*)/
pkgs = $1
if src =~ /^.*?(set -e.*?pipefail)\n/
set_statement = $1
src.sub!($&, '')
end
src.sub!(/\A.*?#! *nix-shell.*?\n/m, '')
parents = ([ '..' ] * (path.split('/').count - 1)).join('/')
[
'#!/usr/bin/env bash',
*set_statement,
%(. "${BASH_SOURCE[0]%/*}/#{parents}/helper/run-in-nix-env" "#{pkgs}" "$@"),
nil,
src
].join("\n")
end
end
Dir['**/*.sh'].each do |f|
src = File.read(f)
if new_src = transform(f, src)
puts "Changed file #{f}"
File.write(f, new_src)
end
end
2022-08-22 15:57:39 +03:00
|
|
|
"$scriptDir/shellcheck.sh"
|
2022-08-16 22:00:00 +03:00
|
|
|
}
|
|
|
|
|
2020-12-18 15:27:21 +03:00
|
|
|
all() {
|
2022-08-16 22:00:00 +03:00
|
|
|
buildable "$@"
|
|
|
|
shellcheck
|
2020-12-18 15:27:21 +03:00
|
|
|
examples
|
2021-08-16 11:42:07 +03:00
|
|
|
flake
|
2021-12-08 06:07:32 +03:00
|
|
|
nixosSearch
|
2020-12-18 15:27:21 +03:00
|
|
|
}
|
|
|
|
|
2020-12-11 15:26:03 +03:00
|
|
|
# An alias for buildTest
|
2020-08-21 23:36:13 +03:00
|
|
|
build() {
|
2020-12-11 15:26:03 +03:00
|
|
|
buildTest "$@"
|
2020-08-21 23:36:13 +03:00
|
|
|
}
|
|
|
|
|
2022-08-16 22:00:00 +03:00
|
|
|
if [[ $# -gt 0 && $1 != -* ]]; then
|
2020-12-11 15:26:03 +03:00
|
|
|
# An explicit command was provided
|
|
|
|
command=$1
|
|
|
|
shift
|
|
|
|
if [[ $command == eval ]]; then
|
|
|
|
command=evalTest
|
|
|
|
fi
|
2020-09-28 14:09:09 +03:00
|
|
|
: ${scenario:=default}
|
2020-12-11 15:26:03 +03:00
|
|
|
elif [[ $scenario ]]; then
|
|
|
|
command=buildTest
|
|
|
|
else
|
|
|
|
command=basic
|
2020-09-27 13:43:34 +03:00
|
|
|
fi
|
2020-09-27 13:43:27 +03:00
|
|
|
$command "$@"
|