]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
nsswitch:tests: Use testit_grep to get error printed if cmd fails master
authorAndreas Schneider <asn@samba.org>
Mon, 28 Oct 2024 14:09:44 +0000 (15:09 +0100)
committerAnoop C S <anoopcs@samba.org>
Fri, 12 Jun 2026 17:30:41 +0000 (17:30 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Jun 12 17:30:41 UTC 2026 on atb-devel-224

nsswitch/tests/test_wbinfo_name_lookup.sh

index 048fdfcf6bc4342b5124ed8c70e539093de8e472..02f4fbcefb66115488c2f44c7cc05c906187cf85 100755 (executable)
@@ -39,12 +39,12 @@ testit "name-to-sid.realm-user" \
 # 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)
+testit_grep "Verify DOMAIN/USER output" \
+       "${DOMAIN}/${lcuser}" \
+       ${wbinfo} -s "${sid}" ||
+       failed=$((failed + 1))
 
 # Two separator characters should fail
 testit_expect_failure "name-to-sid.double-separator" \