lava: Use safe loads for YAML
[lttng-ci.git] / scripts / system-tests / run-test-suites.sh
CommitLineData
cf1271bb
JR
1#!/bin/bash -xeu
2#
3# Copyright (C) 2021 - Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18# Version compare functions
19vercomp () {
20 set +u
21 if [[ "$1" == "$2" ]]; then
22 return 0
23 fi
24 local IFS=.
25 local i ver1=($1) ver2=($2)
26 # fill empty fields in ver1 with zeros
27 for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do
28 ver1[i]=0
29 done
30 for ((i=0; i<${#ver1[@]}; i++)); do
31 if [[ -z ${ver2[i]} ]]; then
32 # fill empty fields in ver2 with zeros
33 ver2[i]=0
34 fi
35 if ((10#${ver1[i]} > 10#${ver2[i]})); then
36 return 1
37 fi
38 if ((10#${ver1[i]} < 10#${ver2[i]})); then
39 return 2
40 fi
41 done
42 set -u
43 return 0
44}
45
46verlte() {
47 vercomp "$1" "$2"; local res="$?"
48 [ "$res" -eq "0" ] || [ "$res" -eq "2" ]
49}
50
51verlt() {
52 vercomp "$1" "$2"; local res="$?"
53 [ "$res" -eq "2" ]
54}
55
56vergte() {
57 vercomp "$1" "$2"; local res="$?"
58 [ "$res" -eq "0" ] || [ "$res" -eq "1" ]
59}
60
61vergt() {
62 vercomp "$1" "$2"; local res="$?"
63 [ "$res" -eq "1" ]
64}
65
66verne() {
67 vercomp "$1" "$2"; local res="$?"
68 [ "$res" -ne "0" ]
69}
70
71lttng_version="$1"
72failed_tests=0
73
bb5dc121
JR
74export LTTNG_ENABLE_DESTRUCTIVE_TESTS="will-break-my-system"
75
76make --keep-going check || failed_tests=1
77
78if [ -f "./tests/root_regression" ]; then
bf55e3f4
KS
79 cd "./tests" || exit 1
80 prove --nocolor --verbose --merge --exec '' - < root_regression || failed_tests=1
81 cd ..
cf1271bb
JR
82fi
83
bf55e3f4
KS
84# This script doesn't exist in master anymore, but compatibility with old branches
85# should be retained until lttng-tools 2.13 is no longer supported
86if [ -f "./tests/root_destructive_tests" ]; then
87 cd "./tests" || exit 1
88 prove --nocolor --verbose --merge --exec '' - < root_destructive_tests || failed_tests=2
89 cd ..
90else
91 echo 'root_destructive_tests not found'
92fi
cf1271bb 93
bf55e3f4 94exit $failed_tests
This page took 0.029827 seconds and 4 git commands to generate.