1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

r24894: Run the libnet tests over just one DCE/RPC transport. Other DCE/RPC tests already check

that the DCE/RPC library and interfaces work ok.
This commit is contained in:
Jelmer Vernooij 2007-09-02 14:09:24 +00:00 committed by Gerald (Jerry) Carter
parent df8f0677f3
commit d392d6e92b
4 changed files with 13 additions and 34 deletions

View File

@ -33,3 +33,4 @@ RPC-DRSUAPI.*/DsGetDomainControllerInfo
RPC-DRSUAPI.*/QuerySitesByCost
RPC-DRSUAPI.*/DsGetNCChange
BASE-CHARSET.*/Testing partial surrogate
.*NET-API-DELSHARE.* # DelShare isn't implemented yet

View File

@ -43,3 +43,5 @@ RPC-INITSHUTDOWN # Not provided by Samba 4
RPC-SVCCTL # Not provided by Samba 4
RPC-ATSVC # Not provided by Samba 4
.*SAMBA3.* # Samba3-specific test
^NET-DOMOPEN$ # Hangs for some reason
^NET-API-BECOME-DC$ # Fails

View File

@ -2,23 +2,11 @@
# add tests to this list as they start passing, so we test
# that they stay passing
ncacn_np_tests="NET-API-LOOKUP NET-API-LOOKUPHOST NET-API-LOOKUPPDC NET-API-RPCCONN-BIND NET-API-RPCCONN-SRV NET-API-RPCCONN-PDC NET-API-RPCCONN-DC NET-API-RPCCONN-DCINFO NET-API-LISTSHARES NET-API-CREATEUSER NET-API-DELETEUSER NET-API-DOMLIST"
ncalrpc_tests="NET-API-RPCCONN-SRV NET-API-RPCCONN-DC NET-API-RPCCONN-DCINFO NET-API-LISTSHARES NET-API-CREATEUSER NET-API-DELETEUSER NET-USERINFO NET-USERADD NET-USERDEL NET-USERMOD NET-API-LOOKUPNAME NET-API-USERINFO NET-API-USERLIST NET-API-DOMOPENLSA NET-API-DOMCLOSELSA NET-API-DOMOPENSAMR NET-API-DOMCLOSESAMR NET-API-DOMLIST"
ncacn_ip_tcp_tests="NET-API-LOOKUP NET-API-LOOKUPHOST NET-API-LOOKUPPDC NET-API-RPCCONN-SRV NET-API-RPCCONN-DC NET-API-RPCCONN-DCINFO NET-API-LISTSHARES NET-API-CREATEUSER NET-API-DELETEUSER NET-API-MODIFYUSER NET-API-DOMLIST"
incdir=`dirname $0`
. $incdir/test_functions.sh
for bindoptions in seal,padcheck $VALIDATE bigendian; do
for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
case $transport in
ncalrpc) tests=$ncalrpc_tests ;;
ncacn_np) tests=$ncacn_np_tests ;;
ncacn_ip_tcp) tests=$ncacn_ip_tcp_tests ;;
esac
for t in $tests; do
name="$t on $transport with $bindoptions"
plantest "$name" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" $t "$*"
done
done
tests=`$samba4bindir/smbtorture --list | grep ^NET-`
for t in $tests; do
plantest "$t" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS "\$SERVER[$VALIDATE]" -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" $t "$*"
done

View File

@ -195,24 +195,19 @@ static BOOL test_addshare(struct dcerpc_pipe *svc_pipe, TALLOC_CTX *mem_ctx, con
}
BOOL torture_delshare(struct torture_context *torture)
bool torture_delshare(struct torture_context *torture)
{
struct dcerpc_pipe *p;
struct dcerpc_binding *bind;
struct libnet_context* libnetctx;
const char *host;
TALLOC_CTX *mem_ctx;
NTSTATUS status;
BOOL ret = True;
struct libnet_DelShare share;
mem_ctx = talloc_init("test_listshares");
host = torture_setting_string(torture, "host", NULL);
status = torture_rpc_binding(torture, &bind);
if (!NT_STATUS_IS_OK(status)) {
ret = False;
goto done;
}
torture_assert_ntstatus_ok(torture, status, "Failed to get binding");
libnetctx = libnet_context_init(NULL);
libnetctx->cred = cmdline_credentials;
@ -221,22 +216,15 @@ BOOL torture_delshare(struct torture_context *torture)
&p,
&ndr_table_srvsvc);
if (!test_addshare(p, mem_ctx, host, TEST_SHARENAME)) {
ret = False;
goto done;
if (!test_addshare(p, torture, host, TEST_SHARENAME)) {
return false;
}
share.in.server_name = bind->host;
share.in.share_name = TEST_SHARENAME;
status = libnet_DelShare(libnetctx, mem_ctx, &share);
if (!NT_STATUS_IS_OK(status)) {
ret = False;
goto done;
}
status = libnet_DelShare(libnetctx, torture, &share);
torture_assert_ntstatus_ok(torture, status, "Failed to delete share");
done:
talloc_free(mem_ctx);
return ret;
}