summaryrefslogtreecommitdiffstats
path: root/scripts/qemuimage-tests/tools/connman_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/qemuimage-tests/tools/connman_test.sh')
-rw-r--r--scripts/qemuimage-tests/tools/connman_test.sh75
1 files changed, 0 insertions, 75 deletions
diff --git a/scripts/qemuimage-tests/tools/connman_test.sh b/scripts/qemuimage-tests/tools/connman_test.sh
deleted file mode 100644
index 4c1e2f558e..0000000000
--- a/scripts/qemuimage-tests/tools/connman_test.sh
+++ /dev/null
@@ -1,75 +0,0 @@
1#!/bin/bash
2# connman test script running in target
3#
4# Author: Jiajun Xu <jiajun.xu@intel.com>
5#
6# This file is licensed under the GNU General Public License,
7# Version 2.
8#
9
10Target_Info()
11{
12 echo -e "\tTARGET: $*"
13}
14
15Target_Err()
16{
17 echo -e "\tTARGET: connman has issue when running, Pls. check the error log"
18 echo -e "\tTARGET: ##### Error Log #####"
19 $1
20 echo -e "\tTARGET: ##### End #####"
21}
22
23# Check if ps comes from Procps or busybox first
24ls -l `which ps` | grep -q "busybox"
25RET=$?
26
27if [ $RET -eq 0 ]; then
28 PS="ps"
29else
30 PS="ps -ef"
31fi
32
33# Check if connmand is in target
34if [ ! -f /usr/sbin/connmand ]; then
35 Target_Info "No connmand command found"
36 exit 1
37fi
38
39# Check if connmand is running in background
40if [ $RET -eq 0 ]; then
41 count=`ps | awk '{print $5}' | grep -c connmand`
42else
43 count=`ps -eo comm | cut -d " " -f 1 | grep -c connmand`
44fi
45
46if [ $count -ne 1 ]; then
47 Target_Info "connmand has issue when running in background, Pls, check the output of ps"
48 ${PS}
49 exit 1
50fi
51
52# Check if there is always only one connmand running in background
53if [ connmand > /dev/null 2>&1 ]; then
54 Target_Info "connmand command run without problem"
55
56 if [ $RET -eq 0 ]; then
57 count=`ps | awk '{print $5}' | grep -c connmand`
58 else
59 count=`ps -eo comm | cut -d " " -f 1 | grep -c connmand`
60 fi
61
62 if [ $count -ne 1 ]; then
63 Target_Info "There are more than one connmand running in background, Pls, check the output of ps"
64 ${PS} | grep connmand
65 exit 1
66 else
67 Target_Info "There is always one connmand running in background, test pass"
68 exit 0
69 fi
70else
71 Target_Err connmand
72 exit 1
73fi
74
75exit 0