1ce56276a6a80c26ead30103a9bbe1b79390a4e3
[ric-plt/lib/rmr.git] / test / app_test / run_all.ksh
1 #!/usr/bin/env ksh
2 # vim: ts=4 sw=4 noet :
3 #==================================================================================
4 #    Copyright (c) 2019 Nokia
5 #    Copyright (c) 2018-2019 AT&T Intellectual Property.
6 #
7 #   Licensed under the Apache License, Version 2.0 (the "License");
8 #   you may not use this file except in compliance with the License.
9 #   You may obtain a copy of the License at
10 #
11 #       http://www.apache.org/licenses/LICENSE-2.0
12 #
13 #   Unless required by applicable law or agreed to in writing, software
14 #   distributed under the License is distributed on an "AS IS" BASIS,
15 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 #   See the License for the specific language governing permissions and
17 #   limitations under the License.
18 #==================================================================================
19 #
20
21 # run all of the tests, building rmr before the first one if -B is on the command line.
22
23 function run_test {
24         if [[ -n $capture_file ]]
25         then
26                 if ! ksh $@ >>$capture_file 2>&1
27                 then
28                         echo "[FAIL] test failed; see $capture_file"
29                         (( errors++ ))
30                 fi
31         else
32                 if ! ksh $@
33                 then
34                         (( errors++ ))
35                 fi
36         fi
37 }
38
39 build=""
40 errors=0
41
42 while [[ $1 == "-"* ]]
43 do
44         case $1 in
45                 -B)     build="-B";;
46                 -e)     capture_file=$2; >$capture_file; shift;;
47                 -i)     installed="-i";;
48
49                 *)      echo "'$1' is not a recognised option and is ignored";;
50         esac
51
52         shift
53 done
54
55 echo "----- app --------------------"
56 run_test run_app_test.ksh -v $installed $build
57
58 echo "----- multi ------------------"
59 run_test run_multi_test.ksh
60
61 echo "----- round robin -----------"
62 run_test run_rr_test.ksh
63
64 echo "----- rts -------------------"
65 run_test run_rts_test.ksh -s 5 -d 100
66
67 echo "----- extended payload ------"
68 run_test run_exrts_test.ksh -d 10 -n 1000
69
70 if (( errors == 0 ))
71 then
72         echo "[PASS] all test pass"
73 else
74         echo "[FAIL] one or more application to application tests failed"
75 fi
76
77 exit $(( !! errors ))