This repository was archived by the owner on Jun 28, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +41
-25
lines changed
popular_docker_hub_images Expand file tree Collapse file tree 8 files changed +41
-25
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,15 @@ set -e
1010SCRIPT_PATH=$( dirname " $( readlink -f " $0 " ) " )
1111source " ${SCRIPT_PATH} /../../.ci/lib.sh"
1212source " ${SCRIPT_PATH} /crio_skip_tests.sh"
13+ source " ${SCRIPT_PATH} /../../metrics/lib/common.bash"
1314source /etc/os-release || source /usr/lib/os-release
1415
1516crio_repository=" github.com/kubernetes-incubator/cri-o"
1617crio_repository_path=" $GOPATH /src/${crio_repository} "
1718
19+ # Check no processes are left behind
20+ check_processes
21+
1822# devicemapper device and options
1923LVM_DEVICE=${LVM_DEVICE:-/ dev/ vdb}
2024DM_STORAGE_OPTIONS=" --storage-driver devicemapper --storage-opt dm.directlvm_device=${LVM_DEVICE}
Original file line number Diff line number Diff line change 55# SPDX-License-Identifier: Apache-2.0
66#
77
8+ SCRIPT_PATH=$( dirname " $( readlink -f " $0 " ) " )
9+ source " ${SCRIPT_PATH} /../../metrics/lib/common.bash"
10+
811export KUBECONFIG=/etc/kubernetes/admin.conf
912sudo -E kubeadm reset --cri-socket=/var/run/crio/crio.sock
1013
@@ -26,3 +29,6 @@ sudo ip link set dev cni0 down
2629sudo ip link set dev flannel.1 down
2730sudo ip link del cni0
2831sudo ip link del flannel.1
32+
33+ # Check no processes are left behind
34+ check_processes
Original file line number Diff line number Diff line change 99
1010SCRIPT_PATH=$( dirname " $( readlink -f " $0 " ) " )
1111source " ${SCRIPT_PATH} /../../.ci/lib.sh"
12+ source " ${SCRIPT_PATH} /../../metrics/lib/common.bash"
13+
14+ # Check no processes are left behind
15+ check_processes
1216
1317# The next workaround is to be able to communicate between pods
1418# Issue: https://github.com/kubernetes/kubernetes/issues/40182
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ set -e
1010SCRIPT_PATH=$( dirname " $( readlink -f " $0 " ) " )
1111source " ${SCRIPT_PATH} /openshiftrc"
1212source " ${SCRIPT_PATH} /../../.ci/lib.sh"
13+ source " ${SCRIPT_PATH} /../../metrics/lib/common.bash"
14+
15+ # Check no processes are left behind
16+ check_processes
1317
1418echo " Start crio service"
1519sudo systemctl start crio
Original file line number Diff line number Diff line change 99
1010SCRIPT_PATH=$( dirname " $( readlink -f " $0 " ) " )
1111source " ${SCRIPT_PATH} /openshiftrc"
12+ source " ${SCRIPT_PATH} /../../metrics/lib/common.bash"
1213
1314echo " Terminate Openshift master and node processes"
1415pgrep openshift | xargs sudo kill -9
1516
1617echo " Stop cri-o service"
1718sudo systemctl stop crio
19+
20+ # Check no processes are left behind
21+ check_processes
Original file line number Diff line number Diff line change 1010source ${BATS_TEST_DIRNAME} /../../metrics/lib/common.bash
1111
1212setup () {
13+ # Check that processes are not running
14+ run check_processes
15+ echo " $output "
16+ [ " $status " -eq 0 ]
1317 clean_env
1418}
1519
@@ -372,4 +376,8 @@ setup() {
372376
373377teardown () {
374378 clean_env
379+ # Check that processes are not running
380+ run check_processes
381+ echo " $output "
382+ [ " $status " -eq 0 ]
375383}
Original file line number Diff line number Diff line change @@ -23,13 +23,8 @@ number_of_retries=5
2323
2424setup () {
2525 # Check that processes are not running
26- run check_processes ${PROXY_PATH}
27- [ " $status " -eq 0 ]
28-
29- run check_processes ${SHIM_PATH}
30- [ " $status " -eq 0 ]
31-
32- run check_processes ${HYPERVISOR_PATH}
26+ run check_processes
27+ echo " $output "
3328 [ " $status " -eq 0 ]
3429
3530 interfaces=$( basename -a /sys/class/net/* )
@@ -69,13 +64,8 @@ teardown() {
6964 docker service remove " ${SERVICE_NAME} "
7065 docker swarm leave --force
7166
72- # Check that processes are not left by Swarm
73- run check_processes ${PROXY_PATH}
74- [ " $status " -eq 0 ]
75-
76- run check_processes ${SHIM_PATH}
77- [ " $status " -eq 0 ]
78-
79- run check_processes ${HYPERVISOR_PATH}
67+ # Check that processes are not running
68+ run check_processes
69+ echo " $output "
8070 [ " $status " -eq 0 ]
8171}
Original file line number Diff line number Diff line change @@ -246,16 +246,12 @@ kill_processes_before_start() {
246246# Normally used to look for errant processes, and hence prints
247247# a warning
248248check_processes () {
249- process=$1
250-
251- [[ -z " ${process} " ]] && return 0
252-
253- pgrep -f " $process "
254- if [ $? -eq 0 ]; then
255- warning " Found unexpected ${process} present"
256- ps -ef | grep $process
257- return 1
258- fi
249+ general_processes=( ${PROXY_PATH} ${HYPERVISOR_PATH} ${SHIM_PATH} )
250+ for i in " ${general_processes[@]} " ; do
251+ if pgrep -f " $i " ; then
252+ die " Found unexpected ${i} present"
253+ fi
254+ done
259255}
260256
261257# Generate a random name - generally used when creating containers, but can
You can’t perform that action at this time.
0 commit comments