summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2017-10-26 18:26:37 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2017-10-26 18:26:37 +0100
commitf38a45371faa9f914ef69b57cbf1890c609b81cd (patch)
tree657d052ca68acbf6f2818d29af77a6b52a712fad /test
parent4270f1e68b4cb718f2a3806efa768531c22d509b (diff)
Testsuite: create test db on-the-fliy for LMDB testcase
Diffstat (limited to 'test')
-rw-r--r--test/aux-fixed/2800.lmdb-mkdb-dump.py15
-rw-r--r--test/aux-fixed/2800.mdbbin12288 -> 0 bytes
-rw-r--r--test/aux-fixed/2800.mdb.src3
-rw-r--r--test/scripts/2800-lmdb/280035
4 files changed, 27 insertions, 26 deletions
diff --git a/test/aux-fixed/2800.lmdb-mkdb-dump.py b/test/aux-fixed/2800.lmdb-mkdb-dump.py
deleted file mode 100644
index 3de6ba13b..000000000
--- a/test/aux-fixed/2800.lmdb-mkdb-dump.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-import os
-import lmdb
-
-if os.path.exists('2800.mdb'):
- os.unlink('2800.mdb')
-
-env = lmdb.open('2800.mdb', subdir=False);
-with env.begin(write=True) as txn:
- txn.put('first', 'data for first')
- txn.put('second', 'A=1 B=2')
- txn.put('third', 'A1:B2:C3')
- cursor = txn.cursor()
- for key, value in cursor:
- print key, "=>", value
diff --git a/test/aux-fixed/2800.mdb b/test/aux-fixed/2800.mdb
deleted file mode 100644
index 2002ee1b5..000000000
--- a/test/aux-fixed/2800.mdb
+++ /dev/null
Binary files differ
diff --git a/test/aux-fixed/2800.mdb.src b/test/aux-fixed/2800.mdb.src
deleted file mode 100644
index 957952720..000000000
--- a/test/aux-fixed/2800.mdb.src
+++ /dev/null
@@ -1,3 +0,0 @@
-first: data for first
-second: A=1 B=2
-third: A1:B2:C3
diff --git a/test/scripts/2800-lmdb/2800 b/test/scripts/2800-lmdb/2800
index a074ae628..930f9f2bc 100644
--- a/test/scripts/2800-lmdb/2800
+++ b/test/scripts/2800-lmdb/2800
@@ -1,11 +1,30 @@
# lmdb lookup
+#
+# prep a test database to work with
+perl -e 'chdir "DIR/aux-var"; exec "mdb_load -n DIR/aux-var/TESTNUM.mdb";'
+VERSION=3
+format=print
+type=btree
+mapsize=10485760
+maxreaders=126
+HEADER=END
+ first
+ data for first
+ second
+ A=1 B=2
+ third
+ A1:B2:C3
+DATA=END
+****
+#
+#
exim -be
-${lookup{first}lmdb{DIR/aux-fixed/TESTNUM.mdb}}
-${lookup{first}lmdb{DIR/aux-fixed/TESTNUM.mdb}{$value}fail}
-${lookup{fail}lmdb{DIR/aux-fixed/TESTNUM.mdb}{$value}{failure value}}
-${lookup{fail}lmdb{DIR/aux-fixed/TESTNUM.mdb}{$value}fail}
-${lookup{second}lmdb{DIR/aux-fixed/TESTNUM.mdb}{$value}fail}
-${extract{A}{${lookup{second}lmdb{DIR/aux-fixed/TESTNUM.mdb}{$value}fail}}}
-${extract{B}{${lookup{second}lmdb{DIR/aux-fixed/TESTNUM.mdb}{$value}fail}}}
-${extract{C}{${lookup{second}lmdb{DIR/aux-fixed/TESTNUM.mdb}{$value}fail}}{$value}fail}
+${lookup{first}lmdb{DIR/aux-var/TESTNUM.mdb}}
+${lookup{first}lmdb{DIR/aux-var/TESTNUM.mdb}{$value}fail}
+${lookup{fail}lmdb{DIR/aux-var/TESTNUM.mdb}{$value}{failure value}}
+${lookup{fail}lmdb{DIR/aux-var/TESTNUM.mdb}{$value}fail}
+${lookup{second}lmdb{DIR/aux-var/TESTNUM.mdb}{$value}fail}
+${extract{A}{${lookup{second}lmdb{DIR/aux-var/TESTNUM.mdb}{$value}fail}}}
+${extract{B}{${lookup{second}lmdb{DIR/aux-var/TESTNUM.mdb}{$value}fail}}}
+${extract{C}{${lookup{second}lmdb{DIR/aux-var/TESTNUM.mdb}{$value}fail}}{$value}fail}
****