diff options
Diffstat (limited to 'testprogs')
-rwxr-xr-x | testprogs/blackbox/test_kinit.sh | 2 | ||||
-rwxr-xr-x | testprogs/blackbox/test_nmblookup.sh | 36 | ||||
-rwxr-xr-x | testprogs/ejs/ldap.js | 18 | ||||
-rw-r--r-- | testprogs/ejs/minschema_classes.txt | 5 | ||||
-rw-r--r-- | testprogs/win32/midltests/midltests.acf | 6 | ||||
-rw-r--r-- | testprogs/win32/midltests/midltests.c | 42 | ||||
-rw-r--r-- | testprogs/win32/midltests/midltests.idl | 27 | ||||
-rw-r--r-- | testprogs/win32/midltests/midltests_c_m.c | 2 | ||||
-rw-r--r-- | testprogs/win32/midltests/midltests_marshall.c | 121 | ||||
-rw-r--r-- | testprogs/win32/midltests/midltests_marshall.h | 16 | ||||
-rw-r--r-- | testprogs/win32/midltests/midltests_s_m.c | 2 | ||||
-rw-r--r-- | testprogs/win32/midltests/utils.c | 32 |
12 files changed, 263 insertions, 46 deletions
diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh index db12fba2f8..d4eff07c8d 100755 --- a/testprogs/blackbox/test_kinit.sh +++ b/testprogs/blackbox/test_kinit.sh @@ -56,7 +56,7 @@ test_smbclient() { return $status } -KRB5CCNAME=`pwd`/tmpccache +KRB5CCNAME="$PREFIX/tmpccache" export KRB5CCNAME echo $PASSWORD > ./tmppassfile diff --git a/testprogs/blackbox/test_nmblookup.sh b/testprogs/blackbox/test_nmblookup.sh deleted file mode 100755 index ad9b3ba799..0000000000 --- a/testprogs/blackbox/test_nmblookup.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# Blackbox tests for nmblookup - -NETBIOSNAME=$1 -NETBIOSALIAS=$2 -SERVER=$3 -SERVER_IP=$4 -shift 4 -TORTURE_OPTIONS=$* - -failed=0 - -testit() { - name="$1" - shift - cmdline="$*" - echo "test: $name" - $cmdline - status=$? - if [ x$status = x0 ]; then - echo "success: $name" - else - echo "failure: $name" - failed=`expr $failed + 1` - fi - return $status -} - -testit "nmblookup -U \$SERVER_IP \$SERVER" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $SERVER -testit "nmblookup -U \$SERVER_IP \$NETBIOSNAME" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSNAME -testit "nmblookup -U \$SERVER_IP \$NETBIOSALIAS" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSALIAS -testit "nmblookup \$SERVER" bin/nmblookup $TORTURE_OPTIONS $SERVER -testit "nmblookup \$NETBIOSNAME" bin/nmblookup $TORTURE_OPTIONS $NETBIOSNAME -testit "nmblookup \$NETBIOSALIAS" bin/nmblookup $TORTURE_OPTIONS $NETBIOSALIAS - -exit $failed diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js index 836b726ad9..090f93b6ca 100755 --- a/testprogs/ejs/ldap.js +++ b/testprogs/ejs/ldap.js @@ -240,7 +240,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=0-*"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) for servicePrincipalName;range=0-*"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -250,7 +250,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=0-19"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) for servicePrincipalName;range=0-19"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -260,7 +260,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=0-30"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=0-19"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -269,7 +269,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=0-40"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=0-40"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -278,7 +278,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=30-40"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=30-40"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -287,7 +287,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=10-40"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=10-40"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -297,7 +297,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=11-40"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=10-*"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -309,7 +309,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName;range=11-15"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName;range=11-15"); assert(res.error == 0); assert(res.msgs.length == 1); } @@ -319,7 +319,7 @@ servicePrincipalName: host/ldaptest2computer29 var attrs = new Array("servicePrincipalName"); var res = ldb.search("(cn=ldaptest2computer))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { - println("Could not find (cn=ldaptest2computer)"); + println("Could not find (cn=ldaptest2computer) at servicePrincipalName"); assert(res.error == 0); assert(res.msgs.length == 1); } diff --git a/testprogs/ejs/minschema_classes.txt b/testprogs/ejs/minschema_classes.txt index 0479438fa5..30f5b8ce96 100644 --- a/testprogs/ejs/minschema_classes.txt +++ b/testprogs/ejs/minschema_classes.txt @@ -34,3 +34,8 @@ attributeSchema subSchema queryPolicy groupPolicyContainer +ipsecPolicy +ipsecISAKMPPolicy +ipsecNFA +ipsecFilter +ipsecNegotiationPolicy diff --git a/testprogs/win32/midltests/midltests.acf b/testprogs/win32/midltests/midltests.acf new file mode 100644 index 0000000000..a04bb5dcd9 --- /dev/null +++ b/testprogs/win32/midltests/midltests.acf @@ -0,0 +1,6 @@ +[ + implicit_handle (handle_t midltests_IfHandle) +] +interface midltests +{ +} diff --git a/testprogs/win32/midltests/midltests.c b/testprogs/win32/midltests/midltests.c new file mode 100644 index 0000000000..61d4ce0812 --- /dev/null +++ b/testprogs/win32/midltests/midltests.c @@ -0,0 +1,42 @@ +/* + MIDLTESTS client. + + Copyright (C) Stefan Metzmacher 2008 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> +#include "midltests.h" + +#define MIDLTESTS_C_CODE 1 +#include "midltests.idl" + +int main(int argc, char **argv) +{ + int ret; + + midltests_IfHandle = NULL; + + RpcTryExcept { + midltests(); + } RpcExcept(1) { + ret = RpcExceptionCode(); + printf("Runtime error 0x%x\n", ret); + } RpcEndExcept + + return ret; +} diff --git a/testprogs/win32/midltests/midltests.idl b/testprogs/win32/midltests/midltests.idl new file mode 100644 index 0000000000..1932549c56 --- /dev/null +++ b/testprogs/win32/midltests/midltests.idl @@ -0,0 +1,27 @@ +#ifndef MIDLTESTS_C_CODE + +[ + uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"), + pointer_default(unique) +] +interface midltests +{ + long midltests_fn( + ); +} + +#elif MIDLTESTS_C_CODE + +static void midltests(void) +{ + cli_midltests_fn(); +} + +long srv_midltests_fn(void) +{ + printf("srv_midltests_fn: Start\n"); + printf("srv_midltests_fn: End\n"); + return 0x65757254; +} + +#endif
\ No newline at end of file diff --git a/testprogs/win32/midltests/midltests_c_m.c b/testprogs/win32/midltests/midltests_c_m.c new file mode 100644 index 0000000000..facf735304 --- /dev/null +++ b/testprogs/win32/midltests/midltests_c_m.c @@ -0,0 +1,2 @@ +#include "midltests_marshall.h" +#include "midltests_c.c" diff --git a/testprogs/win32/midltests/midltests_marshall.c b/testprogs/win32/midltests/midltests_marshall.c new file mode 100644 index 0000000000..e772afd03d --- /dev/null +++ b/testprogs/win32/midltests/midltests_marshall.c @@ -0,0 +1,121 @@ +/* + MIDLTESTS client. + + Copyright (C) Stefan Metzmacher 2008 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> +#include "midltests.h" + +#define MIN(a,b) ((a)<(b)?(a):(b)) +static void print_asc(const unsigned char *buf,int len) +{ + int i; + for (i=0;i<len;i++) + printf("%c", isprint(buf[i])?buf[i]:'.'); +} + +static void dump_data(const unsigned char *buf1,int len) +{ + const unsigned char *buf = (const unsigned char *)buf1; + int i=0; + if (len<=0) return; + + printf("[%03X] ",i); + for (i=0;i<len;) { + printf("%02X ",(int)buf[i]); + i++; + if (i%8 == 0) printf(" "); + if (i%16 == 0) { + print_asc(&buf[i-16],8); printf(" "); + print_asc(&buf[i-8],8); printf("\n"); + if (i<len) printf("[%03X] ",i); + } + } + if (i%16) { + int n; + n = 16 - (i%16); + printf(" "); + if (n>8) printf(" "); + while (n--) printf(" "); + n = MIN(8,i%16); + print_asc(&buf[i-(i%16)],n); printf( " " ); + n = (i%16) - n; + if (n>0) print_asc(&buf[i-n],n); + printf("\n"); + } +} + +void NdrGetBufferMarshall(PMIDL_STUB_MESSAGE stubmsg, unsigned long len, RPC_BINDING_HANDLE hnd) +{ + stubmsg->RpcMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, len); + memset(stubmsg->RpcMsg->Buffer, 0xef, len); + stubmsg->RpcMsg->BufferLength = len; + stubmsg->Buffer = stubmsg->RpcMsg->Buffer; + stubmsg->BufferLength = stubmsg->RpcMsg->BufferLength; + stubmsg->fBufferValid = TRUE; +} + +void __RPC_STUB midltests_midltests_fn(PRPC_MESSAGE _pRpcMessage); + +void NdrSendReceiveMarshall(PMIDL_STUB_MESSAGE StubMsg, unsigned char *buffer) +{ + unsigned long DataRepresentation; + + StubMsg->RpcMsg->BufferLength = buffer - (unsigned char *)StubMsg->RpcMsg->Buffer; + + printf("[in] Buffer[%d/%d]\n", + StubMsg->RpcMsg->BufferLength, StubMsg->BufferLength); + dump_data(StubMsg->RpcMsg->Buffer, StubMsg->RpcMsg->BufferLength); + + DataRepresentation = StubMsg->RpcMsg->DataRepresentation; + StubMsg->RpcMsg->DataRepresentation = NDR_LOCAL_DATA_REPRESENTATION; + midltests_midltests_fn(StubMsg->RpcMsg); + StubMsg->RpcMsg->DataRepresentation = DataRepresentation; + + StubMsg->BufferLength = StubMsg->RpcMsg->BufferLength; + StubMsg->BufferStart = StubMsg->RpcMsg->Buffer; + StubMsg->BufferEnd = StubMsg->BufferStart + StubMsg->BufferLength; + StubMsg->Buffer = StubMsg->BufferStart; + + printf("[out] Buffer[%d]\n", + StubMsg->RpcMsg->BufferLength); + dump_data(StubMsg->RpcMsg->Buffer, StubMsg->RpcMsg->BufferLength); +} + +void NdrServerInitializeNewMarshall(PRPC_MESSAGE pRpcMsg, + PMIDL_STUB_MESSAGE pStubMsg, + PMIDL_STUB_DESC pStubDesc) +{ + memset(pStubMsg, 0, sizeof(*pStubMsg)); + pStubMsg->RpcMsg = pRpcMsg; + pStubMsg->Buffer = pStubMsg->BufferStart = pRpcMsg->Buffer; + pStubMsg->BufferEnd = pStubMsg->Buffer + pRpcMsg->BufferLength; + pStubMsg->BufferLength = pRpcMsg->BufferLength; + pStubMsg->pfnAllocate = pStubDesc->pfnAllocate; + pStubMsg->pfnFree = pStubDesc->pfnFree; + pStubMsg->StubDesc = pStubDesc; + pStubMsg->dwDestContext = MSHCTX_DIFFERENTMACHINE; +} + +RPC_STATUS WINAPI I_RpcGetBufferMarshall(PRPC_MESSAGE RpcMsg) +{ + RpcMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, RpcMsg->BufferLength); + memset(RpcMsg->Buffer, 0xcd, RpcMsg->BufferLength); + return 0; +} diff --git a/testprogs/win32/midltests/midltests_marshall.h b/testprogs/win32/midltests/midltests_marshall.h new file mode 100644 index 0000000000..0c6aed2721 --- /dev/null +++ b/testprogs/win32/midltests/midltests_marshall.h @@ -0,0 +1,16 @@ +#include "rpc.h" +#include "rpcndr.h" +#define NdrSendReceive NdrSendReceiveMarshall +void NdrSendReceiveMarshall(PMIDL_STUB_MESSAGE stubmsg, unsigned char *buffer); +#define NdrGetBuffer NdrGetBufferMarshall +void NdrGetBufferMarshall(PMIDL_STUB_MESSAGE stubmsg, unsigned long len, RPC_BINDING_HANDLE hnd); +#define NdrServerInitializeNew NdrServerInitializeNewMarshall +void NdrServerInitializeNewMarshall(PRPC_MESSAGE pRpcMsg, + PMIDL_STUB_MESSAGE pStubMsg, + PMIDL_STUB_DESC pStubDesc); +#define I_RpcGetBuffer I_RpcGetBufferMarshall +RPC_STATUS WINAPI I_RpcGetBufferMarshall(PRPC_MESSAGE pMsg); + + + + diff --git a/testprogs/win32/midltests/midltests_s_m.c b/testprogs/win32/midltests/midltests_s_m.c new file mode 100644 index 0000000000..7e0862dc69 --- /dev/null +++ b/testprogs/win32/midltests/midltests_s_m.c @@ -0,0 +1,2 @@ +#include "midltests_marshall.h" +#include "midltests_s.c" diff --git a/testprogs/win32/midltests/utils.c b/testprogs/win32/midltests/utils.c new file mode 100644 index 0000000000..8c4833ddb4 --- /dev/null +++ b/testprogs/win32/midltests/utils.c @@ -0,0 +1,32 @@ +/* + MIDLTESTS utility functions. + + Copyright (C) Tim Potter 2003 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "midltests.h" + +/* MIDL allocate and free functions */ + +void __RPC_FAR *__RPC_USER midl_user_allocate(size_t len) +{ + return(malloc(len)); +} + +void __RPC_USER midl_user_free(void __RPC_FAR *ptr) +{ + free(ptr); +} |