1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-06 08:23:50 +03:00

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

Export NTSTATUS exception from wrapper module so it can be used by scripts.
This commit is contained in:
Tim Potter
2004-09-19 22:22:51 +00:00
committed by Gerald (Jerry) Carter
parent aa15fd1ecb
commit 57edfd605b
2 changed files with 15 additions and 2 deletions

View File

@@ -1,3 +1,5 @@
/* Tastes like -*- C -*- */
/*
Unix SMB/CIFS implementation.
@@ -227,11 +229,16 @@ PyObject *string_ptr_to_python(TALLOC_CTX *mem_ctx, char *obj)
%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) {

View File

@@ -90,7 +90,13 @@ def test_LookupDomain(pipe, handle, domain):
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):