svn commit: samba r19350 - in branches/SAMBA_4_0: . source
source/bin/install source/bin/install/torture
source/build/smb_build source/lib/talloc source/script
source/torture source/torture/local
jelmer at samba.org
jelmer at samba.org
Mon Oct 16 23:09:20 GMT 2006
Author: jelmer
Date: 2006-10-16 23:09:15 +0000 (Mon, 16 Oct 2006)
New Revision: 19350
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19350
Log:
Properly list LOCAL-TALLOC under the "LOCAL" header.
Support directories for subcategories in tests.
Several small other fixes.
Added:
branches/SAMBA_4_0/source/bin/install/torture/
branches/SAMBA_4_0/source/bin/install/torture/LOCAL/
branches/SAMBA_4_0/source/script/installtorture.sh
branches/SAMBA_4_0/source/script/uninstalltorture.sh
Modified:
branches/SAMBA_4_0/
branches/SAMBA_4_0/.bzrignore
branches/SAMBA_4_0/source/build/smb_build/makefile.pm
branches/SAMBA_4_0/source/lib/talloc/config.mk
branches/SAMBA_4_0/source/main.mk
branches/SAMBA_4_0/source/torture/local/dbspeed.c
branches/SAMBA_4_0/source/torture/smbtorture.c
branches/SAMBA_4_0/source/torture/torture.c
branches/SAMBA_4_0/source/torture/torture.h
branches/SAMBA_4_0/source/torture/ui.c
branches/SAMBA_4_0/source/torture/ui.h
Changeset:
Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:merge
- jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
+ jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
Modified: branches/SAMBA_4_0/.bzrignore
===================================================================
--- branches/SAMBA_4_0/.bzrignore 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/.bzrignore 2006-10-16 23:09:15 UTC (rev 19350)
@@ -130,3 +130,4 @@
source/winbind/wb_helper.h
source/winbind/wb_proto.h
source/wrepl_server/wrepl_server_proto.h
+tags
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2006-10-16 23:09:15 UTC (rev 19350)
@@ -366,18 +366,17 @@
my ($self,$ctx) = @_;
my $installdir;
- my $localdir;
+ my $extradir = "";
- if (defined($ctx->{INSTALLDIR}) && $ctx->{INSTALLDIR} eq "TORTUREDIR") {
- $localdir = "bin/torture";
- } else {
- $localdir = "bin";
+ if (defined($ctx->{INSTALLDIR}) && $ctx->{INSTALLDIR} =~ /^TORTUREDIR/) {
+ $extradir = "/torture" . substr($ctx->{INSTALLDIR}, length("TORTUREDIR"));
}
+ my $localdir = "bin$extradir";
if ($self->{duplicate_build}) {
- $installdir = "bin/install";
+ $installdir = "bin/install$extradir";
} else {
- $installdir = $localdir;
+ $installdir = "bin$extradir";
}
push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)");
@@ -387,7 +386,7 @@
push (@{$self->{sbin_progs}}, "$installdir/$ctx->{BINARY}");
} elsif ($ctx->{INSTALLDIR} eq "BINDIR") {
push (@{$self->{bin_progs}}, "$installdir/$ctx->{BINARY}");
- } elsif ($ctx->{INSTALLDIR} eq "TORTUREDIR") {
+ } elsif ($ctx->{INSTALLDIR} =~ /^TORTUREDIR/) {
push (@{$self->{torture_progs}}, "$installdir/$ctx->{BINARY}");
}
Modified: branches/SAMBA_4_0/source/lib/talloc/config.mk
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/config.mk 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/lib/talloc/config.mk 2006-10-16 23:09:15 UTC (rev 19350)
@@ -12,7 +12,7 @@
# End LIBRARY LIBTALLOC
################################################
-[BINARY::LOCAL-TALLOC]
+[BINARY::TALLOC]
OBJ_FILES = testsuite.o
PRIVATE_DEPENDENCIES = LIBTALLOC
-INSTALLDIR = TORTUREDIR
+INSTALLDIR = TORTUREDIR/LOCAL
Modified: branches/SAMBA_4_0/source/main.mk
===================================================================
--- branches/SAMBA_4_0/source/main.mk 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/main.mk 2006-10-16 23:09:15 UTC (rev 19350)
@@ -136,12 +136,9 @@
$(DESTDIR)$(LIBDIR) \
$(DESTDIR)$(VARDIR) \
$(BIN_PROGS)
- @$(SHELL) $(srcdir)/script/installbin.sh \
+ @$(SHELL) $(srcdir)/script/installtorture.sh \
$(INSTALLPERMS) \
- $(DESTDIR)$(BASEDIR) \
$(DESTDIR)$(TORTUREDIR) \
- $(DESTDIR)$(LIBDIR) \
- $(DESTDIR)$(VARDIR) \
$(TORTURE_PROGS)
installlib: $(INSTALLABLE_SHARED_LIBS) $(STATIC_LIBS) installdirs
@@ -175,7 +172,7 @@
uninstallbin:
@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)
- @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(TORTUREDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(TORTURE_PROGS)
+ @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
uninstalllib:
@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(LIBDIR) $(SHARED_LIBS)
Added: branches/SAMBA_4_0/source/script/installtorture.sh
===================================================================
--- branches/SAMBA_4_0/source/script/installtorture.sh 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/script/installtorture.sh 2006-10-16 23:09:15 UTC (rev 19350)
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+INSTALLPERMS=$1
+TORTUREDIR=$2
+shift
+shift
+
+for p in $*; do
+ p2=`dirname $p`
+ base=`basename $p`
+ DESTDIR=$TORTUREDIR/`basename $p2`
+ mkdir -p $DESTDIR
+ echo Installing $p as $DESTDIR/$base
+ cp -f $p $DESTDIR/
+ chmod $INSTALLPERMS $DESTDIR/$base
+done
+
+exit 0
Property changes on: branches/SAMBA_4_0/source/script/installtorture.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/SAMBA_4_0/source/script/uninstalltorture.sh
===================================================================
--- branches/SAMBA_4_0/source/script/uninstalltorture.sh 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/script/uninstalltorture.sh 2006-10-16 23:09:15 UTC (rev 19350)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+TORTUREDIR=$1
+shift
+shift
+
+for p in $*; do
+ p2=`dirname $p`
+ base=`basename $p`
+ DESTDIR=$TORTUREDIR/`basename $p2`
+ echo Removing $DESTDIR/$base
+ rm -f $p $DESTDIR/
+done
+
+exit 0
Property changes on: branches/SAMBA_4_0/source/script/uninstalltorture.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: branches/SAMBA_4_0/source/torture/local/dbspeed.c
===================================================================
--- branches/SAMBA_4_0/source/torture/local/dbspeed.c 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/torture/local/dbspeed.c 2006-10-16 23:09:15 UTC (rev 19350)
@@ -245,7 +245,7 @@
struct torture_suite *torture_local_dbspeed(TALLOC_CTX *mem_ctx)
{
- struct torture_suite *s = torture_suite_create(mem_ctx, "LOCAL-DBSPEED");
+ struct torture_suite *s = torture_suite_create(mem_ctx, "DBSPEED");
torture_suite_add_simple_tcase(s, "tdb_speed", test_tdb_speed, NULL);
torture_suite_add_simple_tcase(s, "ldb_speed", test_ldb_speed, NULL);
return s;
Modified: branches/SAMBA_4_0/source/torture/smbtorture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/smbtorture.c 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/torture/smbtorture.c 2006-10-16 23:09:15 UTC (rev 19350)
@@ -43,18 +43,18 @@
bool ret = true;
if (suite == NULL) {
- struct torture_suite_list *o;
+ struct torture_suite *o;
- for (o = torture_suites; o; o = o->next) {
- if (gen_fnmatch(expr, o->suite->name) == 0) {
+ for (o = torture_root->children; o; o = o->next) {
+ if (gen_fnmatch(expr, o->name) == 0) {
*matched = true;
init_iconv();
- ret &= torture_run_suite(torture, o->suite);
+ ret &= torture_run_suite(torture, o);
continue;
}
ret &= run_matching(torture,
- o->suite->name, expr, o->suite, matched);
+ o->name, expr, o, matched);
}
} else {
char *name;
@@ -99,11 +99,11 @@
{
bool ret = true;
bool matched = false;
- struct torture_suite_list *o;
+ struct torture_suite *o;
if (strequal(name, "ALL")) {
- for (o = torture_suites; o; o = o->next) {
- ret &= torture_run_suite(torture, o->suite);
+ for (o = torture_root->children; o; o = o->next) {
+ ret &= torture_run_suite(torture, o);
}
return ret;
}
@@ -160,7 +160,7 @@
static void usage(poptContext pc)
{
- struct torture_suite_list *o;
+ struct torture_suite *o;
struct torture_suite *s;
struct torture_tcase *t;
int i;
@@ -217,24 +217,24 @@
printf("Tests are:");
- for (o = torture_suites; o; o = o->next) {
- printf("\n%s (%s):\n ", o->suite->description, o->suite->name);
+ for (o = torture_root->children; o; o = o->next) {
+ printf("\n%s (%s):\n ", o->description, o->name);
i = 0;
- for (s = o->suite->children; s; s = s->next) {
- if (i + strlen(o->suite->name) + strlen(s->name) >= (MAX_COLS - 3)) {
+ for (s = o->children; s; s = s->next) {
+ if (i + strlen(o->name) + strlen(s->name) >= (MAX_COLS - 3)) {
printf("\n ");
i = 0;
}
- i+=printf("%s-%s ", o->suite->name, s->name);
+ i+=printf("%s-%s ", o->name, s->name);
}
- for (t = o->suite->testcases; t; t = t->next) {
- if (i + strlen(o->suite->name) + strlen(t->name) >= (MAX_COLS - 3)) {
+ for (t = o->testcases; t; t = t->next) {
+ if (i + strlen(o->name) + strlen(t->name) >= (MAX_COLS - 3)) {
printf("\n ");
i = 0;
}
- i+=printf("%s-%s ", o->suite->name, t->name);
+ i+=printf("%s-%s ", o->name, t->name);
}
if (i) printf("\n");
@@ -532,10 +532,10 @@
subunit_dir = lp_parm_string_list(-1, "torture", "subunitdir", ":");
if (subunit_dir == NULL)
- torture_subunit_load_testsuites(dyn_TORTUREDIR);
+ torture_subunit_load_testsuites(dyn_TORTUREDIR, true, NULL);
else {
for (i = 0; subunit_dir[i]; i++)
- torture_subunit_load_testsuites(subunit_dir[i]);
+ torture_subunit_load_testsuites(subunit_dir[i], true, NULL);
}
Modified: branches/SAMBA_4_0/source/torture/torture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/torture.c 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/torture/torture.c 2006-10-16 23:09:15 UTC (rev 19350)
@@ -33,42 +33,23 @@
_PUBLIC_ int torture_numasync=100;
_PUBLIC_ bool torture_showall = false;
-struct torture_suite_list *torture_suites = NULL;
+struct torture_suite *torture_root = NULL;
-NTSTATUS torture_register_suite(struct torture_suite *suite)
+bool torture_register_suite(struct torture_suite *suite)
{
- struct torture_suite_list *p, *n;
+ if (!suite)
+ return true;
- if (!suite) {
- return NT_STATUS_OK;
- }
-
- n = talloc(talloc_autofree_context(), struct torture_suite_list);
- n->suite = suite;
-
- for (p = torture_suites; p; p = p->next) {
- if (strcmp(p->suite->name, suite->name) == 0) {
- /* Check for duplicates */
- DEBUG(0,("There already is a suite registered with the name %s!\n", suite->name));
- return NT_STATUS_OBJECT_NAME_COLLISION;
- }
-
- if (strcmp(p->suite->name, suite->name) < 0 &&
- (!p->next || strcmp(p->next->suite->name, suite->name) > 0)) {
- DLIST_ADD_AFTER(torture_suites, n, p);
- return NT_STATUS_OK;
- }
- }
-
- DLIST_ADD_END(torture_suites, n, struct torture_suite_list *);
-
- return NT_STATUS_OK;
+ return torture_suite_add_suite(torture_root, suite);
}
int torture_init(void)
{
init_module_fn static_init[] = STATIC_torture_MODULES;
init_module_fn *shared_init = load_samba_modules(NULL, "torture");
+
+ torture_root = talloc_zero(talloc_autofree_context(),
+ struct torture_suite);
run_init_functions(static_init);
run_init_functions(shared_init);
Modified: branches/SAMBA_4_0/source/torture/torture.h
===================================================================
--- branches/SAMBA_4_0/source/torture/torture.h 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/torture/torture.h 2006-10-16 23:09:15 UTC (rev 19350)
@@ -26,13 +26,8 @@
struct smbcli_state;
-struct torture_suite_list {
- struct torture_suite *suite;
- struct torture_suite_list *prev, *next;
-};
+extern struct torture_suite *torture_root;
-extern struct torture_suite_list * torture_suites;
-
extern BOOL use_oplocks;
extern BOOL torture_showall;
extern int torture_entries;
Modified: branches/SAMBA_4_0/source/torture/ui.c
===================================================================
--- branches/SAMBA_4_0/source/torture/ui.c 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/torture/ui.c 2006-10-16 23:09:15 UTC (rev 19350)
@@ -394,9 +394,14 @@
}
-struct torture_suite *torture_find_suite(const char *name)
+struct torture_suite *torture_find_suite(struct torture_suite *parent,
+ const char *name)
{
- /* FIXME */
+ struct torture_suite *child;
+ for (child = parent->children; child; child = child->next)
+ if (!strcmp(child->name, name))
+ return child;
+
return NULL;
}
Modified: branches/SAMBA_4_0/source/torture/ui.h
===================================================================
--- branches/SAMBA_4_0/source/torture/ui.h 2006-10-16 23:06:48 UTC (rev 19349)
+++ branches/SAMBA_4_0/source/torture/ui.h 2006-10-16 23:09:15 UTC (rev 19350)
@@ -294,4 +294,8 @@
/* Helper function commonly used */
bool torture_teardown_free(struct torture_context *torture, void *data);
+struct torture_suite *torture_find_suite(struct torture_suite *parent,
+ const char *name);
+
+
#endif /* __TORTURE_UI_H__ */
More information about the samba-cvs
mailing list