mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
testprogs: Fix shell arithmetic in test_kinit_trusts_heimdal.sh
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
01b1dd8f7b
commit
cbf756bb01
@ -55,18 +55,18 @@ echo $TRUST_PASSWORD >$PREFIX/tmppassfile
|
|||||||
testit "kinit with password" \
|
testit "kinit with password" \
|
||||||
$samba4kinit $enctype --password-file=$PREFIX/tmppassfile \
|
$samba4kinit $enctype --password-file=$PREFIX/tmppassfile \
|
||||||
--request-pac $TRUST_USERNAME@$TRUST_REALM || \
|
--request-pac $TRUST_USERNAME@$TRUST_REALM || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
test_smbclient "Test login with user kerberos ccache" \
|
test_smbclient "Test login with user kerberos ccache" \
|
||||||
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
rm -rf $KRB5CCNAME_PATH
|
rm -rf $KRB5CCNAME_PATH
|
||||||
|
|
||||||
testit "kinit with password and two minute lifetime" \
|
testit "kinit with password and two minute lifetime" \
|
||||||
$samba4kinit $enctype --password-file=$PREFIX/tmppassfile \
|
$samba4kinit $enctype --password-file=$PREFIX/tmppassfile \
|
||||||
--request-pac --server=krbtgt/$REALM@$TRUST_REALM --lifetime=2m \
|
--request-pac --server=krbtgt/$REALM@$TRUST_REALM --lifetime=2m \
|
||||||
$TRUST_USERNAME@$TRUST_REALM || \
|
$TRUST_USERNAME@$TRUST_REALM || \
|
||||||
failed=`expr $failed + 1`
|
failed=$((failed + 1))
|
||||||
test_smbclient "Test login with user kerberos ccache and two minute lifetime" 'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || failed=`expr $failed + 1`
|
test_smbclient "Test login with user kerberos ccache and two minute lifetime" 'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || failed=`(failed + 1)`
|
||||||
rm -rf $KRB5CCNAME_PATH
|
rm -rf $KRB5CCNAME_PATH
|
||||||
|
|
||||||
# Test with smbclient4
|
# Test with smbclient4
|
||||||
@ -74,89 +74,89 @@ smbclient="$samba4bindir/smbclient4"
|
|||||||
testit "kinit with password" \
|
testit "kinit with password" \
|
||||||
$samba4kinit $enctype --password-file=$PREFIX/tmppassfile \
|
$samba4kinit $enctype --password-file=$PREFIX/tmppassfile \
|
||||||
--request-pac $TRUST_USERNAME@$TRUST_REALM || \
|
--request-pac $TRUST_USERNAME@$TRUST_REALM || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
test_smbclient "Test login with user kerberos ccache (smbclient4)" \
|
test_smbclient "Test login with user kerberos ccache (smbclient4)" \
|
||||||
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
rm -rf $KRB5CCNAME_PATH
|
rm -rf $KRB5CCNAME_PATH
|
||||||
|
|
||||||
testit "kinit with password (enterprise style)" \
|
testit "kinit with password (enterprise style)" \
|
||||||
$samba4kinit $enctype --enterprise --password-file=$PREFIX/tmppassfile \
|
$samba4kinit $enctype --enterprise --password-file=$PREFIX/tmppassfile \
|
||||||
--request-pac $TRUST_USERNAME@$TRUST_REALM || \
|
--request-pac $TRUST_USERNAME@$TRUST_REALM || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
smbclient="$samba4bindir/smbclient"
|
smbclient="$samba4bindir/smbclient"
|
||||||
test_smbclient "Test login with user kerberos ccache" \
|
test_smbclient "Test login with user kerberos ccache" \
|
||||||
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
|
|
||||||
if test x"${TYPE}" = x"forest"; then
|
if test x"${TYPE}" = x"forest"; then
|
||||||
testit "kinit with password (upn enterprise style)" \
|
testit "kinit with password (upn enterprise style)" \
|
||||||
$samba4kinit $enctype --enterprise \
|
$samba4kinit $enctype --enterprise \
|
||||||
--password-file=$PREFIX/tmppassfile --request-pac \
|
--password-file=$PREFIX/tmppassfile --request-pac \
|
||||||
testdenied_upn@${TRUST_REALM}.upn || \
|
testdenied_upn@${TRUST_REALM}.upn || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
test_smbclient "Test login with user kerberos ccache" \
|
test_smbclient "Test login with user kerberos ccache" \
|
||||||
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
testit "kinit with password (windows style)" \
|
testit "kinit with password (windows style)" \
|
||||||
$samba4kinit $enctype --renewable --windows \
|
$samba4kinit $enctype --renewable --windows \
|
||||||
--password-file=$PREFIX/tmppassfile --request-pac \
|
--password-file=$PREFIX/tmppassfile --request-pac \
|
||||||
$TRUST_USERNAME@$TRUST_REALM || \
|
$TRUST_USERNAME@$TRUST_REALM || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
test_smbclient "Test login with user kerberos ccache" \
|
test_smbclient "Test login with user kerberos ccache" \
|
||||||
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
|
|
||||||
testit "kinit renew ticket" \
|
testit "kinit renew ticket" \
|
||||||
$samba4kinit $enctype --request-pac -R
|
$samba4kinit $enctype --request-pac -R
|
||||||
|
|
||||||
test_smbclient "Test login with kerberos ccache" \
|
test_smbclient "Test login with kerberos ccache" \
|
||||||
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
|
|
||||||
testit "check time with kerberos ccache" \
|
testit "check time with kerberos ccache" \
|
||||||
$VALGRIND $PYTHON $samba_tool time $SERVER.$REALM $CONFIGURATION \
|
$VALGRIND $PYTHON $samba_tool time $SERVER.$REALM $CONFIGURATION \
|
||||||
-k yes "$@" || \
|
-k yes "$@" || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
|
|
||||||
lowerrealm=$(echo $TRUST_REALM | tr '[A-Z]' '[a-z]')
|
lowerrealm=$(echo $TRUST_REALM | tr '[A-Z]' '[a-z]')
|
||||||
test_smbclient "Test login with user kerberos lowercase realm" \
|
test_smbclient "Test login with user kerberos lowercase realm" \
|
||||||
'ls' "$unc" \
|
'ls' "$unc" \
|
||||||
--use-krb5-ccache=$KRB5CCNAME \
|
--use-krb5-ccache=$KRB5CCNAME \
|
||||||
-U$TRUST_USERNAME@$lowerrealm%$TRUST_PASSWORD || \
|
-U$TRUST_USERNAME@$lowerrealm%$TRUST_PASSWORD || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
test_smbclient "Test login with user kerberos lowercase realm 2" \
|
test_smbclient "Test login with user kerberos lowercase realm 2" \
|
||||||
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME \
|
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME \
|
||||||
-U$TRUST_USERNAME@$TRUST_REALM%$TRUST_PASSWORD --realm=$lowerrealm || \
|
-U$TRUST_USERNAME@$TRUST_REALM%$TRUST_PASSWORD --realm=$lowerrealm || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
|
|
||||||
# Test the outgoing direction
|
# Test the outgoing direction
|
||||||
unc="//$TRUST_SERVER.$TRUST_REALM/tmp"
|
unc="//$TRUST_SERVER.$TRUST_REALM/tmp"
|
||||||
test_smbclient "Test user login with the first outgoing secret" \
|
test_smbclient "Test user login with the first outgoing secret" \
|
||||||
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME \
|
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME \
|
||||||
-U$USERNAME@$REALM%$PASSWORD || \
|
-U$USERNAME@$REALM%$PASSWORD || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
|
|
||||||
testit_expect_failure "setpassword should not work" \
|
testit_expect_failure "setpassword should not work" \
|
||||||
$VALGRIND $PYTHON $samba_tool user setpassword "${TRUST_DOMAIN}\$" \
|
$VALGRIND $PYTHON $samba_tool user setpassword "${TRUST_DOMAIN}\$" \
|
||||||
--random-password || \
|
--random-password || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
|
|
||||||
testit "wbinfo ping dc" \
|
testit "wbinfo ping dc" \
|
||||||
$VALGRIND $wbinfo --ping-dc --domain=$TRUST_DOMAIN || \
|
$VALGRIND $wbinfo --ping-dc --domain=$TRUST_DOMAIN || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
testit "wbinfo change outgoing trust pw" \
|
testit "wbinfo change outgoing trust pw" \
|
||||||
$VALGRIND $wbinfo --change-secret --domain=$TRUST_DOMAIN || \
|
$VALGRIND $wbinfo --change-secret --domain=$TRUST_DOMAIN || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
testit "wbinfo check outgoing trust pw" \
|
testit "wbinfo check outgoing trust pw" \
|
||||||
$VALGRIND $wbinfo --check-secret --domain=$TRUST_DOMAIN || \
|
$VALGRIND $wbinfo --check-secret --domain=$TRUST_DOMAIN || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
|
|
||||||
test_smbclient "Test user login with the changed outgoing secret" \
|
test_smbclient "Test user login with the changed outgoing secret" \
|
||||||
'ls' "$unc" --use-kerberos=required -U$USERNAME@$REALM%$PASSWORD || \
|
'ls' "$unc" --use-kerberos=required -U$USERNAME@$REALM%$PASSWORD || \
|
||||||
failed=$(expr $failed + 1)
|
failed=$((failed + 1))
|
||||||
|
|
||||||
rm -f $PREFIX/tmpccache $PREFIX/tmppassfile
|
rm -f $PREFIX/tmpccache $PREFIX/tmppassfile
|
||||||
exit $failed
|
exit $failed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user