common/rc: accept "localdomain" to mean YP/NIS disabled
authorEric Biggers <ebiggers@google.com>
Tue, 28 Feb 2017 22:09:36 +0000 (14:09 -0800)
committerEryu Guan <eguan@redhat.com>
Wed, 1 Mar 2017 03:40:04 +0000 (11:40 +0800)
When asked to 'cat' the passwd or group files, currently xfstests runs
the 'domainname' program to get what the kernel thinks the domainname
is.  It seems that traditionally this has been "(none)" if YP/NIS is not
in use.  However, Android devices use a different convention which is to
set the domainname to "localdomain".  Therefore, this patch updates
xfstests to accept both conventions to indicate YP/NIS disabled.  This
stops a number of tests from failing when run on Android.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/rc

index 8f2333467a50619ab140c4896612f889a5d0e57e..aa78d4b248c9ece3bc038883b79207bd9dad7568 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1792,7 +1792,7 @@ _yp_active()
 {
        local dn
        dn=$(domainname 2>/dev/null)
-       test -n "${dn}" -a "${dn}" != "(none)"
+       test -n "${dn}" -a "${dn}" != "(none)" -a "${dn}" != "localdomain"
        echo $?
 }