diff options
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/lib/ldb/tests/python/deletetest.py | 1 | ||||
-rwxr-xr-x | source4/lib/ldb/tests/python/urgent_replication.py | 8 | ||||
-rwxr-xr-x | source4/script/installmisc.sh | 9 | ||||
-rw-r--r-- | source4/scripting/python/config.mk | 4 | ||||
-rwxr-xr-x | source4/scripting/python/samba_external/missing.py | 13 | ||||
-rw-r--r-- | source4/selftest/config.mk | 2 | ||||
-rw-r--r-- | source4/selftest/knownfail | 86 | ||||
-rwxr-xr-x | source4/selftest/tests.sh | 14 | ||||
-rw-r--r-- | source4/torture/basic/denytest.c | 123 | ||||
-rw-r--r-- | source4/torture/raw/open.c | 27 | ||||
-rw-r--r-- | source4/torture/smbtorture.c | 8 |
11 files changed, 145 insertions, 150 deletions
diff --git a/source4/lib/ldb/tests/python/deletetest.py b/source4/lib/ldb/tests/python/deletetest.py index 13bec7efae..eff92c5f33 100755 --- a/source4/lib/ldb/tests/python/deletetest.py +++ b/source4/lib/ldb/tests/python/deletetest.py @@ -8,6 +8,7 @@ import os sys.path.append("bin/python") sys.path.append("../lib/subunit/python") +sys.path.append("../lib/testtools") import samba.getopt as options diff --git a/source4/lib/ldb/tests/python/urgent_replication.py b/source4/lib/ldb/tests/python/urgent_replication.py index b8df072bf3..28b3a5fa78 100755 --- a/source4/lib/ldb/tests/python/urgent_replication.py +++ b/source4/lib/ldb/tests/python/urgent_replication.py @@ -2,16 +2,13 @@ # -*- coding: utf-8 -*- # This is a port of the original in testprogs/ejs/ldap.js -import getopt import optparse import sys -import time -import random -import base64 import os sys.path.append("bin/python") sys.path.append("../lib/subunit/python") +sys.path.append("../lib/testtools") import samba.getopt as options @@ -26,9 +23,6 @@ from samba import glue from subunit.run import SubunitTestRunner import unittest -from samba.ndr import ndr_pack, ndr_unpack -from samba.dcerpc import security - parser = optparse.OptionParser("urgent_replication [options] <host>") sambaopts = options.SambaOptions(parser) parser.add_option_group(sambaopts) diff --git a/source4/script/installmisc.sh b/source4/script/installmisc.sh index eba5996e13..6a53b988f5 100755 --- a/source4/script/installmisc.sh +++ b/source4/script/installmisc.sh @@ -82,12 +82,13 @@ cp setup/provision.smb.conf.member $SETUPDIR || exit 1 cp setup/provision.smb.conf.standalone $SETUPDIR || exit 1 echo "Installing external python libraries" -mkdir -p $PYTHONDIR/samba_external || exit 1 +mkdir -p $DESTDIR$PYTHONDIR || exit 1 for p in $($PYTHON scripting/python/samba_external/missing.py); do - echo "Installing missing python library $p" - mkdir -p $PYTHONDIR/samba_external/$p - cp -r ../lib/$p/* $PYTHONDIR/samba_external/$p/ || exit 1 + package=`basename $p` + echo "Installing missing python package $package" + mkdir -p $DESTDIR$PYTHONDIR/$package + cp -r ../lib/$p/* $DESTDIR$PYTHONDIR/$package/ || exit 1 done echo "Installing stuff in $PRIVATEDIR" diff --git a/source4/scripting/python/config.mk b/source4/scripting/python/config.mk index d36e136346..db35669e1a 100644 --- a/source4/scripting/python/config.mk +++ b/source4/scripting/python/config.mk @@ -23,9 +23,9 @@ python_glue_OBJ_FILES = $(pyscriptsrcdir)/pyglue.o $(python_glue_OBJ_FILES): CFLAGS+=-I$(ldbsrcdir) -_PY_FILES = $(shell find $(pyscriptsrcdir)/samba ../lib/subunit/python -type f -name "*.py") +_PY_FILES = $(shell find $(pyscriptsrcdir)/samba -type f -name "*.py") -$(eval $(foreach pyfile, $(_PY_FILES),$(call python_py_module_template,$(patsubst $(pyscriptsrcdir)/%,%,$(subst ../lib/subunit/python,,$(pyfile))),$(pyfile)))) +$(eval $(foreach pyfile, $(_PY_FILES),$(call python_py_module_template,$(patsubst $(pyscriptsrcdir)/%,%,$(pyfile)),$(pyfile)))) PYDOCTOR = pydoctor PYDOCTOR_OPTIONS = --project-name Samba --project-url http://www.samba.org/ \ diff --git a/source4/scripting/python/samba_external/missing.py b/source4/scripting/python/samba_external/missing.py index 50bda65a21..d3dd2b9290 100755 --- a/source4/scripting/python/samba_external/missing.py +++ b/source4/scripting/python/samba_external/missing.py @@ -1,12 +1,17 @@ #!/usr/bin/python # work out what python external libraries we need to install +external_libs = { + "dns.resolver": "dnspython/dns", + "subunit": "subunit/python/subunit", + "testtools": "testtools/testtools"} list = [] -try: - import dns.resolver -except: - list.append("dnspython") +for module, package in external_libs.iteritems(): + try: + __import__(module) + except ImportError: + list.append(package) print ' '.join(list) diff --git a/source4/selftest/config.mk b/source4/selftest/config.mk index 6057de68f9..c4c5e190a9 100644 --- a/source4/selftest/config.mk +++ b/source4/selftest/config.mk @@ -13,7 +13,7 @@ ST_DONE_TEST = @test -f $(selftest_prefix)/st_done || { echo "SELFTEST FAILED"; SELFTEST_NOSLOW_OPTS = --exclude=$(srcdir)/selftest/slow SELFTEST_QUICK_OPTS = $(SELFTEST_NOSLOW_OPTS) --quick --include=$(srcdir)/selftest/quick -FILTER_XFAIL = $(PERL) $(selftestdir)/filter-subunit.pl --expected-failures=$(srcdir)/selftest/knownfail +FILTER_XFAIL = $(PYTHON) $(selftestdir)/filter-subunit --expected-failures=$(srcdir)/selftest/knownfail SUBUNIT_FORMATTER ?= $(PYTHON) $(selftestdir)/format-subunit --prefix=${selftest_prefix} --immediate FORMAT_TEST_OUTPUT = $(FILTER_XFAIL) | $(SUBUNIT_FORMATTER) diff --git a/source4/selftest/knownfail b/source4/selftest/knownfail index a6b7161019..60606ace56 100644 --- a/source4/selftest/knownfail +++ b/source4/selftest/knownfail @@ -3,63 +3,63 @@ # # "make test" will not report failures for tests listed here and will consider # a successful run for any of these tests an error. -local.resolve.*.async -local.iconv.*.next_codepoint() -base.delete.*.deltest17 -base.delete.*.deltest20a -base.delete.*.deltest20b -raw.rename.*.osxrename -raw.rename.*.directory rename -rpc.winreg.*security +samba4.local.resolve.*.async +samba4.local.iconv.*.next_codepoint() +samba4..*base.delete.*.deltest17 +samba4..*base.delete.*.deltest20a +samba4..*base.delete.*.deltest20b +samba4.raw.rename.*.osxrename +samba4.raw.rename.*.directory rename +samba4.rpc.winreg.*security samba4.local.registry.(dir|ldb).check hive security samba4.local.registry.local.security -rpc.wkssvc -rpc.handles.*.lsarpc-shared -rpc.handles.*.mixed-shared -rpc.epmapper.*.Insert -rpc.epmapper.*.InqObject -rpc.drsuapi.* -rpc.lsalookup -rpc.cracknames -rpc.netlogon.*.LogonUasLogon -rpc.netlogon.*.LogonUasLogoff -rpc.netlogon.*.DatabaseSync -rpc.netlogon.*.DatabaseSync2 -rpc.netlogon.*.LogonControl -rpc.netlogon.*.LogonControl2 -rpc.netlogon.*.DsrEnumerateDomainTrusts -rpc.netlogon.*.NetrEnumerateTrustedDomains -rpc.netlogon.*.NetrEnumerateTrustedDomainsEx -rpc.netlogon.*.DsrGetDcSiteCoverageW -rpc.netlogon.*.DsRAddressToSitenamesW -rpc.netlogon.*.DsRAddressToSitenamesExW -rpc.netlogon.*.GetPassword -rpc.netlogon.*.GetTrustPasswords -rpc.netlogon.*.DatabaseRedo -rpc.netlogon.*.ServerGetTrustInfo -rpc.netlogon.*.GetDomainInfo # Also fails against W2K8 (but in a different way) +samba4.rpc.wkssvc +samba4.rpc.handles.*.lsarpc-shared +samba4.rpc.handles.*.mixed-shared +samba4.rpc.epmapper.*.Insert +samba4.rpc.epmapper.*.InqObject +samba4.rpc.drsuapi.* +samba4.rpc.lsalookup +samba4.rpc.cracknames +samba4.rpc.netlogon.*.LogonUasLogon +samba4.rpc.netlogon.*.LogonUasLogoff +samba4.rpc.netlogon.*.DatabaseSync +samba4.rpc.netlogon.*.DatabaseSync2 +samba4.rpc.netlogon.*.LogonControl +samba4.rpc.netlogon.*.LogonControl2 +samba4.rpc.netlogon.*.DsrEnumerateDomainTrusts +samba4.rpc.netlogon.*.NetrEnumerateTrustedDomains +samba4.rpc.netlogon.*.NetrEnumerateTrustedDomainsEx +samba4.rpc.netlogon.*.DsrGetDcSiteCoverageW +samba4.rpc.netlogon.*.DsRAddressToSitenamesW +samba4.rpc.netlogon.*.DsRAddressToSitenamesExW +samba4.rpc.netlogon.*.GetPassword +samba4.rpc.netlogon.*.GetTrustPasswords +samba4.rpc.netlogon.*.DatabaseRedo +samba4.rpc.netlogon.*.ServerGetTrustInfo +samba4.rpc.netlogon.*.GetDomainInfo # Also fails against W2K8 (but in a different way) samba4.rpc.samr.passwords.pwdlastset # Not provided by Samba 4 yet samba4.rpc.samr.passwords.badpwdcount # Not provided by Samba 4 yet samba4.rpc.samr.passwords.lockout samba4.rpc.samr.users.privileges samba4.rpc.spoolss # Not provided by Samba 4 yet -base.charset.*.Testing partial surrogate +samba4.base.charset.*.Testing partial surrogate .*net.api.delshare.* # DelShare isn't implemented yet ^samba4.net.api.become.dc.*$ # TODO: this should work!!! -rap.*netservergetinfo -smb2.persistent.handles1 +samba4.rap.*netservergetinfo +samba4.smb2.persistent.handles1 samba4.winbind.struct.*.SHOW_SEQUENCE # Not yet working in winbind samba4.winbind.struct.*.GETPWENT # Not yet working in winbind samba4.winbind.struct.*.SETPWENT # Not yet working in winbind samba4.winbind.struct.*.LOOKUP_NAME_SID # Not yet working in winbind samba4.winbind.struct.*.LIST_GROUPS -^samba4.*base.delaywrite.*update of write time and SMBwrite truncate$ -^samba4.*base.delaywrite.*update of write time and SMBwrite truncate expand$ -^samba4.*base.delaywrite.*delayed update of write time 3a$ -^samba4.*base.delaywrite.*delayed update of write time 3c$ -^samba4.*base.delaywrite.*update of write time using SET_END_OF_FILE$ -^samba4.*base.delaywrite.*update of write time using SET_ALLOCATION_SIZE$ -^samba4.ldap.python \(dc\).Test add_ldif\(\) with BASE64 security descriptor input using WRONG domain SID$ +samba4.*base.delaywrite.*update of write time and SMBwrite truncate$ +samba4.*base.delaywrite.*update of write time and SMBwrite truncate expand$ +samba4.*base.delaywrite.*delayed update of write time 3a$ +samba4.*base.delaywrite.*delayed update of write time 3c$ +samba4.*base.delaywrite.*update of write time using SET_END_OF_FILE$ +samba4.*base.delaywrite.*update of write time using SET_ALLOCATION_SIZE$ +samba4.ldap.python \(dc\).Test add_ldif\(\) with BASE64 security descriptor input using WRONG domain SID$ # some operations don't work over the CIFS NTVFS backend yet (eg. root_fid) samba4.ntvfs.cifs.base.createx_access samba4.ntvfs.cifs.base.createx_sharemodes_dir diff --git a/source4/selftest/tests.sh b/source4/selftest/tests.sh index f832b4f15e..bf6127f4a5 100755 --- a/source4/selftest/tests.sh +++ b/source4/selftest/tests.sh @@ -85,7 +85,7 @@ smb4torture="$samba4bindir/smbtorture${EXEEXT}" if which tap2subunit 2>/dev/null; then TAP2SUBUNIT=tap2subunit else - TAP2SUBUNIT="PYTHONPATH=$samba4srcdir/../lib/subunit/python $PYTHON $samba4srcdir/../lib/subunit/filters/tap2subunit" + TAP2SUBUNIT="PYTHONPATH=$samba4srcdir/../lib/subunit/python:$samba4srcdir/../lib/testtools $PYTHON $samba4srcdir/../lib/subunit/filters/tap2subunit" fi $smb4torture -V @@ -466,15 +466,15 @@ plantest "samba3sam.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/dsdb/samd plantest "subunit.python" none $SUBUNITRUN subunit plantest "rpcecho.python" dc:local $SUBUNITRUN samba.tests.dcerpc.rpcecho plantest "winreg.python" dc:local $SUBUNITRUN -U\$USERNAME%\$PASSWORD samba.tests.dcerpc.registry -plantest "ldap.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/ldap.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN -plantest "urgent_replication.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/urgent_replication.py \$PREFIX_ABS/dc/private/sam.ldb -plantest "ldap_schema.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/ldap_schema.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN +plantest "ldap.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/ldap.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN +plantest "urgent_replication.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/urgent_replication.py \$PREFIX_ABS/dc/private/sam.ldb +plantest "ldap_schema.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/ldap_schema.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN plantest "ldap.possibleInferiors.python" dc $PYTHON $samba4srcdir/dsdb/samdb/ldb_modules/tests/possibleinferiors.py $CONFIGURATION ldap://\$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN -plantest "ldap.secdesc.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/sec_descriptor.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN -plantest "ldap.acl.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/acl.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN +plantest "ldap.secdesc.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/sec_descriptor.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN +plantest "ldap.acl.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/acl.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN plantest "xattr.python" none $SUBUNITRUN samba.tests.xattr plantest "ntacls.python" none $SUBUNITRUN samba.tests.ntacls -plantest "deletetest.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/deletetest.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN +plantest "deletetest.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/deletetest.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN plantest "blackbox.samba3dump" none $PYTHON $samba4srcdir/scripting/bin/samba3dump $samba4srcdir/../testdata/samba3 rm -rf $PREFIX/upgrade plantest "blackbox.upgrade" none $PYTHON $samba4srcdir/setup/upgrade_from_s3 $CONFIGURATION --targetdir=$PREFIX/upgrade $samba4srcdir/../testdata/samba3 ../testdata/samba3/smb.conf diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 81e90f88c8..8a5c24ca79 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -2095,13 +2095,6 @@ static int cxd_find_known(struct createx_data *cxd) return -1; } -#define FILL_NTCREATEX(_struct, _init...) \ - do { \ - (_struct)->generic.level = RAW_OPEN_NTCREATEX; \ - (_struct)->ntcreatex.in \ - = (__typeof__((_struct)->ntcreatex.in)) {_init}; \ - } while (0) - #define CREATEX_NAME "\\createx_dir" static bool createx_make_dir(struct torture_context *tctx, @@ -2124,15 +2117,16 @@ static bool createx_make_file(struct torture_context *tctx, bool ret = true; NTSTATUS status; - FILL_NTCREATEX(&open_parms, - .flags = 0, - .access_mask = SEC_RIGHTS_FILE_ALL, - .file_attr = FILE_ATTRIBUTE_NORMAL, - .share_access = 0, - .open_disposition = NTCREATEX_DISP_CREATE, - .create_options = 0, - .fname = fname - ); + ZERO_STRUCT(open_parms); + open_parms.generic.level = RAW_OPEN_NTCREATEX; + open_parms.ntcreatex.in.flags = 0; + open_parms.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; + open_parms.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL; + open_parms.ntcreatex.in.share_access = 0; + open_parms.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE; + open_parms.ntcreatex.in.create_options = 0; + open_parms.ntcreatex.in.fname = fname; + status = smb_raw_open(tree, mem_ctx, &open_parms); CHECK_STATUS(status, NT_STATUS_OK); @@ -2146,30 +2140,30 @@ static bool createx_make_file(struct torture_context *tctx, static void createx_fill_dir(union smb_open *open_parms, int accessmode, int sharemode, const char *fname) { - FILL_NTCREATEX(open_parms, - .flags = 0, - .access_mask = accessmode, - .file_attr = FILE_ATTRIBUTE_DIRECTORY, - .share_access = sharemode, - .open_disposition = NTCREATEX_DISP_OPEN_IF, - .create_options = NTCREATEX_OPTIONS_DIRECTORY, - .fname = fname - ); + ZERO_STRUCTP(open_parms); + open_parms->generic.level = RAW_OPEN_NTCREATEX; + open_parms->ntcreatex.in.flags = 0; + open_parms->ntcreatex.in.access_mask = accessmode; + open_parms->ntcreatex.in.file_attr = FILE_ATTRIBUTE_DIRECTORY; + open_parms->ntcreatex.in.share_access = sharemode; + open_parms->ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF; + open_parms->ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY; + open_parms->ntcreatex.in.fname = fname; } static void createx_fill_file(union smb_open *open_parms, int accessmode, int sharemode, const char *fname) { - FILL_NTCREATEX(open_parms, - .flags = 0, - .access_mask = accessmode, - .file_attr = FILE_ATTRIBUTE_NORMAL, - .share_access = sharemode, - .open_disposition = NTCREATEX_DISP_OPEN_IF, - .create_options = 0, - .fname = fname, - .root_fid = { .fnum = 0 } - ); + ZERO_STRUCTP(open_parms); + open_parms->generic.level = RAW_OPEN_NTCREATEX; + open_parms->ntcreatex.in.flags = 0; + open_parms->ntcreatex.in.access_mask = accessmode; + open_parms->ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL; + open_parms->ntcreatex.in.share_access = sharemode; + open_parms->ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF; + open_parms->ntcreatex.in.create_options = 0; + open_parms->ntcreatex.in.fname = fname; + open_parms->ntcreatex.in.root_fid.fnum = 0; } static int data_file_fd = -1; @@ -2184,15 +2178,16 @@ static bool createx_test_dir(struct torture_context *tctx, union smb_open open_parms; /* bypass original handle to guarantee creation */ - FILL_NTCREATEX(&open_parms, - .flags = 0, - .access_mask = SEC_RIGHTS_FILE_ALL, - .file_attr = FILE_ATTRIBUTE_NORMAL, - .share_access = 0, - .open_disposition = NTCREATEX_DISP_CREATE, - .create_options = 0, - .fname = CREATEX_NAME "\\" KNOWN - ); + ZERO_STRUCT(open_parms); + open_parms.generic.level = RAW_OPEN_NTCREATEX; + open_parms.ntcreatex.in.flags = 0; + open_parms.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; + open_parms.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL; + open_parms.ntcreatex.in.share_access = 0; + open_parms.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE; + open_parms.ntcreatex.in.create_options = 0; + open_parms.ntcreatex.in.fname = CREATEX_NAME "\\" KNOWN; + status = smb_raw_open(tree, mem_ctx, &open_parms); CHECK_STATUS(status, NT_STATUS_OK); smbcli_close(tree, open_parms.ntcreatex.out.file.fnum); @@ -2200,32 +2195,32 @@ static bool createx_test_dir(struct torture_context *tctx, result[CXD_DIR_ENUMERATE] = NT_STATUS_OK; /* try to create a child */ - FILL_NTCREATEX(&open_parms, - .flags = 0, - .access_mask = SEC_RIGHTS_FILE_ALL, - .file_attr = FILE_ATTRIBUTE_NORMAL, - .share_access = 0, - .open_disposition = NTCREATEX_DISP_CREATE, - .create_options = 0, - .fname = CHILD, - .root_fid = { .fnum = fnum } - ); + ZERO_STRUCT(open_parms); + open_parms.generic.level = RAW_OPEN_NTCREATEX; + open_parms.ntcreatex.in.flags = 0; + open_parms.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; + open_parms.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL; + open_parms.ntcreatex.in.share_access = 0; + open_parms.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE; + open_parms.ntcreatex.in.create_options = 0; + open_parms.ntcreatex.in.fname = CHILD; + open_parms.ntcreatex.in.root_fid.fnum = fnum; result[CXD_DIR_CREATE_CHILD] = smb_raw_open(tree, mem_ctx, &open_parms); smbcli_close(tree, open_parms.ntcreatex.out.file.fnum); /* try to traverse dir to known good file */ - FILL_NTCREATEX(&open_parms, - .flags = 0, - .access_mask = SEC_RIGHTS_FILE_ALL, - .file_attr = FILE_ATTRIBUTE_NORMAL, - .share_access = 0, - .open_disposition = NTCREATEX_DISP_OPEN, - .create_options = 0, - .fname = KNOWN, - .root_fid = {.fnum = fnum} - ); + ZERO_STRUCT(open_parms); + open_parms.generic.level = RAW_OPEN_NTCREATEX; + open_parms.ntcreatex.in.flags = 0; + open_parms.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; + open_parms.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL; + open_parms.ntcreatex.in.share_access = 0; + open_parms.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN; + open_parms.ntcreatex.in.create_options = 0; + open_parms.ntcreatex.in.fname = KNOWN; + open_parms.ntcreatex.in.root_fid.fnum = fnum; result[CXD_DIR_TRAVERSE] = smb_raw_open(tree, mem_ctx, &open_parms); diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index e37fd8e09a..42f693e78c 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -1787,17 +1787,9 @@ done: return ret; } -#define FILL_NTCREATEX(_struct, _init...) \ - do { \ - (_struct)->generic.level = RAW_OPEN_NTCREATEX; \ - (_struct)->ntcreatex.in \ - = (typeof((_struct)->ntcreatex.in)) {_init};\ - } while (0) - static bool test_ntcreatex_opendisp_dir(struct torture_context *tctx, struct smbcli_state *cli) { - union smb_open io; const char *dname = BASEDIR "\\torture_ntcreatex_opendisp_dir"; NTSTATUS status; bool ret = true; @@ -1822,20 +1814,21 @@ static bool test_ntcreatex_opendisp_dir(struct torture_context *tctx, { 6, true, NT_STATUS_INVALID_PARAMETER }, { 6, false, NT_STATUS_INVALID_PARAMETER }, }; + union smb_open io; + + ZERO_STRUCT(io); + io.generic.level = RAW_OPEN_NTCREATEX; + io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED; + io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; + io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_DIRECTORY; + io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE; + io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY; + io.ntcreatex.in.fname = dname; if (!torture_setup_dir(cli, BASEDIR)) { return false; } - FILL_NTCREATEX(&io, - .flags = NTCREATEX_FLAGS_EXTENDED, - .access_mask = SEC_FLAG_MAXIMUM_ALLOWED, - .file_attr = FILE_ATTRIBUTE_DIRECTORY, - .share_access = NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE, - .create_options = NTCREATEX_OPTIONS_DIRECTORY, - .fname = dname, - ); - smbcli_rmdir(cli->tree, dname); smbcli_unlink(cli->tree, dname); diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index 53e860a144..2aa340ee36 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -354,12 +354,18 @@ static void simple_warning(struct torture_context *test, fprintf(stderr, "WARNING: %s\n", comment); } +static void simple_progress(struct torture_context *test, + int offset, enum torture_progress_whence whence) +{ +} + const static struct torture_ui_ops std_ui_ops = { .comment = simple_comment, .warning = simple_warning, .suite_start = simple_suite_start, .suite_finish = simple_suite_finish, - .test_result = simple_test_result + .test_result = simple_test_result, + .progress = simple_progress, }; |