From: Christof Schmitt Date: Fri, 12 Apr 2024 22:48:02 +0000 (-0700) Subject: tdb: Add test for tdbdump -x X-Git-Tag: tdb-1.4.11~1102 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a55ee1107bf76d49eaef7545c6f88511bf1d34e;p=thirdparty%2Fsamba.git tdb: Add test for tdbdump -x Signed-off-by: Christof Schmitt Reviewed-by: Andrew Bartlett --- diff --git a/lib/tdb/test/sample_tdb_x.txt b/lib/tdb/test/sample_tdb_x.txt new file mode 100644 index 00000000000..dbba20b4813 --- /dev/null +++ b/lib/tdb/test/sample_tdb_x.txt @@ -0,0 +1,12 @@ +{ +key(11) = "6E62745F73657276657200" +data(35) = "3937322E323134373438333634382F3130383537303633313337383637393533393200" +} +{ +key(15) = "77696E62696E645F73657276657200" +data(25) = "3937372F313238323635343237313530393738393834303700" +} +{ +key(14) = "6E6F746966792D6461656D6F6E00" +data(24) = "3939322F3633383936333832333534373439333635393800" +} diff --git a/lib/tdb/test/test_tdbdump.sh b/lib/tdb/test/test_tdbdump.sh index 08802f516a6..2849313e50c 100755 --- a/lib/tdb/test/test_tdbdump.sh +++ b/lib/tdb/test/test_tdbdump.sh @@ -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 diff --git a/lib/tdb/wscript b/lib/tdb/wscript index e99800e9025..04121498723 100644 --- a/lib/tdb/wscript +++ b/lib/tdb/wscript @@ -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)