From d30f7afdd2d39302174a788e9e008feb61b25596 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Tue, 18 Oct 2016 17:30:31 +0800 Subject: rename result_collection_api to testapi Change-Id: Iec4e3db23cd44f30831e17c127eda74e9d9b5d14 Signed-off-by: SerenaFeng --- utils/test/testapi/update/templates/rm_olds.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 utils/test/testapi/update/templates/rm_olds.sh (limited to 'utils/test/testapi/update/templates/rm_olds.sh') 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 -- cgit 1.2.3-korg