]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tdb: Add test for tdbdump -x
authorChristof Schmitt <cs@samba.org>
Fri, 12 Apr 2024 22:48:02 +0000 (15:48 -0700)
committerChristof Schmitt <cs@samba.org>
Tue, 16 Apr 2024 17:32:34 +0000 (17:32 +0000)
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/tdb/test/sample_tdb_x.txt [new file with mode: 0644]
lib/tdb/test/test_tdbdump.sh
lib/tdb/wscript

diff --git a/lib/tdb/test/sample_tdb_x.txt b/lib/tdb/test/sample_tdb_x.txt
new file mode 100644 (file)
index 0000000..dbba20b
--- /dev/null
@@ -0,0 +1,12 @@
+{
+key(11) = "6E62745F73657276657200"
+data(35) = "3937322E323134373438333634382F3130383537303633313337383637393533393200"
+}
+{
+key(15) = "77696E62696E645F73657276657200"
+data(25) = "3937372F313238323635343237313530393738393834303700"
+}
+{
+key(14) = "6E6F746966792D6461656D6F6E00"
+data(24) = "3939322F3633383936333832333534373439333635393800"
+}
index 08802f516a66cb2c568065cbd60094c0190470b4..2849313e50c6397925b83c6eddef600d19669c4a 100755 (executable)
@@ -9,6 +9,7 @@ fi
 
 TDB_FILE=$1
 EXPECTED_DUMP=$2
+EXPECTED_DUMP_X=$3
 TEMP_DUMP=tempdump.txt
 
 failed=0
@@ -48,6 +49,10 @@ $BINDIR/tdbdump $TDB_FILE > $TEMP_DUMP
 testit "Verifying tdbdump" cmp $TEMP_DUMP $EXPECTED_DUMP \
        || failed=$(expr $failed + 1)
 
+$BINDIR/tdbdump -x $TDB_FILE > $TEMP_DUMP
+testit "Verifying tdbdump -x" cmp $TEMP_DUMP $EXPECTED_DUMP_X \
+       || failed=$(expr $failed + 1)
+
 rm $TEMP_DUMP
 
 exit $failed
index e99800e902582c7e4fa2e81f3679b5d48e1fbf45..0412149872377ab2639a922b601acfb81d9efda9 100644 (file)
@@ -217,7 +217,7 @@ def testonly(ctx):
             os.symlink(ctx.path.make_node('test').abspath(), link)
 
         sh_tests = ["test/test_tdbbackup.sh test/jenkins-be-hash.tdb",
-                    "test/test_tdbdump.sh test/sample_tdb.tdb test/sample_tdb.txt"]
+                    "test/test_tdbdump.sh test/sample_tdb.tdb test/sample_tdb.txt test/sample_tdb_x.txt"]
 
         for sh_test in sh_tests:
             cmd = "BINDIR=%s %s" % (blddir, sh_test)