[Git][reproducible-builds/diffoscope][master] Support Berkeley DB 6
Chris Lamb (@lamby)
gitlab at salsa.debian.org
Thu Dec 29 15:46:55 UTC 2022
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
ab87ab6a by Jelle van der Waa at 2022-12-29T15:33:40+00:00
Support Berkeley DB 6
- - - - -
2 changed files:
- tests/comparators/test_berkeley_db.py
- + tests/data/berkeley6_db_expected_diff
Changes:
=====================================
tests/comparators/test_berkeley_db.py
=====================================
@@ -16,18 +16,31 @@
# You should have received a copy of the GNU General Public License
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
+import subprocess
import pytest
from diffoscope.comparators.berkeley_db import BerkeleyDBFile
from ..utils.data import load_fixture, assert_diff
-from ..utils.tools import skip_unless_tools_exist
+from ..utils.tools import (
+ skip_unless_tools_exist,
+ skip_unless_tool_is_at_least,
+ skip_unless_tool_is_at_most,
+)
from ..utils.nonexisting import assert_non_existing
db1 = load_fixture("test1.db")
db2 = load_fixture("test2.db")
+def db_version():
+ try:
+ out = subprocess.check_output(["db_dump", "-V"])
+ except subprocess.CalledProcessError as e:
+ out = e.output
+ return out.decode("UTF-8").split()[2].replace(":", "")
+
+
def test_identification(db1):
assert isinstance(db1, BerkeleyDBFile)
@@ -43,10 +56,17 @@ def test_no_differences(db1):
@skip_unless_tools_exist("db_dump")
+ at skip_unless_tool_is_at_most("db_dump", db_version, "6.0")
def test_diff(differences):
assert_diff(differences[0], "berkeley_db_expected_diff")
+ at skip_unless_tools_exist("db_dump")
+ at skip_unless_tool_is_at_least("db_dump", db_version, "6.0")
+def test_diff6(differences):
+ assert_diff(differences[0], "berkeley6_db_expected_diff")
+
+
@skip_unless_tools_exist("db_dump")
def test_compare_non_existing(monkeypatch, db1):
assert_non_existing(monkeypatch, db1, has_null_source=False)
=====================================
tests/data/berkeley6_db_expected_diff
=====================================
@@ -0,0 +1,82 @@
+@@ -9,31 +9,27 @@
+ magic: 0x53162
+ version: 9
+ pagesize: 4096
+ type: 9
+ metaflags 0
+ keys: 0 records: 0
+ free list: 0
+- last_pgno: 7
++ last_pgno: 3
+ flags: 0x20 (multiple-databases)
+ minkey: 2
+ root: 1
+ blob_threshold: 0
+ blob_file_lo: 0
+ blob_file_hi: 0
+ blob_sdb_lo: 0
+ blob_sdb_hi: 0
+ page 1: btree leaf: LSN [0][1]: level 1
+- prev: 0 next: 0 entries: 6 offset: 4000
+- [000] 4040 len: 19 data: unstable|main|amd64
+- [001] 4032 len: 4 data: 00000004
+- [002] 4072 len: 18 data: unstable|main|i386
+- [003] 4064 len: 4 data: 00000002
+- [004] 4008 len: 20 data: unstable|main|source
+- [005] 4000 len: 4 data: 00000006
++ prev: 0 next: 0 entries: 2 offset: 4064
++ [000] 4072 len: 19 data: compressedfilelists
++ [001] 4064 len: 4 data: 00000002
+ page 2: btree metadata: LSN [0][1]: level 0
+ magic: 0x53162
+ version: 9
+ pagesize: 4096
+ type: 9
+ metaflags 0
+ keys: 0 records: 0
+@@ -45,45 +41,7 @@
+ blob_threshold: 0
+ blob_file_lo: 0
+ blob_file_hi: 0
+ blob_sdb_lo: 0
+ blob_sdb_hi: 0
+ page 3: btree leaf: LSN [0][1]: level 1
+ prev: 0 next: 0 entries: 0 offset: 4096
+-page 4: btree metadata: LSN [0][1]: level 0
+- magic: 0x53162
+- version: 9
+- pagesize: 4096
+- type: 9
+- metaflags 0
+- keys: 0 records: 0
+- free list: 0
+- last_pgno: 4
+- flags: 0x20 (multiple-databases)
+- minkey: 2
+- root: 5
+- blob_threshold: 0
+- blob_file_lo: 0
+- blob_file_hi: 0
+- blob_sdb_lo: 0
+- blob_sdb_hi: 0
+-page 5: btree leaf: LSN [0][1]: level 1
+- prev: 0 next: 0 entries: 0 offset: 4096
+-page 6: btree metadata: LSN [0][1]: level 0
+- magic: 0x53162
+- version: 9
+- pagesize: 4096
+- type: 9
+- metaflags 0
+- keys: 0 records: 0
+- free list: 0
+- last_pgno: 6
+- flags: 0x20 (multiple-databases)
+- minkey: 2
+- root: 7
+- blob_threshold: 0
+- blob_file_lo: 0
+- blob_file_hi: 0
+- blob_sdb_lo: 0
+- blob_sdb_hi: 0
+-page 7: btree leaf: LSN [0][1]: level 1
+- prev: 0 next: 0 entries: 0 offset: 4096
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/ab87ab6a62d654551da022160ed931e73154691d
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/ab87ab6a62d654551da022160ed931e73154691d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20221229/5b978250/attachment.htm>
More information about the rb-commits
mailing list