nsswitch: Add testcase for checking output of wbinfo --sid-to-name
authorChristof Schmitt <cs@samba.org>
Mon, 11 Mar 2019 23:26:48 +0000 (16:26 -0700)
committerChristof Schmitt <cs@samba.org>
Thu, 18 Apr 2019 17:21:17 +0000 (17:21 +0000)
The username should always be returned in the DOMAISHORTNAME/USERNAME
format.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13831

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
nsswitch/tests/test_wbinfo_name_lookup.sh
selftest/knownfail

index c1d39c1a602a8064bcebe665e56400f180540e52..ee8ae11f4b1cb5873c6c199d88146cafa7699510 100755 (executable)
@@ -31,6 +31,21 @@ testit "name-to-sid.upn" \
        $wbinfo -n $DC_USERNAME@$REALM || \
        failed=$(expr $failed + 1)
 
+testit "name-to-sid.realm-user" \
+       $wbinfo -n $REALM/$DC_USERNAME || \
+       failed=$(expr $failed + 1)
+
+# For the name-to-sid.realm-user query, ensure
+# that this does not change subsequent sid-to-name
+# queries.
+sid=$($wbinfo -n $REALM/$DC_USERNAME | sed -e 's/ .*//')
+out=$($wbinfo -s $sid | sed -e 's/ .//')
+# winbindd returns usernames in lowercase
+lcuser=$(echo $DC_USERNAME | tr A-Z a-z)
+testit "Verify DOMAIN/USER output" \
+       test "$out" = "$DOMAIN/$lcuser" || \
+       failed=$(expr $failed + 1)
+
 # Two separator characters should fail
 testit_expect_failure "name-to-sid.double-separator" \
                      $wbinfo -n $DOMAIN//$DC_USERNAME || \
index c588f2f5c6b1ba8e94b4112ce701280c52164459..29cce4bc2f76a38748d1ee91d89402a4821fb5de 100644 (file)
 ^samba.tests.ntlmdisabled.python\(ktest\).python2.ntlmdisabled.NtlmDisabledTests.test_samr_change_password\(ktest\)
 ^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).python3.ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\)
 ^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).python2.ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\)
+^samba3.wbinfo_name_lookup.Verify DOMAIN/USER output\(ad_member\)