* [PATCH] xfstests 131: kill locktest process in cleanup & better error msgs
@ 2010-01-16 2:18 Eric Sandeen
2010-01-17 11:43 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2010-01-16 2:18 UTC (permalink / raw)
To: xfs-oss
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfstests 131: kill locktest process in cleanup & better error msgs
2010-01-16 2:18 [PATCH] xfstests 131: kill locktest process in cleanup & better error msgs Eric Sandeen
@ 2010-01-17 11:43 ` Christoph Hellwig
2010-01-17 15:51 ` Eric Sandeen
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2010-01-17 11:43 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On Fri, Jan 15, 2010 at 08:18:55PM -0600, Eric Sandeen wrote:
> I occasionally get failures in 131 like:
>
> gethostbyname: Success
>
> 1) perror is the wrong thing for gethostbyname errors, so this
> is confusing
Indeed.
> 2) the locktest thread doesn't get killed, so the fs
> is busy and the next test fails when it can't unmount
Yeah, this was always causing problems for me when running xfstests on
a system without networking for some unknown reason.
> --- 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");
Might be worth using herror or hsterror, although the manpage marks them
as obsolete..
Anyway, good enough to put in, so:
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfstests 131: kill locktest process in cleanup & better error msgs
2010-01-17 11:43 ` Christoph Hellwig
@ 2010-01-17 15:51 ` Eric Sandeen
0 siblings, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2010-01-17 15:51 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs-oss
On Jan 17, 2010, at 5:43 AM, Christoph Hellwig <hch@infradead.org>
wrote:
>
> Might be worth using herror or hsterror, although the manpage marks
> them
> as obsolete..
>
Yeah didn't use them for that reason, no idea why they're obsoleted...
Thanks,
Eric
> Anyway, good enough to put in, so:
>
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-17 15:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-16 2:18 [PATCH] xfstests 131: kill locktest process in cleanup & better error msgs Eric Sandeen
2010-01-17 11:43 ` Christoph Hellwig
2010-01-17 15:51 ` Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox