[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Wed Apr 25 20:01:03 MDT 2012


The branch, master has been updated
       via  ed9f903 s4-torture: never return false in the raw.composite torture test
       via  d913a94 selftest: push --target selection into plansmbtorturetestsuite
      from  a7ffbf4 s4:torture: add a rpc.samba3.smb-reauth2 test

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ed9f903b12e6c38e0d467a7b0722fa0410056cf2
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Apr 26 10:13:37 2012 +1000

    s4-torture: never return false in the raw.composite torture test
    
    We must use torture_assert() macros to ensure that the failure is
    recorded in the subunit stream correctly, rather than being returned
    as an unknown 'error'.  (We cannot handle error results as knownfail).
    
    Andrew Bartlett
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Thu Apr 26 04:00:16 CEST 2012 on sn-devel-104

commit d913a94eebddd815db7babc80fa5048137df65f7
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Apr 26 08:27:37 2012 +1000

    selftest: push --target selection into plansmbtorturetestsuite

-----------------------------------------------------------------------

Summary of changes:
 source3/selftest/tests.py       |    7 +++--
 source4/torture/raw/composite.c |   46 ++++++---------------------------------
 2 files changed, 11 insertions(+), 42 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 70c8fe0..1a11081 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -28,7 +28,7 @@ configuration = "--configfile=$SMB_CONF_PATH"
 scriptdir=os.path.join(samba3srcdir, "../script/tests")
 
 torture_options = [configuration, "--maximum-runtime=$SELFTEST_MAXTIME", 
-                   "--target=samba3", "--basedir=$SELFTEST_TMPDIR",
+                   "--basedir=$SELFTEST_TMPDIR",
                    '--option="torture:winbindd_netbios_name=$SERVER"',
                    '--option="torture:winbindd_netbios_domain=$DOMAIN"', 
                    '--option=torture:sharedelay=100000',
@@ -53,8 +53,9 @@ def smb4torture_testsuites(prefix):
     return filter(lambda x: x.startswith(prefix), smb4torture_testsuite_list)
 
 def plansmbtorturetestsuite(name, env, options, description=''):
-    modname = "samba3.%s %s" % (name, description)
-    cmdline = "%s $LISTOPT %s %s" % (valgrindify(smb4torture), options, name)
+    target = "samba3"
+    modname = "%s.%s %s" % (target, name, description)
+    cmdline = "%s $LISTOPT %s --target=%s %s" % (valgrindify(smb4torture), options, target, name)
     if smb4torture_possible:
         plantestsuite_loadlist(modname, env, cmdline)
 
diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c
index bb028b8..1c02e40 100644
--- a/source4/torture/raw/composite.c
+++ b/source4/torture/raw/composite.c
@@ -58,10 +58,6 @@ static bool test_loadfile(struct torture_context *tctx, struct smbcli_state *cli
 	int i;
 	int *count = talloc_zero(tctx, int);
 
-	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
-	}
-
 	data = talloc_array(tctx, uint8_t, len);
 
 	generate_random_buffer(data, len);
@@ -113,9 +109,7 @@ static bool test_loadfile(struct torture_context *tctx, struct smbcli_state *cli
 static bool test_loadfile_t(struct torture_context *tctx, struct smbcli_state *cli)
 {
 	int ret;
-	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
-	}
+	torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "failed to setup " BASEDIR);
 
 	ret = test_loadfile(tctx, cli);
 	smb_raw_exit(cli->session);
@@ -142,10 +136,6 @@ static bool test_fetchfile(struct torture_context *tctx, struct smbcli_state *cl
 	int *count = talloc_zero(tctx, int);
 	bool ret = true;
 
-	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
-	}
-
 	data = talloc_array(tctx, uint8_t, len);
 
 	generate_random_buffer(data, len);
@@ -213,10 +203,7 @@ static bool test_fetchfile(struct torture_context *tctx, struct smbcli_state *cl
 static bool test_fetchfile_t(struct torture_context *tctx, struct smbcli_state *cli)
 {
 	int ret;
-	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
-	}
-
+	torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "failed to setup " BASEDIR);
 	ret = test_fetchfile(tctx, cli);
 	smb_raw_exit(cli->session);
 	smbcli_deltree(cli->tree, BASEDIR);
@@ -245,10 +232,6 @@ static bool test_appendacl(struct torture_context *tctx, struct smbcli_state *cl
 	NTSTATUS status;
 	int i;
 
-	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
-	}
-
 	io_orig = talloc_array(tctx, struct smb_composite_appendacl *, num_ops);
 
 	printf ("creating %d empty files and getting their acls with appendacl\n", num_ops);
@@ -259,19 +242,13 @@ static bool test_appendacl(struct torture_context *tctx, struct smbcli_state *cl
 		io1.in.size  = 0;
 	  
 		status = smb_composite_savefile(cli->tree, &io1);
-		if (!NT_STATUS_IS_OK(status)) {
-			torture_comment(tctx, "(%s) savefile failed: %s\n", __location__, nt_errstr(status));
-			return false;
-		}
+		torture_assert_ntstatus_equal(tctx, status, NT_STATUS_OK, "savefile failed");
 
 		io_orig[i] = talloc (io_orig, struct smb_composite_appendacl);
 		io_orig[i]->in.fname = talloc_steal(io_orig[i], io1.in.fname);
 		io_orig[i]->in.sd = security_descriptor_initialise(io_orig[i]);
 		status = smb_composite_appendacl(cli->tree, io_orig[i], io_orig[i]);
-		if (!NT_STATUS_IS_OK(status)) {
-			torture_comment(tctx, "(%s) appendacl failed: %s\n", __location__, nt_errstr(status));
-			return false;
-		}
+		torture_assert_ntstatus_equal(tctx, status, NT_STATUS_OK, "appendacl failed");
 	}
 	
 
@@ -288,10 +265,7 @@ static bool test_appendacl(struct torture_context *tctx, struct smbcli_state *cl
 	ace->trustee = *test_sid;
 
 	status = security_descriptor_dacl_add(test_sd, ace);
-	if (!NT_STATUS_IS_OK(status)) {
-		torture_comment(tctx, "(%s) appendacl failed: %s\n", __location__, nt_errstr(status));
-		return false;
-	}
+	torture_assert_ntstatus_equal(tctx, status, NT_STATUS_OK, "appendacl failed");
 
 	/* set parameters for appendacl async call */
 
@@ -346,10 +320,7 @@ static bool test_appendacl(struct torture_context *tctx, struct smbcli_state *cl
 static bool test_appendacl_t(struct torture_context *tctx, struct smbcli_state *cli)
 {
 	int ret;
-	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
-	}
-
+	torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "failed to setup " BASEDIR);
 	ret = test_appendacl(tctx, cli);
 	smb_raw_exit(cli->session);
 	smbcli_deltree(cli->tree, BASEDIR);
@@ -422,10 +393,7 @@ static bool test_fsinfo(struct torture_context *tctx, struct smbcli_state *cli)
 static bool test_fsinfo_t(struct torture_context *tctx, struct smbcli_state *cli)
 {
 	int ret;
-	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
-	}
-
+	torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "failed to setup " BASEDIR);
 	ret = test_fsinfo(tctx, cli);
 	smb_raw_exit(cli->session);
 	smbcli_deltree(cli->tree, BASEDIR);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list