public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] tests: check /proc availability, and go-around if it is incomplete
@ 2014-05-11 19:26 Sami Kerola
  2014-05-11 19:26 ` [PATCH 02/12] cytune: remove from util-linux Sami Kerola
                   ` (12 more replies)
  0 siblings, 13 replies; 21+ messages in thread
From: Sami Kerola @ 2014-05-11 19:26 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa, Ruediger Meier

Unavailability of /proc is fatal for kill, and continuing with the test
in that case does not make sense as it will only mean false positive
errors.

Where /proc/<pid>/status file(s) does not exist the check will perform
opportunistic sleep with assumption the test_sigreceive will be ready to
be killed if it has some time to init.

CC: Ruediger Meier <sweet_f_a@gmx.de>
Reference: https://travis-ci.org/rudimeier/util-linux/jobs/24561058
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 tests/ts/kill/kill_functions.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/ts/kill/kill_functions.sh b/tests/ts/kill/kill_functions.sh
index 73fff05..a2a2483 100644
--- a/tests/ts/kill/kill_functions.sh
+++ b/tests/ts/kill/kill_functions.sh
@@ -1,3 +1,5 @@
+# kill tests, or command, will not when /proc is missing.
+test /proc || ts_skip "/proc not available"
 
 # unfortunately we are using gawk features
 type gawk >/dev/null 2>&1 || ts_skip "cannot find gawk"
@@ -8,6 +10,17 @@ function check_test_sigreceive {
 	local pid=$1
 
 	for i in 0.01 0.1 1 1 1 1; do
+		if [ ! -f /proc/$pid/status ]; then
+			# The /proc exists, but not status file. Because
+			# the process already started it is unlikely the
+			# file would appear after any amount of waiting.
+			# Try to sleep for moment and hopefully
+			# test_sigreceive is ready to be killed.
+			echo "kill_functions.sh: /proc/$pid/status: No such file or directory"
+			sleep 2
+			rc=1
+			break
+		fi
 		gawk 'BEGIN { retval=1 }
 		/^SigCgt/ {
 			lbyte = strtonum("0x" substr($2, 16, 16))
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-05-12 14:53 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-11 19:26 [PATCH 01/12] tests: check /proc availability, and go-around if it is incomplete Sami Kerola
2014-05-11 19:26 ` [PATCH 02/12] cytune: remove from util-linux Sami Kerola
2014-05-12 12:11   ` Karel Zak
2014-05-11 19:26 ` [PATCH 03/12] blkid: remove unused variable Sami Kerola
2014-05-11 19:26 ` [PATCH 04/12] logger: fail when io vector number exceeds maximum Sami Kerola
2014-05-11 19:26 ` [PATCH 05/12] logger: check numeric priority and facility input values Sami Kerola
2014-05-11 19:26 ` [PATCH 06/12] build-sys: remove unnecessary void casts Sami Kerola
2014-05-11 19:26 ` [PATCH 07/12] term-utils: avoid error message string length couting errors Sami Kerola
2014-05-12 12:05   ` Karel Zak
2014-05-11 19:26 ` [PATCH 08/12] wall: replace magic number by named value Sami Kerola
2014-05-11 19:26 ` [PATCH 09/12] setterm: remove unused code Sami Kerola
2014-05-11 19:26 ` [PATCH 10/12] setterm: use string constant rather than #define Sami Kerola
2014-05-12 12:07   ` Karel Zak
2014-05-11 19:26 ` [PATCH 11/12] setterm: convert various constant number definitions to enums Sami Kerola
2014-05-11 19:26 ` [PATCH 12/12] setterm: convert remaining magic values to symbolic references Sami Kerola
2014-05-12 12:10   ` Karel Zak
2014-05-12 14:53     ` Sami Kerola
2014-05-12  7:05 ` [PATCH 01/12] tests: check /proc availability, and go-around if it is incomplete Bernhard Voelker
2014-05-12  9:13   ` Sami Kerola
2014-05-12 11:06   ` Karel Zak
2014-05-12 12:01 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox