Skip to content

Commit e1c87a3

Browse files
committed
align tests to new paths
1 parent 2abe4ad commit e1c87a3

1 file changed

Lines changed: 24 additions & 21 deletions

File tree

test.sh

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
#!/bin/bash
2-
1+
#!/usr/bin/env bash
32
# Run all known IncludeOS tests.
43
#
54
# A lot of these tests require vmrunner and a network bridge.
65
# See https://github.com/includeos/vmrunner/pull/31
76

7+
pushd "$(dirname "$0")" >/dev/null
88
: "${QUICK_SMOKE:=}" # Define this to only do a ~1-5 min. smoke test.
99
: "${DRY_RUN:=}" # Define this to expand all steps without running any
1010
: "${CCACHE_FLAG:=}" # Define as "--arg withCcache true" to enable ccache.
1111

12+
UNIT_TESTS=./test/tests-unit
13+
INTEGRATION_TESTS=./test/tests-integration
14+
1215
steps=0
1316
fails=0
1417
failed_tests=()
@@ -58,7 +61,7 @@ run(){
5861
fi
5962
}
6063

61-
unittests(){
64+
run_unittests(){
6265
nix-build unittests.nix
6366
}
6467

@@ -71,22 +74,22 @@ build_example(){
7174
}
7275

7376
multicore_subset(){
74-
nix-build ./unikernel.nix --arg smp true $CCACHE_FLAG --argstr unikernel ./test/kernel/integration/smp --arg doCheck true
77+
nix-build --arg smp true $CCACHE_FLAG --argstr unikernel ${INTEGRATION_TESTS}/kernel/smp --arg doCheck true
7578

7679
# The following tests are not using multiple CPU's, but have been equippedd with some anyway
7780
# to make sure core functionality is not broken by missing locks etc. when waking up more cores.
78-
nix-shell ./unikernel.nix --arg smp true $CCACHE_FLAG --argstr unikernel ./test/net/integration/udp --arg doCheck true
79-
nix-build ./unikernel.nix --arg smp true $CCACHE_FLAG --argstr unikernel ./test/kernel/integration/paging --arg doCheck true
81+
nix-shell ./unikernel.nix --arg smp true $CCACHE_FLAG --argstr unikernel ${INTEGRATION_TESTS}/net/udp --arg doCheck true
82+
nix-build ./unikernel.nix --arg smp true $CCACHE_FLAG --argstr unikernel ${INTEGRATION_TESTS}/kernel/paging --arg doCheck true
8083
}
8184

8285
smoke_tests(){
83-
nix-build ./unikernel.nix $CCACHE_FLAG --argstr unikernel ./test/net/integration/udp --arg doCheck true
84-
nix-build ./unikernel.nix $CCACHE_FLAG --argstr unikernel ./test/net/integration/tcp --arg doCheck true
85-
nix-build ./unikernel.nix $CCACHE_FLAG --argstr unikernel ./test/kernel/integration/paging --arg doCheck true
86-
nix-build ./unikernel.nix $CCACHE_FLAG --argstr unikernel ./test/kernel/integration/smp --arg doCheck true
86+
nix-shell ./unikernel.nix $CCACHE_FLAG --argstr unikernel ${INTEGRATION_TESTS}/net/udp --arg doCheck true
87+
nix-shell ./unikernel.nix $CCACHE_FLAG --argstr unikernel ${INTEGRATION_TESTS}/net/tcp --arg doCheck true
88+
nix-build ./unikernel.nix $CCACHE_FLAG --argstr unikernel ${INTEGRATION_TESTS}/kernel/paging --arg doCheck true
89+
nix-build ./unikernel.nix $CCACHE_FLAG --argstr unikernel ${INTEGRATION_TESTS}/kernel/smp --arg doCheck true
8790
}
8891

89-
run unittests "Build and run unit tests"
92+
run run_unittests "Build and run unit tests"
9093

9194
run build_chainloader "Build the 32-bit chainloader"
9295

@@ -207,7 +210,7 @@ exclusions=(
207210
unsandbox_list=(
208211
"term" # fails to create the tun device, like the net integration tests
209212
)
210-
run_testsuite "./test/kernel/integration" "${exclusions[@]}"
213+
run_testsuite "${INTEGRATION_TESTS}/kernel" "${exclusions[@]}"
211214
unsandbox_list=()
212215

213216
#
@@ -217,7 +220,7 @@ exclusions=(
217220

218221
)
219222

220-
run_testsuite "./test/stl/integration" "${exclusions[@]}"
223+
run_testsuite "${INTEGRATION_TESTS}/stl" "${exclusions[@]}"
221224

222225

223226
#
@@ -241,15 +244,15 @@ exclusions=(
241244
# <vm> failed to create tun device: Operation not permitted
242245
# <vm> qemu-system-x86_64: -netdev bridge,id=net0,br=bridge43: bridge helper failed
243246
unsandbox_list=(
244-
"./test/net/integration/configure"
245-
"./test/net/integration/icmp"
246-
"./test/net/integration/icmp6"
247-
"./test/net/integration/slaac"
248-
"./test/net/integration/tcp"
249-
"./test/net/integration/udp"
250-
"./test/net/integration/dns" # except this one which times out instead
247+
"${INTEGRATION_TESTS}/net/configure"
248+
"${INTEGRATION_TESTS}/net/icmp"
249+
"${INTEGRATION_TESTS}/net/icmp6"
250+
"${INTEGRATION_TESTS}/net/slaac"
251+
"${INTEGRATION_TESTS}/net/tcp"
252+
"${INTEGRATION_TESTS}/net/udp"
253+
"${INTEGRATION_TESTS}/net/dns" # except this one which times out instead
251254
)
252-
run_testsuite "./test/net/integration" "${exclusions[@]}"
255+
run_testsuite "${INTEGRATION_TESTS}/net" "${exclusions[@]}"
253256
unsandbox_list=()
254257

255258
echo -e "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"

0 commit comments

Comments
 (0)