• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright (C) 2015-2018 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
3# This Source Code Form is subject to the terms of the Mozilla Public
4# License, v. 2.0. If a copy of the MPL was not distributed with this
5# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7# Purpose: This script is needed to start the services with
8# one command. This is necessary as ctest - which is used to run the
9# tests - isn't able to start multiple binaries for one testcase. Therefore
10# the testcase simply executes this script. This script then runs the services
11# and checks that all exit successfully.
12
13if [ $# -lt 1 ]
14then
15    echo "Please pass a json file to this script"
16    echo "For example: $0 e2e_test_service_external.json"
17    exit 1
18fi
19
20FAIL=0
21
22export VSOMEIP_CONFIGURATION=$1
23export VSOMEIP_APPLICATION_NAME=service-sample
24./e2e_test_service --remote &
25PID_SERVICE=$!
26
27# Wait until client and service are finished
28for client_pid in "${PID_SERVICE}"
29do
30    if [ -n "$client_pid" ]; then
31        # Fail gets incremented if either client or service exit
32        # with a non-zero exit code
33        wait "$client_pid" || ((FAIL+=1))
34    fi
35done
36
37kill $PID_SERVICE
38
39# Check if both exited successfully
40if [ $FAIL -eq 0 ]
41then
42    exit 0
43else
44    exit 1
45fi
46