This repository has been archived by the owner on Oct 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
run-test.sh
executable file
·138 lines (127 loc) · 4.03 KB
/
run-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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
###########################################################################
# @licence app begin@
# SPDX-License-Identifier: MPL-2.0
#
# Component Name: Positioning poC
# Author: Marco Residori
#
# Copyright (C) 2013, XS Embedded GmbH
#
# License:
# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# @licence end@
###########################################################################
TOP_SRC_DIR=$PWD
TOP_BIN_DIR=$PWD/build
GNSS_SERVICE_BIN_DIR=$TOP_BIN_DIR/gnss-service
SENSORS_SERVICE_BIN_DIR=$TOP_BIN_DIR/sensors-service
ENHANCED_POSITION_SERVICE_DBUS_BIN_DIR=$TOP_BIN_DIR/enhanced-position-service/dbus
ENHANCED_POSITION_SERVICE_FRANCA_BIN_DIR=$TOP_BIN_DIR/enhanced-position-service/franca
LOG_REPLAYER_BIN_DIR=$TOP_BIN_DIR/log-replayer
LOG_REPLAYER_LOGS_DIR=$TOP_BIN_DIR/log-replayer/logs
usage() {
echo "Usage: ./run-test.sh [service]"
echo
echo "service:"
echo " gnss Test GNSSService"
echo " sns Test SensorsService"
echo " enhpos Test EnhancedPositionService"
echo " repl Test LogReplayer"
echo " kill Kill all test applications"
echo " help Print Help"
echo
}
testGnssService()
{
$GNSS_SERVICE_BIN_DIR/test/gnss-service-client &
sleep 3
echo 'Starting log replayer...'
$LOG_REPLAYER_BIN_DIR/src/log-replayer $LOG_REPLAYER_LOGS_DIR/20100411_Geko_Regensburg_short.log > /dev/null 2>&1 &
sleep 10
echo 'Stopping test...'
killall log-replayer
killall gnss-service-client
}
testSensorsService()
{
$SENSORS_SERVICE_BIN_DIR/test/sensors-service-client &
sleep 3
echo 'Starting log replayer...'
$LOG_REPLAYER_BIN_DIR/src/log-replayer $LOG_REPLAYER_LOGS_DIR/20100411_Geko_Regensburg_short.log > /dev/null 2>&1 &
sleep 10
echo 'Stopping test...'
killall log-replayer
killall sensors-service-client
}
testEnhancedPositionService()
{
$ENHANCED_POSITION_SERVICE_DBUS_BIN_DIR/src/enhanced-position-service > /dev/null 2>&1 &
sleep 3
$ENHANCED_POSITION_SERVICE_DBUS_BIN_DIR/test/enhanced-position-client &
sleep 3
echo 'Starting log replayer...'
$LOG_REPLAYER_BIN_DIR/src/log-replayer $LOG_REPLAYER_LOGS_DIR/geneve-cologny.log > /dev/null 2>&1 &
sleep 20
echo 'Stopping test...'
killall enhanced-position-client
killall enhanced-position-service
killall log-replayer
}
testEnhancedPositionService2()
{
echo 'Starting enhanced position service...'
$LOG_REPLAYER_BIN_DIR/src/log-replayer $LOG_REPLAYER_LOGS_DIR/geneve-cologny.log > /dev/null 2>&1 &
echo 'Starting log replayer...'
$ENHANCED_POSITION_SERVICE_DBUS_BIN_DIR/src/enhanced-position-service &
sleep 1000
echo 'Stopping test...'
killall enhanced-position-service
killall log-replayer
}
testLogReplayer()
{
echo 'Starting log replayer...'
$LOG_REPLAYER_BIN_DIR/src/log-replayer $LOG_REPLAYER_LOGS_DIR/geneve-cologny.log > /dev/null 2>&1 &
#$LOG_REPLAYER_LOGS_DIR/src/log-replayer $LOG_REPLAYER_LOGS_DIR/20100411_Geko_Regensburg_short.log > /dev/null 2>&1 &
sleep 1
echo 'Starting test application...'
$LOG_REPLAYER_BIN_DIR/test/test-log-replayer 9930 &
sleep 10
echo 'Stopping test...'
killall log-replayer
killall test-log-replayer
}
killAllTests()
{
killall gnss-service-client
killall sensors-service-client
killall enhanced-position-client
killall enhanced-position-service
killall test-log-replayer
killall log-replayer
}
if [ $# -eq 1 ]; then
if [ $1 = help ]; then
usage
elif [ $1 = gnss ]; then
testGnssService
elif [ $1 = sns ]; then
testSensorsService
elif [ $1 = enhpos ]; then
testEnhancedPositionService
elif [ $1 = enhpos2 ]; then
testEnhancedPositionService2
elif [ $1 = repl ]; then
testLogReplayer
elif [ $1 = kill ]; then
killAllTests
else
usage
fi
else
usage
fi