public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfstests 131: kill locktest process in cleanup & better error msgs
Date: Fri, 15 Jan 2010 20:18:55 -0600	[thread overview]
Message-ID: <4B51220F.7020703@sandeen.net> (raw)

I occasionally get failures in 131 like:

gethostbyname: Success

1) perror is the wrong thing for gethostbyname errors, so this
is confusing

2) the locktest thread doesn't get killed, so the fs
is busy and the next test fails when it can't unmount

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/src/locktest.c b/src/locktest.c
index e35f6a6..7552ace 100644
--- a/src/locktest.c
+++ b/src/locktest.c
@@ -44,6 +44,8 @@
 #define PLATFORM_CLEANUP()  /*no-op*/
 #define LL                  "ll"
 
+extern int h_errno;
+
 #define inet_aton(STRING, INADDRP) \
     (((INADDRP)->s_addr = inet_addr(STRING)) == -1 ? 0 : 1)
 
@@ -937,7 +939,10 @@ main(int argc, char *argv[])
         struct hostent  *servInfo;
 
         if ((servInfo = gethostbyname(host)) == NULL) {
-            perror("gethostbyname");
+	    printf("Couldn't get hostbyname for %s", host);
+	    if (h_errno == HOST_NOT_FOUND)
+		printf(": host not found");
+	    printf("\n");
             exit(1);
             /*NOTREACHED*/
         }



diff --git a/131 b/131
index b095c2f..de83fe2 100755
--- a/131
+++ b/131
@@ -34,6 +34,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
+    kill $locktest_pid2
+    kill $locktest_pid1
     _cleanup_testdir
 }
 
@@ -60,11 +62,13 @@ fi
 
 # Start the server
 src/locktest -p $PORT $TESTFILE > $testdir/server.out 2>&1 &
+locktest_pid1=$!
 
 sleep 1
 
 # Start the client
 src/locktest -p $PORT -h localhost $TESTFILE > $testdir/client.out 2>&1
+locktest_pid2=$!
 result=$?
 if [ $result -eq 0 ]; then
     echo success!

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2010-01-16  2:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-16  2:18 Eric Sandeen [this message]
2010-01-17 11:43 ` [PATCH] xfstests 131: kill locktest process in cleanup & better error msgs Christoph Hellwig
2010-01-17 15:51   ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B51220F.7020703@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox