forked from stratis-storage/ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstratisd_nonrust.sh
executable file
·97 lines (78 loc) · 2.55 KB
/
stratisd_nonrust.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
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
set -e
export PATH="$HOME/.cargo/bin:$PATH"
export STRATIS_DEPS_DIR=$WORKSPACE/stratis-deps
export RUST_LOG=libstratis=debug,stratisd=debug
# Set WORKSPACE to the top level directory that contains the stratisd git repo
if [ -z $WORKSPACE ]
then
echo "Required WORKSPACE variable not set. Set WORKSPACE to directory that contains"
echo "stratisd git repo."
exit 1
fi
if [ ! -d $WORKSPACE/tests/ ]
then
echo "$WORKSPACE/tests/ does not exist. Verify WORKSPACE is set to correct directory."
exit 1
fi
cd $WORKSPACE
rustup default 1.49.0
make clean
cargo clean
# Make a build in order to run test outside the Rust framework
make install PROFILEDIR=debug
make clean-primary
# If there is a stale STRATIS_DEPS_DIR remove it
if [ -d $STRATIS_DEPS_DIR ]
then
rm -rf $STRATIS_DEPS_DIR
fi
if [ ! -d $WORKSPACE/tests/client-dbus ]
then
echo "client-dbus directory does not exist: $WORKSPACE/tests/client-dbus"
exit 1
fi
echo "Running client-dbus tests"
export STRATISD=$WORKSPACE/target/debug/stratisd
if [ ! -x $STRATISD ]
then
echo "Required $STRATISD not found or not executable"
exit 1
fi
export STRATIS_PREDICT_USAGE=/usr/bin/stratis-predict-usage
if [ ! -x $STRATIS_PREDICT_USAGE ]
then
echo "Required $STRATIS_PREDICT_USAGE not found or not executable"
exit 1
fi
export STRATISD_MIN=$WORKSPACE/target/debug/stratisd-min
if [ ! -x $STRATISD_MIN ]
then
echo "Required $STRATISD_MIN not found or not executable"
exit 1
fi
export STRATIS_MIN=$WORKSPACE/target/debug/stratis-min
if [ ! -x $STRATIS_MIN ]
then
echo "Required $STRATIS_MIN not found or not executable"
exit 1
fi
mkdir $STRATIS_DEPS_DIR
cd $STRATIS_DEPS_DIR
# Clone the python dependencies
git clone https://github.com/stratis-storage/dbus-python-client-gen.git
git clone https://github.com/stratis-storage/dbus-client-gen.git
git clone https://github.com/stratis-storage/into-dbus-python.git
git clone https://github.com/stratis-storage/dbus-signature-pyparsing.git
for STRATIS_DEP in dbus-client-gen dbus-signature-pyparsing dbus-python-client-gen into-dbus-python
do
cd $STRATIS_DEPS_DIR/$STRATIS_DEP
git fetch --tags
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "checking out $STRATIS_DEP $LATEST_TAG"
git checkout $LATEST_TAG
done
# Set the PYTHONPATH to use the dependencies
export PYTHONPATH=src:$STRATIS_DEPS_DIR/dbus-client-gen/src:$STRATIS_DEPS_DIR/dbus-python-client-gen/src:$STRATIS_DEPS_DIR/into-dbus-python/src:$STRATIS_DEPS_DIR/dbus-signature-pyparsing/src
cd $WORKSPACE/tests/client-dbus
make tests