xfs
[Top] [All Lists]

[PATCH] don't fail if nslookup is not found (was: xfstests: nslookup not

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: [PATCH] don't fail if nslookup is not found (was: xfstests: nslookup not found)
From: Christian Kujau <lists@xxxxxxxxxxxxxxx>
Date: Sun, 19 Jul 2009 18:46:25 -0700 (PDT)
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20090720001637.GA31674@xxxxxxxxxxxxx>
References: <alpine.DEB.2.01.0907191050010.6439@bogon> <20090719182012.GA10936@xxxxxxxxxxxxx> <alpine.DEB.2.01.0907191653240.6439@bogon> <20090720001637.GA31674@xxxxxxxxxxxxx>
User-agent: Alpine 2.01 (DEB 1184 2008-12-16)
On Sun, 19 Jul 2009 at 20:16, Christoph Hellwig wrote:
> Yes, that's exactly it.  Can you resend it with a proper subject,
> description and add your Signed-off-by tag?


When nslookup is not available, execution would stop. This patch moves the 
check for nslookup and the _get_fqdn function into the ./new script (since 
this is the only place where it's used) and we don't fail any more but try 
to find out our FQDN without nslookup.

Signed-off-by: Christian Kujau <lists@xxxxxxxxxxxxxxx>

--- common.config.orig  2009-07-19 21:43:15.000000000 +0200
+++ common.config       2009-07-19 21:43:31.000000000 +0200
@@ -120,9 +120,6 @@ export UMOUNT_PROG="`set_prog_path umoun
 export FSSTRESS_PROG="`set_prog_path fsstress $PWD/ltp/fsstress`"
 [ "$FSSTRESS_PROG" = "" ] && _fatal "fsstress not found"
 
-export NSLOOKUP_PROG="`set_prog_path nslookup`"
-[ "$NSLOOKUP_PROG" = "" ] && _fatal "nslookup not found"
-
 export PERL_PROG="`set_prog_path perl`"
 [ "$PERL_PROG" = "" ] && _fatal "perl not found"
 
--- common.rc.orig      2009-07-19 21:44:42.000000000 +0200
+++ common.rc   2009-07-19 21:45:06.000000000 +0200
@@ -330,14 +330,6 @@ _get_pids_by_name()
        -e "/[0-9]:[0-9][0-9]  *$1 /s/ .*//p"
 }
 
-# fqdn for localhost
-#
-_get_fqdn()
-{
-    host=`hostname`
-    $NSLOOKUP_PROG $host | $AWK_PROG '{ if ($1 == "Name:") print $2 }'
-}
-
 # fix malloc libs output
 #
 _fix_malloc()
--- new.orig    2009-07-19 21:43:20.000000000 +0200
+++ new 2009-07-20 01:45:51.000000000 +0200
@@ -32,6 +32,17 @@ _cleanup()
     :
 }
 
+# fqdn for localhost
+_get_fqdn()
+{
+    NSLOOKUP_PROG="`set_prog_path nslookup`"
+    if [ "$NSLOOKUP_PROG" = "" ]; then
+       getent hosts `uname -n` | awk '{print $2}'
+    else
+       $NSLOOKUP_PROG `hostname` | $AWK_PROG '{ if ($1 == "Name:") print $2 }'
+    fi
+}
+
 if [ ! -f group ]
 then
     echo "Creating the group index ..."


-- 
BOFH excuse #334:

50% of the manual is in .pdf readme files

<Prev in Thread] Current Thread [Next in Thread>