midltests: add tests with v1_enum and NDR64
authorStefan Metzmacher <metze@samba.org>
Wed, 16 Oct 2013 08:06:13 +0000 (10:06 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 7 Jan 2014 07:37:38 +0000 (08:37 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
testprogs/win32/midltests/valid/midltests_v1_enum_01.idl [new file with mode: 0644]
testprogs/win32/midltests/valid/midltests_v1_enum_01.txt [new file with mode: 0644]

diff --git a/testprogs/win32/midltests/valid/midltests_v1_enum_01.idl b/testprogs/win32/midltests/valid/midltests_v1_enum_01.idl
new file mode 100644 (file)
index 0000000..18a5ceb
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef MIDLTESTS_C_CODE
+
+/*
+ * For midltests_tcp.exe you may want to
+ * redirect the traffic via rinetd
+ * with a /etc/rinetd.conf like this:
+ *
+ * 172.31.9.1 5032 172.31.9.8 5032
+ * 172.31.9.1 5064 172.31.9.8 5064
+ *
+ * This is useful to watch the traffic with
+ * a network sniffer.
+ */
+/*
+cpp_quote("#define LISTEN_IP \"0.0.0.0\"")
+cpp_quote("#define FORWARD_IP \"127.0.0.1\"")
+cpp_quote("#define CONNECT_IP \"172.31.9.1\"")
+*/
+
+/*
+ * With midltests_tcp.exe NDR64 is enforced by default.
+ * For testing it might be needed to allow downgrades
+ * to NDR32. This is needed when you use 'pipe'.
+ */
+//cpp_quote("#define DONOT_FORCE_NDR64 1")
+
+[
+  uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
+  pointer_default(unique)
+]
+interface midltests
+{
+       typedef [v1_enum] enum {
+               value1 = -1
+       } midltests_enum;
+
+       long midltests_fn(
+               midltests_enum v
+       );
+}
+
+#elif MIDLTESTS_C_CODE
+
+static void midltests(void)
+{
+       cli_midltests_fn(value1);
+}
+
+long srv_midltests_fn(enum midltests_enum v)
+{
+       printf("srv_midltests_fn: Start\n");
+       printf("srv_midltests_fn: End\n");
+       return 0x65757254;
+}
+
+#endif
diff --git a/testprogs/win32/midltests/valid/midltests_v1_enum_01.txt b/testprogs/win32/midltests/valid/midltests_v1_enum_01.txt
new file mode 100644 (file)
index 0000000..d4d018c
--- /dev/null
@@ -0,0 +1,37 @@
+Wait for setup of server threads
+
+Test NDR32
+
+ndr32: disable NDR64
+
+ndr32:in => out: ptype[request] flen[28] plen[4] ahint[4]
+
+[000] FF FF FF FF                                       ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr32:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65                                       True
+
+NDRTcpThread[ndr32] stop
+
+Test NDR64
+
+ndr64: got NDR64
+
+ndr64:in => out: ptype[request] flen[28] plen[4] ahint[4]
+
+[000] FF FF FF FF                                       ....
+
+srv_midltests_fn: Start
+srv_midltests_fn: End
+
+ndr64:out => in: ptype[response] flen[28] plen[4] ahint[4]
+
+[000] 54 72 75 65                                       True
+
+NDRTcpThread[ndr64] stop
+
+Test OK