Skip to contentSkip to conversation

xfstests: nslookup not found

PATCH In review Christian Kujau 3 participants 9 messages Jul 19, 2009 – Jul 20, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

while trying to run ./check in a current xfstests tree, execution stopped because "nslookup" was not available. I could've just installed this tool but I wondered why xfstests, a filesystem testing tool, would need nslookup at all. Turns out that it's being used in a routine called "_get_fqdn", which in turn is only called once in ./new, to set a variable called "owner" and I ask myself: do I really want my FQDN listed in the testresults, that maybe even get published for analysis? I changed this whole _get_fqdn thingy to just "uname -n", but I'm eager to know why the FQDN is crucial here :-)

Thoughts?

Christian.

common.config renamed from common.config.orig +0 -3
@@ -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 renamed from common.rc.orig +0 -8
@@ -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 renamed from new.orig +1 -1
@@ -105,7 +105,7 @@ cat <<End-of-File >$id
 #-----------------------------------------------------------------------
 #
 # creator
-owner=$USER@`_get_fqdn`
+owner=$USER@`uname -n`
 
 seq=\`basename \$0\`
 echo "QA output created by \$seq"
Signature · 8 lines
BOFH excuse #4:

static from nylon underwear

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 11 lines · Christian Kujau

Hi,

while trying to run ./check in a current xfstests tree, execution stopped because "nslookup" was not available. I could've just installed this tool but I wondered why xfstests, a filesystem testing tool, would need nslookup at all. Turns out that it's being used in a routine called "_get_fqdn", which in turn is only called once in ./new, to set a variable called "owner" and I ask myself: do I really want my FQDN listed in the testresults, that maybe even get published for analysis? I changed this whole _get_fqdn thingy to just "uname -n", but I'm eager to know why the FQDN is crucial here :-)

It uses it as email address for the test owner. In these days this probably requires hand-editing anyway, but the fqdn is certainly a better approximation than uname -n.

Can you resend a patch that just moves _get_fqdn and the check for nslookup from common* into the "new" script?

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
Quoted 13 lines · Christoph Hellwig
Quoted 11 lines · Christian Kujau

Hi,

while trying to run ./check in a current xfstests tree, execution stopped because "nslookup" was not available. I could've just installed this tool but I wondered why xfstests, a filesystem testing tool, would need nslookup at all. Turns out that it's being used in a routine called "_get_fqdn", which in turn is only called once in ./new, to set a variable called "owner" and I ask myself: do I really want my FQDN listed in the testresults, that maybe even get published for analysis? I changed this whole _get_fqdn thingy to just "uname -n", but I'm eager to know why the FQDN is crucial here :-)

Quoted 6 lines

It uses it as email address for the test owner. In these days this probably requires hand-editing anyway, but the fqdn is certainly a better approximation than uname -n.

Can you resend a patch that just moves _get_fqdn and the check for nslookup from common* into the "new" script?

That'd be great - sounds like the right solution to me; I've run into this too but never bothered to fix it. :)

Thanks,
-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
In reply to Christoph Hellwig
Quoted 2 lines · Christoph Hellwig

Can you resend a patch that just moves _get_fqdn and the check for nslookup from common* into the "new" script?

If I understand correctly, maybe something like this would be acceptable?

I was tempted to use "hostname -f" to give out the fqdn, but appaerently not every hostname knows "-f" and I did not want to let the whole script fail just because nslookup is not in place.

Christian.

common.config renamed from common.config.orig +0 -3
@@ -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 renamed from common.rc.orig +0 -8
@@ -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 renamed from new.orig +11 -0
@@ -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 ..."
Signature · 8 lines
BOFH excuse #274:

It was OK before you touched it.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#4 lore raw
Quoted 9 lines · Christian Kujau
Quoted 2 lines · Christoph Hellwig

Can you resend a patch that just moves _get_fqdn and the check for nslookup from common* into the "new" script?

If I understand correctly, maybe something like this would be acceptable?

I was tempted to use "hostname -f" to give out the fqdn, but appaerently not every hostname knows "-f" and I did not want to let the whole script fail just because nslookup is not in place.

Yes, that's exactly it. Can you resend it with a proper subject, description and add your Signed-off-by tag?

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#5 lore raw

PATCH 1/1 don't fail if nslookup is not found (was: xfstests: nslookup not found)

Quoted 2 lines · Christoph Hellwig

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.

common.config renamed from common.config.orig +0 -3
@@ -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 renamed from common.rc.orig +0 -8
@@ -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 renamed from new.orig +11 -0
@@ -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 ..."
Signature · 8 lines
BOFH excuse #334:

50% of the manual is in .pdf readme files

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#6 lore raw

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

Quoted 9 lines · Christian Kujau
Quoted 2 lines · Christoph Hellwig

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.

Thanks, I've put the patch in and pushed it to the kernel.org repository.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#7 lore raw

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

Quoted 2 lines · Christoph Hellwig

Thanks, I've put the patch in and pushed it to the kernel.org repository.

Thanks, Christoph. This reminds me to ask: why is there also a kernel.org repo, when there's one on oss.sgi.com too? (The latter being referenced in the XFS wiki)

Christian.

Signature · 8 lines
BOFH excuse #9:

doppler effect

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#8 lore raw

Re: [PATCH] don't fail if nslookup is not found

Quoted 7 lines · Christian Kujau
Quoted 2 lines · Christoph Hellwig

Thanks, I've put the patch in and pushed it to the kernel.org repository.

Thanks, Christoph. This reminds me to ask: why is there also a kernel.org repo, when there's one on oss.sgi.com too? (The latter being referenced in the XFS wiki)

outsiders can't commit to sgi's git repo, so those doing active development can commit to the one on kernel.org, and then sgi periodically pulls those in to oss.sgi.com.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs