svn commit: samba r2421 - in branches/SAMBA_4_0/source/scripting/swig: . torture

tpot at samba.org tpot at samba.org
Sun Sep 19 22:22:52 GMT 2004


Author: tpot
Date: 2004-09-19 22:22:51 +0000 (Sun, 19 Sep 2004)
New Revision: 2421

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/scripting/swig&rev=2421&nolog=1

Log:
Fix test for lookupdomain for a non-existent domain.

Export NTSTATUS exception from wrapper module so it can be used by scripts.

Modified:
   branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
   branches/SAMBA_4_0/source/scripting/swig/torture/samr.py


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i
===================================================================
--- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i	2004-09-19 21:25:24 UTC (rev 2420)
+++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i	2004-09-19 22:22:51 UTC (rev 2421)
@@ -1,3 +1,5 @@
+/* Tastes like -*- C -*- */
+
 /* 
    Unix SMB/CIFS implementation.
 
@@ -227,11 +229,16 @@
 
 %include "samba.i"
 
+%pythoncode %{
+	NTSTATUS = _dcerpc.NTSTATUS
+%}
+
 %init  %{
 	setup_logging("python", DEBUG_STDOUT);	
 	lp_load(dyn_CONFIGFILE, True, False, False);
 	load_interfaces();
-	ntstatus_exception = PyErr_NewException("dcerpc.NTSTATUS", NULL, NULL);
+	ntstatus_exception = PyErr_NewException("_dcerpc.NTSTATUS", NULL, NULL);
+	PyDict_SetItemString(d, "NTSTATUS", ntstatus_exception);
 %}
 
 %typemap(in, numinputs=0) struct dcerpc_pipe **OUT (struct dcerpc_pipe *temp_dcerpc_pipe) {

Modified: branches/SAMBA_4_0/source/scripting/swig/torture/samr.py
===================================================================
--- branches/SAMBA_4_0/source/scripting/swig/torture/samr.py	2004-09-19 21:25:24 UTC (rev 2420)
+++ branches/SAMBA_4_0/source/scripting/swig/torture/samr.py	2004-09-19 22:22:51 UTC (rev 2421)
@@ -90,8 +90,14 @@
 
     result = dcerpc.samr_LookupDomain(pipe, r)
 
-    print result
+    r['domain']['name'] = 'xxNODOMAINxx'
 
+    try:
+        result = dcerpc.samr_LookupDomain(pipe, r)
+    except dcerpc.NTSTATUS, arg:
+        if arg[0] != 0xc00000df:
+            raise dcerpc.NTSTATUS(arg)
+
 def test_EnumDomains(pipe, handle):
 
     print 'testing samr_EnumDomains'



More information about the samba-cvs mailing list