summaryrefslogtreecommitdiff
path: root/lib/ntdb
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-06-20 21:31:21 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-06-20 16:50:20 +0200
commit5ec43055103f8890e957a163f094431fcdbcbd74 (patch)
tree3a224d10a2890bb6a3bfed9303c07f2635851f7d /lib/ntdb
parentab96359bfefa08eddfb688137ca07c1efcbb494f (diff)
downloadsamba-5ec43055103f8890e957a163f094431fcdbcbd74.tar.gz
samba-5ec43055103f8890e957a163f094431fcdbcbd74.tar.bz2
samba-5ec43055103f8890e957a163f094431fcdbcbd74.zip
ntdb: fix occasional abort in testing.
Occasionally, the capability test inserts multiple used records and they clash, but our primitive test layout engine doesn't handle hash clashes and aborts. Force a seed value which we know doesn't clash. Reported-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Wed Jun 20 16:50:20 CEST 2012 on sn-devel-104
Diffstat (limited to 'lib/ntdb')
-rw-r--r--lib/ntdb/test/run-capabilities.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ntdb/test/run-capabilities.c b/lib/ntdb/test/run-capabilities.c
index cb03746862..6503214c06 100644
--- a/lib/ntdb/test/run-capabilities.c
+++ b/lib/ntdb/test/run-capabilities.c
@@ -30,6 +30,12 @@ static void create_ntdb(const char *name,
struct ntdb_layout *layout;
struct ntdb_context *ntdb;
int fd, clen;
+ union ntdb_attribute seed_attr;
+
+ /* Force a seed which doesn't allow records to clash! */
+ seed_attr.base.attr = NTDB_ATTRIBUTE_SEED;
+ seed_attr.base.next = &tap_log_attr;
+ seed_attr.seed.seed = 0;
key = ntdb_mkdata("Hello", 5);
data = ntdb_mkdata("world", 5);
@@ -61,7 +67,7 @@ static void create_ntdb(const char *name,
va_end(ap);
/* We open-code this, because we need to use the failtest write. */
- ntdb = ntdb_layout_get(layout, failtest_free, &tap_log_attr);
+ ntdb = ntdb_layout_get(layout, failtest_free, &seed_attr);
fd = open(name, O_RDWR|O_TRUNC|O_CREAT, 0600);
if (fd < 0)