1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/source3/script/tests/test_smbclient_iconv.sh
Jeremy Allison 12c526f151 s3: scripts: Selfttest. samba3.blackbox.smbclient_iconv.*
Fix missing 'include' in temporary client smb.conf file.

The current temporary generated smb.conf file for the client, "client_cp850_smbconf"
doesn't include the normal client smb.conf file "client.conf".

This means it's missing the:

interfaces = XXXX,YYYY

line we needed to find the server via socketwrapper. Currently this test is finding the server by accident :-).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Aug  4 06:30:25 UTC 2020 on sn-devel-184
2020-08-04 06:30:25 +00:00

56 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# This checks directory listing with a file containing
# an invalid CP850 conversion name returns NT_STATUS_INVALID_NETWORK_RESPONSE
if [ $# -lt 6 ]; then
cat <<EOF
Usage: test_smbclient_iconv.sh SERVER SERVER_IP SHARENAME USERNAME PASSWORD SMBCLIENT
EOF
exit 1;
fi
SERVER="$1"
SERVER_IP="$2"
SHARENAME="$3"
USERNAME="$4"
PASSWORD="$5"
SMBCLIENT="$6"
shift 6
ADDARGS="$@"
incdir=`dirname $0`/../../../testprogs/blackbox
. $incdir/subunit.sh
failed=0
test_smbclient_iconv()
{
normal_smbclient_config="$PREFIX/client/client.conf"
smbclient_config="$PREFIX/client/client_cp850_smbconf"
cat > $smbclient_config <<EOF
[global]
include = $normal_smbclient_config
unix charset = cp850
client min protocol = core
EOF
cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT -U$USERNAME%$PASSWORD //$SERVER/$SHARENAME --configfile=$smbclient_config "$ADDARGS" -c ls 2>&1'
eval echo "$cmd"
out=$(eval $cmd)
rm -f $smbclient_config
echo "$out" | grep 'NT_STATUS_INVALID_NETWORK_RESPONSE'
ret=$?
if [ $ret -ne 0 ] ; then
echo "$out"
echo 'failed - should get: NT_STATUS_INVALID_NETWORK_RESPONSE.'
return 1
fi
return 0
}
testit "bad_iconv smbclient" test_smbclient_iconv || failed=$(expr $failed + 1)
testok $0 $failed