commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. v1.9.4.90-9-g6677c12


From: Simon Josefsson
Subject: [SCM] GNU Inetutils branch, master, updated. v1.9.4.90-9-g6677c12
Date: Thu, 28 Jan 2021 04:00:44 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  6677c1202426c8f4a22c67789415822515f95e0e (commit)
      from  f88570bae1dc1aab658dc138fa874f63d63ee7eb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=6677c1202426c8f4a22c67789415822515f95e0e


commit 6677c1202426c8f4a22c67789415822515f95e0e
Author: Simon Josefsson <simon@josefsson.org>
Date:   Thu Jan 28 10:00:27 2021 +0100

    tests/hostname.sh: Use uname as fallback if system lack hostname command.
    
    Only require mktemp when running root test.

diff --git a/ChangeLog b/ChangeLog
index b58669a..64cb57b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2021-01-28  Simon Josefsson  <simon@josefsson.org>
 
+       * tests/hostname.sh: Use uname as fallback if system lack hostname
+       command.  Only require mktemp when running root test.
+
+2021-01-28  Simon Josefsson  <simon@josefsson.org>
+
        * tests/hostname.sh: Use system hostname, not system uname, for
        comparison.
 
diff --git a/tests/hostname.sh b/tests/hostname.sh
index 5672061..4b85cbc 100755
--- a/tests/hostname.sh
+++ b/tests/hostname.sh
@@ -26,8 +26,6 @@
 
 . ./tools.sh
 
-$need_mktemp || exit_no_mktemp
-
 hostname=${hostname:-../src/hostname$EXEEXT}
 
 if [ $VERBOSE ]; then
@@ -41,17 +39,28 @@ posttest () {
     test -n "$NAMEFILE" && test -r "$NAMEFILE" && rm "$NAMEFILE"
 }
 
-$hostname || errno=$?
+our_hostname=`$hostname` || errno=$?
 test $errno -eq 0 || echo "Failed to get hostname." >&2
 test $errno -eq 0 || exit $errno
 
-test `$hostname` = `hostname` || errno=$?
-test $errno -eq 0 || echo "Failed to get same hostname as system (`$hostname` 
vs `hostname`)." >&2
-test $errno -eq 0 || exit $errno
+sys_hostname=`hostname` || errno=$?
+if test $errno -ne 0; then
+    echo "System hostname failed (rc $errno out $sys_hostname)." >&2
+    sys_hostname=`uname -n` || errno=$?
+    test $errno -eq 0 || echo "Failed uname (rc $errno out $sys_hostname)." >&2
+    test $errno -eq 0 || exit $errno
+fi
+
+if test "$our_hostname" != "$sys_hostname"; then
+    echo "Hostname mismatch $our_hostname != $sys_hostname"
+    exit 1
+fi
 
 if test `func_id_uid` != 0; then
     echo "hostname: skipping tests to set host name"
 else
+    $need_mktemp || exit_no_mktemp
+
     # Only run this if hostname succeeded...
     if test $errno -eq 0; then
        $hostname `$hostname` || errno=$?

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |  5 +++++
 tests/hostname.sh | 21 +++++++++++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]