forked from firesim/FireMarshal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
full_test.sh
executable file
·85 lines (76 loc) · 2.45 KB
/
full_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
# Enable extended globbing
shopt -s extglob
SUITE_PASS=true
LOGNAME=$(mktemp results_full_test.XXXX)
echo "Running Full Test. Results available in $LOGNAME"
echo "Running launch timeout test (should timeout):" | tee -a $LOGNAME
echo "This test will reset your terminal"
./marshal test test/timeout-run.json | grep "timeout while running"
res=$?
reset
echo "Ran launch timeout test (screen was reset)"
if [ $res != 0 ]; then
echo "Failure" | tee -a $LOGNAME
SUITE_PASS=false
else
echo "Success" | tee -a $LOGNAME
fi
echo "Running build timeout test (should timeout):" | tee -a $LOGNAME
./marshal test test/timeout-build.json | grep "timeout while building"
if [ $? != 0 ]; then
echo "Failure" | tee -a $LOGNAME
SUITE_PASS=false
else
echo "Success" | tee -a $LOGNAME
fi
# Run the specialized tests (tests that are too complicated for ./marshal
# test)
echo "Running clean test" | tee -a $LOGNAME
./test/clean/test.py >> $LOGNAME
if [ $? != 0 ]; then
echo "Failure" | tee -a $LOGNAME
SUITE_PASS=false
fi
echo "Running incremental test" | tee -a $LOGNAME
./test/incremental/test.py >> $LOGNAME
if [ $? != 0 ]; then
echo "Failure" | tee -a $LOGNAME
SUITE_PASS=false
exit 1
fi
# Run the bulk tests (all work with the 'test' command)
# Note the funny extended globbing, these are just lists of tests that
# shouldn't be tested (e.g. we exclude the base configs and some specialized
# tests)
echo "Running regular tests" | tee -a $LOGNAME
BULK_EXCLUDE="(br-base|fedora-base|incremental|clean|timeout-build|timeout-run)"
./marshal clean test/!$BULK_EXCLUDE.json | tee -a $LOGNAME
./marshal test test/!$BULK_EXCLUDE.json | tee -a $LOGNAME
if [ $? != 0 ]; then
echo "Failure" | tee -a $LOGNAME
SUITE_PASS=false
else
echo "Success" | tee -a $LOGNAME
fi
# Run the initramfs versions on spike, initramfs runs have many restrictions,
# we only run a few tests here to test basic capabilities
echo "Running initramfs capable tests on spike" | tee -a $LOGNAME
IS_INCLUDE="@(command|flist|host-init|jobs|linux-src|overlay|post-run-hook|run|smoke0)"
# ls test/$IS_INCLUDE.json
# exit 0
./marshal -i clean test/$IS_INCLUDE.json | tee -a $LOGNAME
./marshal -i test -s test/$IS_INCLUDE.json | tee -a $LOGNAME
if [ $? != 0 ]; then
echo "Failure" | tee -a $LOGNAME
SUITE_PASS=false
else
echo "Success" | tee -a $LOGNAME
fi
if [ $SUITE_PASS = false ]; then
echo "Some tests failed" | tee -a $LOGNAME
exit 1
else
echo "Full Test Success" | tee -a $LOGNAME
exit 0
fi