forked from stratis-storage/ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunalltests.sh
More file actions
executable file
·77 lines (63 loc) · 1.8 KB
/
runalltests.sh
File metadata and controls
executable file
·77 lines (63 loc) · 1.8 KB
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
#!/bin/bash
# Run all tests from the Stratis CI test suite
# Current distro: Fedora (29)
PRESTAGE=`pwd`
./dependencies_fedora.sh
# The instructions for rustup say to run "curl https://sh.rustup.rs -sSf | sh".
# The resulting script has an interactive prompt, which would hang.
# Instead, download it to a shell script, and execute with the "-y" switch
# to automatically install.
curl -o install_rustup.sh https://sh.rustup.rs
chmod +x install_rustup.sh
./install_rustup.sh -y
source $HOME/.cargo/env
rustup default 1.49.0
# Then, choose the directory of the test to be executed, and prep
# the $WORKSPACE environment variable.
# cd stratisd
# export WORKSPACE="/root/workspace/stratisd"
mkdir workspace
cd workspace
if [ -s "/etc/stratis/test_config.json" ]
then
STRATISD_MODE="test-real"
else
STRATISD_MODE="test-loop"
fi
echo "Executing stratisd test ($STRATISD_MODE)"
git clone https://github.com/stratis-storage/stratisd.git
cd stratisd
export WORKSPACE=`pwd`
$PRESTAGE/stratisd.sh $STRATISD_MODE
RC_STRATISD=$?
echo "Completed stratisd test ($STRATISD_MODE): status $RC_STRATISD"
echo "Executing stratisd_nonrust test..."
$PRESTAGE/stratisd_nonrust.sh
RC_STRATISD_NONRUST=$?
echo "Completed stratisd_nonrust test: status $RC_STRATISD_NONRUST"
cd $PRESTAGE/workspace
echo "Executing stratis-cli test..."
git clone https://github.com/stratis-storage/stratis-cli
cd stratis-cli
export WORKSPACE=`pwd`
$PRESTAGE/cli.sh
RC_STRATISCLI=$?
echo "Completed stratis-cli test: status $RC_STRATISCLI"
cd $PRESTAGE/workspace
echo "End of prestage script."
echo "Results:"
echo "stratisd-$STRATISD_MODE: $RC_STRATISD"
echo "stratisd_nonrust: $RC_STRATISD_NONRUST"
echo "stratis-cli: $RC_STRATISCLI"
if [ $RC_STRATISD -gt 0 ]
then
exit 1
fi
if [ $RC_STRATISCLI -gt 0 ]
then
exit 2
fi
if [ $RC_STRATISD_NONRUST -gt 0 ]
then
exit 4
fi