summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/update/templates/rm_olds.sh
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-10-18 17:30:31 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-10-18 17:30:31 +0800
commitd30f7afdd2d39302174a788e9e008feb61b25596 (patch)
treeeed10dd17021d0f4ee87fb90089dab6eed5b5071 /utils/test/testapi/update/templates/rm_olds.sh
parent307a8f07e8c17800ed1214394a3aacf02045a03a (diff)
rename result_collection_api to testapi
Change-Id: Iec4e3db23cd44f30831e17c127eda74e9d9b5d14 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/update/templates/rm_olds.sh')
-rw-r--r--utils/test/testapi/update/templates/rm_olds.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/test/testapi/update/templates/rm_olds.sh b/utils/test/testapi/update/templates/rm_olds.sh
new file mode 100644
index 000000000..c6bca1867
--- /dev/null
+++ b/utils/test/testapi/update/templates/rm_olds.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+proc_number=`ps -ef | grep opnfv-testapi | grep -v grep | wc -l`
+if [ $proc_number -gt 0 ]; then
+ procs=`ps -ef | grep opnfv-testapi | grep -v grep`
+ echo "begin to kill opnfv-testapi $procs"
+ ps -ef | grep opnfv-testapi | grep -v grep | awk '{print $2}' | xargs kill -kill &>/dev/null
+fi
+
+number=`docker ps -a | awk 'NR != 1' | grep testapi | wc -l`
+if [ $number -gt 0 ]; then
+ containers=number=`docker ps -a | awk 'NR != 1' | grep testapi`
+ echo "begin to rm containers $containers"
+ docker ps -a | awk 'NR != 1' | grep testapi | awk '{print $1}' | xargs docker rm -f &>/dev/null
+fi