-
Notifications
You must be signed in to change notification settings - Fork 2
/
intergration-test.sh
executable file
·51 lines (29 loc) · 1.04 KB
/
intergration-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
#!/bin/bash
is_local=0
echo $OSC_ENDPOINT_API | grep 127.0.0.1 > /dev/null
if [ $? -eq 0 ]; then
./ricochet_preparation
is_local=1
fi
set -eE
MSG_BASE="Test Example"
trap "echo [$MSG_BASE 0 FAIL]" ERR
out=$( ./example0 | grep -v '==' | jq )
[ $( echo "$out" | jq -r .Images[0].AccountAlias | grep -v null ) == "Outscale" ]
echo "[$MSG_BASE 0 OK]"
trap "echo [$MSG_BASE 1 FAIL]" ERR
./example1 | jq .Images[0].ImageName | grep Arch > /dev/null
echo "[$MSG_BASE 1 OK]"
# Yes example 3 is run before 2, because 3, create a VM, and 2 is used to destroy it
trap "echo [$MSG_BASE 3 FAIL]" ERR
./example3 -n 'test-example-3' -Y
echo "[$MSG_BASE 3 OK]"
trap "echo [$MSG_BASE 2 FAIL]" ERR
./example2 test-example-3 READ_ID &> /dev/null
./example2 test-example-3 TERMINATE_VM 'Fire ! Fire ! Fire !' &> /dev/null
echo "[$MSG_BASE 2 OK]"
MSG_BASE="Test C++ Example"
trap "echo [$MSG_BASE A FAIL]" ERR
out=$( ./example0 | grep -v '==' | jq )
[ $( echo "$out" | jq -r .Images[0].AccountAlias | grep -v null ) == "Outscale" ]
echo "[$MSG_BASE A OK]"