-
Notifications
You must be signed in to change notification settings - Fork 0
/
consistent-versions-test.sh
83 lines (62 loc) · 2.93 KB
/
consistent-versions-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
#!/bin/env bash
XENON_VERSION=3.0.4
XENON_CLI_VERSION=3.0.4
XENON_ADAPTORS_CLOUD_VERSION=3.0.2
VERBOSE=1
test () {
if [ "$VERBOSE" -eq 1 ]
then
echo "actual = $actual"
echo "expected = $expected"
echo
fi
if [ "$actual" == "$expected" ]; then
# good
return 0
else
# bad
return 1
fi
}
echo "checking .travis.yml"
actual=$(head --lines=+14 .travis.yml | tail --lines=1)
expected=" - \"wget https://github.com/xenon-middleware/xenon-cli/releases/download/v$XENON_CLI_VERSION/xenon-cli-shadow-$XENON_CLI_VERSION.tar\""
test $actual $expected || exit 1
actual=$(head --lines=+15 .travis.yml | tail --lines=1)
expected=" - \"tar -xvf xenon-cli-shadow-$XENON_CLI_VERSION.tar\""
test $actual $expected || exit 1
actual=$(head --lines=+17 .travis.yml | tail --lines=1)
expected=" - \"mv xenon-cli-shadow-$XENON_CLI_VERSION /home/travis/.local/bin/xenon/\""
test $actual $expected || exit 1
actual=$(head --lines=+20 .travis.yml | tail --lines=1)
expected=" - \"echo 'PATH=\$PATH:/home/travis/.local/bin/xenon/xenon-cli-shadow-$XENON_CLI_VERSION/bin' >> /home/travis/.bashrc\""
test $actual $expected || exit 1
echo "checking readthedocs/code-tabs/java/build.gradle"
actual=$(head --lines=+12 readthedocs/code-tabs/java/build.gradle | tail --lines=1)
expected=" implementation 'nl.esciencecenter.xenon:xenon:$XENON_VERSION'"
test $actual $expected || exit 1
actual=$(head --lines=+13 readthedocs/code-tabs/java/build.gradle | tail --lines=1)
expected=" implementation 'nl.esciencecenter.xenon.adaptors:xenon-adaptors-cloud:$XENON_ADAPTORS_CLOUD_VERSION'"
test $actual $expected || exit 1
echo "checking readthedocs/tutorial.rst"
actual=$(head --lines=+38 readthedocs/tutorial.rst | tail --lines=1)
expected=" Xenon CLI v$XENON_CLI_VERSION, Xenon library v$XENON_VERSION, Xenon cloud library v$XENON_ADAPTORS_CLOUD_VERSION"
test $actual $expected || exit 1
actual=$(head --lines=+640 readthedocs/tutorial.rst | tail --lines=1)
expected="__ http://xenon-middleware.github.io/xenon/versions/$XENON_VERSION/javadoc"
test $actual $expected || exit 1
echo "checking vm-prep/README.md"
actual=$(head --lines=+126 vm-prep/README.md | tail --lines=1)
expected=" wget https://github.com/xenon-middleware/xenon-cli/releases/download/v$XENON_CLI_VERSION/xenon-cli-shadow-$XENON_CLI_VERSION.tar"
test $actual $expected || exit 1
actual=$(head --lines=+127 vm-prep/README.md | tail --lines=1)
expected=" tar -xvf xenon-cli-shadow-$XENON_CLI_VERSION.tar"
test $actual $expected || exit 1
actual=$(head --lines=+129 vm-prep/README.md | tail --lines=1)
expected=" mv xenon-cli-shadow-$XENON_CLI_VERSION ~/.local/bin/xenon/"
test $actual $expected || exit 1
actual=$(head --lines=+133 vm-prep/README.md | tail --lines=1)
expected=" echo 'PATH=\$PATH:~/.local/bin/xenon/xenon-cli-shadow-$XENON_CLI_VERSION/bin' >> ~/.bashrc"
test $actual $expected || exit 1
echo 'all passed'
exit 0