Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package bmap-tools for openSUSE:Factory 
checked in at 2022-11-21 15:29:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bmap-tools (Old)
 and      /work/SRC/openSUSE:Factory/.bmap-tools.new.1597 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bmap-tools"

Mon Nov 21 15:29:49 2022 rev:2 rq:1036972 version:3.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/bmap-tools/bmap-tools.changes    2021-10-11 
15:32:14.298904710 +0200
+++ /work/SRC/openSUSE:Factory/.bmap-tools.new.1597/bmap-tools.changes  
2022-11-21 15:29:57.192757230 +0100
@@ -1,0 +2,15 @@
+Fri Nov 18 22:51:34 UTC 2022 - Ben Greiner <c...@bnavigator.de>
+
+- Add bmap-tools-pr103-replace-python-gpgme.patch
+  * gh#intel/bmap-tools#43
+  * gh#intel/bmap-tools#103
+  * Add missing binary test data from the PR which does not fit
+    into the patch
+- Enable test suite (with pytest as substitute for nose)
+- Add bmap-tools-3.6-suse-fix-tests.patch
+  * remove backports.tempfile and mock-- no need to support
+    Python < 3.2
+  * fix entry-point call
+  * includes part of gh#intel/bmap-tools#112
+
+-------------------------------------------------------------------

New:
----
  bmap-tools-3.6-suse-fix-tests.patch
  bmap-tools-pr103-replace-python-gpgme.patch
  pubring.kbx
  random_seed
  test.image.bmap.v2.0.sig-by-wrong-key
  test.image.bmap.v2.0.valid-sig
  trustdb.gpg

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ bmap-tools.spec ++++++
--- /var/tmp/diff_new_pack.If9BS7/_old  2022-11-21 15:29:58.108761880 +0100
+++ /var/tmp/diff_new_pack.If9BS7/_new  2022-11-21 15:29:58.112761901 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package bmap-tools
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
 #
 
 
+%define skip_python2 1
 Name:           bmap-tools
 Version:        3.6
 Release:        0
@@ -24,12 +25,27 @@
 Group:          Development/Tools/Other
 URL:            https://github.com/intel/bmap-tools
 Source0:        
https://github.com/intel/bmap-tools/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
+# For Patch0
+Source11:       
https://github.com/intel/bmap-tools/raw/ffdcbc752cb086d33f083100b4c2498914a7b8eb/tests/test-data/gnupg/pubring.kbx
+Source12:       
https://github.com/intel/bmap-tools/raw/ffdcbc752cb086d33f083100b4c2498914a7b8eb/tests/test-data/gnupg/random_seed
+Source13:       
https://github.com/intel/bmap-tools/raw/ffdcbc752cb086d33f083100b4c2498914a7b8eb/tests/test-data/gnupg/trustdb.gpg
+Source14:       
https://github.com/intel/bmap-tools/raw/ffdcbc752cb086d33f083100b4c2498914a7b8eb/tests/test-data/test.image.bmap.v2.0.sig-by-wrong-key
+Source15:       
https://github.com/intel/bmap-tools/raw/ffdcbc752cb086d33f083100b4c2498914a7b8eb/tests/test-data/test.image.bmap.v2.0.valid-sig
+# PATCH-FEATURE-UPSTREAM  bmap-tools-pr103-replace-python-gpgme.patch 
gh#intel/bmap-tools#103 + gh#intel/bmap-tools#112
+Patch0:         bmap-tools-pr103-replace-python-gpgme.patch
+# PATCH-FIX-OPENSUSE remove-backports.tempfile.patch c...@bnavigator.de -- no 
need to support Python < 3.2
+Patch1:         bmap-tools-3.6-suse-fix-tests.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-Requires:       python-gpgme
+Requires:       python-gpg
 Requires(post): update-alternatives
-Requires(postun): update-alternatives
+Requires(postun):update-alternatives
+# SECTION test
+BuildRequires:  %{python_module gpg}
+BuildRequires:  %{python_module pytest}
+BuildRequires:  %{python_module six}
+# /SECTION
 Recommends:     bzip2
 Recommends:     gzip
 Recommends:     lz4
@@ -44,17 +60,25 @@
 %python_subpackages
 
 %description
-Tools to generate block map (AKA bmap) and flash images using bmap. Bmaptool is
-a generic tool for creating the block map (bmap) for a file, and copying files
+Bmaptool is a generic tool for creating the block map (bmap) for a file, and 
copying files
 using the block map. The idea is that large file containing unused blocks, like
 raw system image files, can be copied or flashed a lot faster with bmaptool
 than with traditional tools like "dd" or "cp".
 
 %prep
-%setup -q
+%autosetup -p1
 # remove shebang
 tail -n +2 bmaptools/CLI.py > bmaptools/CLI.py_new
 mv bmaptools/CLI.py{_new,}
+%if 0%{?suse_version} < 1550
+# no python_flavored_alternatives in old python-rpm-macros
+mkdir testbin
+sed '1{s/env python/python3/}' bmaptool > testbin/bmaptool
+chmod +x testbin/bmaptool
+%endif
+rm __main__.py bmaptool
+cp %{SOURCE11} %{SOURCE12} %{SOURCE13} tests/test-data/gnupg/
+cp %{SOURCE14} %{SOURCE15} tests/test-data/signatures/
 
 %build
 %python_build
@@ -69,6 +93,13 @@
 
 %python_expand %fdupes %{buildroot}%{$python_sitelib}/bmaptools
 
+%check
+%if 0%{?suse_version} < 1550
+export PATH=$PWD/testbin:$PATH
+%endif
+# no /sys/module/zfs/ in obs test environment: returns false instead of IOError
+%pytest -k "not test_is_zfs_configuration_compatible_unreadable_file"
+
 %post
 %{python_install_alternative bmaptool bmaptool.1}
 
@@ -79,7 +110,8 @@
 %license COPYING
 %doc docs/README docs/RELEASE_NOTES
 %python_alternative %{_bindir}/bmaptool
-%python_alternative %{_mandir}/man1/bmaptool.1%{ext_man}
-%{python_sitelib}/*
+%python_alternative %{_mandir}/man1/bmaptool.1%{?ext_man}
+%{python_sitelib}/bmaptools
+%{python_sitelib}/bmap_tools-%{version}*-info
 
 %changelog

++++++ bmap-tools-3.6-suse-fix-tests.patch ++++++
Index: bmap-tools-3.6/tests/test_bmap_helpers.py
===================================================================
--- bmap-tools-3.6.orig/tests/test_bmap_helpers.py
+++ bmap-tools-3.6/tests/test_bmap_helpers.py
@@ -21,8 +21,9 @@ This test verifies 'BmapHelpers' module
 import os
 import sys
 import tempfile
-from mock import patch, mock
-from backports import tempfile as btempfile
+from unittest import mock
+from unittest.mock import patch
+import tempfile as btempfile
 from bmaptools import BmapHelpers
 
 
Index: bmap-tools-3.6/tests/test_CLI.py
===================================================================
--- bmap-tools-3.6.orig/tests/test_CLI.py
+++ bmap-tools-3.6/tests/test_CLI.py
@@ -24,30 +24,30 @@ import tests.helpers
 
 class TestCLI(unittest.TestCase):
     def test_valid_signature(self):
-        completed_process = subprocess.run ([ './bmaptool', 'copy', '--bmap',
+        completed_process = subprocess.run ([ 'bmaptool', 'copy', '--bmap',
            'tests/test-data/test.image.bmap.v2.0', '--bmap-sig',
-           'tests/test-data/test.image.bmap.v2.0.valid-sig',
+           'tests/test-data/signatures/test.image.bmap.v2.0.valid-sig',
            'tests/test-data/test.image.gz', self.tmpfile ], check=False)
         self.assertEqual(completed_process.returncode, 0)
 
     def test_unknown_signer(self):
-        completed_process = subprocess.run ([ './bmaptool', 'copy', '--bmap',
+        completed_process = subprocess.run ([ 'bmaptool', 'copy', '--bmap',
         'tests/test-data/test.image.bmap.v2.0', '--bmap-sig',
-        'tests/test-data/test.image.bmap.v2.0.sig-by-wrong-key',
+        'tests/test-data/signatures/test.image.bmap.v2.0.sig-by-wrong-key',
         'tests/test-data/test.image.gz', self.tmpfile ], check=False)
         self.assertEqual(completed_process.returncode, 1)
     
     def test_wrong_signature(self):
-        completed_process = subprocess.run ([ './bmaptool', 'copy', '--bmap',
+        completed_process = subprocess.run ([ 'bmaptool', 'copy', '--bmap',
         'tests/test-data/test.image.bmap.v1.4', '--bmap-sig',
-        'tests/test-data/test.image.bmap.v2.0.valid-sig',
+        'tests/test-data/signatures/test.image.bmap.v2.0.valid-sig',
         'tests/test-data/test.image.gz', self.tmpfile ], check=False)
         self.assertEqual(completed_process.returncode, 1)
 
     def test_wrong_signature_uknown_signer(self):
-        completed_process = subprocess.run ([ './bmaptool', 'copy', '--bmap',
+        completed_process = subprocess.run ([ 'bmaptool', 'copy', '--bmap',
         'tests/test-data/test.image.bmap.v1.4', '--bmap-sig',
-        'tests/test-data/test.image.bmap.v2.0.sig-by-wrong-key',
+        'tests/test-data/signatures/test.image.bmap.v2.0.sig-by-wrong-key',
         'tests/test-data/test.image.gz', self.tmpfile ], check=False)
         self.assertEqual(completed_process.returncode, 1)
 

++++++ bmap-tools-pr103-replace-python-gpgme.patch ++++++
>From 2ea7ba243c6fb236066b892e31e84fe1153f05e0 Mon Sep 17 00:00:00 2001
From: Benedikt Wildenhain <benedikt.wildenh...@hs-bochum.de>
Date: Thu, 16 Jun 2022 17:21:31 +0200
Subject: [PATCH] Use gpg instead of gpgme module, implement test cases

---
 bmaptools/CLI.py                              |  34 +++---
 ...7FF9746434704C5774BE648D49DFB1163BDFB4.rev |  35 ++++++
 ...4E440F8FDA066F62DBD7FE72FDD5E4F64B2C3B.key |  42 +++++++
 ...E64D7E26AFF87DFDD758119B30F6F57B1B6D4D.key |  42 +++++++
 tests/test-data/gnupg/pubring.kbx             | Bin 0 -> 2018 bytes
 tests/test-data/gnupg/pubring.kbx~            | Bin 0 -> 32 bytes
 tests/test-data/gnupg/random_seed             | Bin 0 -> 600 bytes
 tests/test-data/gnupg/trustdb.gpg             | Bin 0 -> 1280 bytes
 tests/test-data/test.image.bmap.v2.0.asc      | 114 ++++++++++++++++++
 .../test.image.bmap.v2.0.sig-by-wrong-key     | Bin 0 -> 438 bytes
 .../test-data/test.image.bmap.v2.0.valid-sig  | Bin 0 -> 438 bytes
 tests/test_CLI.py                             |  62 ++++++++++
 12 files changed, 315 insertions(+), 14 deletions(-)
 create mode 100644 
tests/test-data/gnupg/openpgp-revocs.d/927FF9746434704C5774BE648D49DFB1163BDFB4.rev
 create mode 100644 
tests/test-data/gnupg/private-keys-v1.d/6F4E440F8FDA066F62DBD7FE72FDD5E4F64B2C3B.key
 create mode 100644 
tests/test-data/gnupg/private-keys-v1.d/CBE64D7E26AFF87DFDD758119B30F6F57B1B6D4D.key
 create mode 100644 tests/test-data/gnupg/pubring.kbx
 create mode 100644 tests/test-data/gnupg/pubring.kbx~
 create mode 100644 tests/test-data/gnupg/random_seed
 create mode 100644 tests/test-data/gnupg/trustdb.gpg
 create mode 100644 tests/test-data/test.image.bmap.v2.0.asc
 create mode 100644 tests/test-data/test.image.bmap.v2.0.sig-by-wrong-key
 create mode 100644 tests/test-data/test.image.bmap.v2.0.valid-sig
 create mode 100644 tests/test_CLI.py

Index: bmap-tools-3.6/bmaptools/CLI.py
===================================================================
--- bmap-tools-3.6.orig/bmaptools/CLI.py
+++ bmap-tools-3.6/bmaptools/CLI.py
@@ -129,12 +129,14 @@ def open_block_device(path):
 def report_verification_results(context, sigs):
     """
     This is a helper function which reports the GPG signature verification
-    results. The 'context' argument is the gpgme context object, and the 'sigs'
-    argument contains the results of the 'gpgme.verify()' function.
+    results. The 'context' argument is the gpg context object, and the 'sigs'
+    argument contains the results of the 'gpg.verify()' function.
     """
 
+    import gpg
+
     for sig in sigs:
-        if not sig.status:
+        if (sig.summary & gpg.constants.SIGSUM_VALID) != 0:
             key = context.get_key(sig.fpr)
             author = "%s <%s>" % (key.uids[0].name, key.uids[0].email)
             log.info("successfully verified bmap file signature of %s "
@@ -190,21 +192,23 @@ def verify_detached_bmap_signature(args,
         sig_obj = tmp_obj
 
     try:
-        import gpgme
+        import gpg
     except ImportError:
-        error_out("cannot verify the signature because the python \"gpgme\" "
+        error_out("cannot verify the signature because the python \"gpg\" "
                   "module is not installed on your system\nPlease, either "
                   "install the module or use --no-sig-verify")
 
     try:
-        context = gpgme.Context()
+        context = gpg.Context()
         signature = io.FileIO(sig_obj.name)
         signed_data = io.FileIO(bmap_obj.name)
-        sigs = context.verify(signature, signed_data, None)
-    except gpgme.GpgmeError as err:
+        sigs = context.verify(signed_data, signature, None)[1].signatures
+    except gpg.errors.GPGMEError as err:
         error_out("failure when trying to verify GPG signature: %s\n"
                   "Make sure file \"%s\" has proper GPG format",
-                  err[2].lower(), sig_path)
+                  err.getstring(), sig_path)
+    except gpg.errors.BadSignatures as err:
+        error_out("discovered a BAD GPG signature: %s\n", sig_path)
 
     sig_obj.close()
 
@@ -228,22 +232,24 @@ def verify_clearsign_bmap_signature(args
                   "the signature, so --bmap-sig option should not be used")
 
     try:
-        import gpgme
+        import gpg
     except ImportError:
-        error_out("cannot verify the signature because the python \"gpgme\""
+        error_out("cannot verify the signature because the python \"gpg\""
                   "module is not installed on your system\nCannot extract "
                   "block map from the bmap file which has clearsign format, "
                   "please, install the module")
 
     try:
-        context = gpgme.Context()
+        context = gpg.Context()
         signature = io.FileIO(bmap_obj.name)
         plaintext = io.BytesIO()
-        sigs = context.verify(signature, None, plaintext)
-    except gpgme.GpgmeError as err:
+        sigs = context.verify(plaintext, signature, None)
+    except gpg.errors.GPGMEError as err:
         error_out("failure when trying to verify GPG signature: %s\n"
                   "make sure the bmap file has proper GPG format",
                   err[2].lower())
+    except gpg.errors.BadSignatures as err:
+        error_out("discovered a BAD GPG signature: %s\n", sig_path)
 
     if not args.no_sig_verify:
         if len(sigs) == 0:
Index: 
bmap-tools-3.6/tests/test-data/gnupg/openpgp-revocs.d/927FF9746434704C5774BE648D49DFB1163BDFB4.rev
===================================================================
--- /dev/null
+++ 
bmap-tools-3.6/tests/test-data/gnupg/openpgp-revocs.d/927FF9746434704C5774BE648D49DFB1163BDFB4.rev
@@ -0,0 +1,35 @@
+This is a revocation certificate for the OpenPGP key:
+
+pub   rsa3072 2022-06-13 [SC] [expires: 2024-06-12]
+      927FF9746434704C5774BE648D49DFB1163BDFB4
+uid          Testkey Bmap-Tool (Do not use, private key published!) 
<inva...@example.org>
+
+A revocation certificate is a kind of "kill switch" to publicly
+declare that a key shall not anymore be used.  It is not possible
+to retract such a revocation certificate once it has been published.
+
+Use it to revoke this key in case of a compromise or loss of
+the secret key.  However, if the secret key is still accessible,
+it is better to generate a new revocation certificate and give
+a reason for the revocation.  For details see the description of
+of the gpg command "--generate-revocation" in the GnuPG manual.
+
+To avoid an accidental use of this file, a colon has been inserted
+before the 5 dashes below.  Remove this colon with a text editor
+before importing and publishing this revocation certificate.
+
+:-----BEGIN PGP PUBLIC KEY BLOCK-----
+Comment: This is a revocation certificate
+
+iQG2BCABCgAgFiEEkn/5dGQ0cExXdL5kjUnfsRY737QFAmKnmGQCHQAACgkQjUnf
+sRY737Q/cAv/RqUa+sVKgLyqKpk1scDlzvGeyCYSnOUbf8SHAHI9X1ZUlV4Vcy0J
+LcJghlfDvffjenzTmoALaNJRrTMYjpE/Sl47qwEsI84kNscZumJvFabyYIl4hdmD
+KH6dZ7X0asPpgNJ1K8Cp0hndkudxxU8DuePTxyO5fKhnvEqU+eaW/i2zEC36BQZi
+WB9smT/UrqxDUFTQ4Oo84d36lqnHaHnz3acSHY6Rb8eKFq609NgFfKVTN4+Gxl28
+jwCGpzJm9PIj8bMQgyB/1Fjvt9pzhLU3OqVx9wrmDrir6ecmR+rxSqgOKAwzn92E
+JLPF1wYKI89UW6t413DSDfuYUICO+QWhW8tyomw3KcPDwks7C+YGu8W2YGyWhdlM
++ac6WUAaHrmkEXqTb9+sAmyNhq3D6EiAnaZndofJxgiM7AuC+hXZjnRf7eJ1Agu9
+PXNo0/DPiB2aAY2lhT5dkYYMzwEK9v5BPe9h7HI6Ou2f8fGqwUTidg3nNAntqqFQ
+ecS9iokUZOkJ
+=qWLD
+-----END PGP PUBLIC KEY BLOCK-----
Index: 
bmap-tools-3.6/tests/test-data/gnupg/private-keys-v1.d/6F4E440F8FDA066F62DBD7FE72FDD5E4F64B2C3B.key
===================================================================
--- /dev/null
+++ 
bmap-tools-3.6/tests/test-data/gnupg/private-keys-v1.d/6F4E440F8FDA066F62DBD7FE72FDD5E4F64B2C3B.key
@@ -0,0 +1,42 @@
+Key: (private-key (rsa (n #00C679F02C9F5BE4787D937D65C98D856462F544F7C3
+ 58937303C7096AD97E8EB27E27986AF47B8D017773A52B20D66E117B7D0CE94552A586
+ AC819E3BEC7E136FE18273C96F407D1680AF9A3B6FB79C4B1B0EC736A7F3DF3BF8FB47
+ C57549985972A494F8412231308EB67BB83DBB17807352976A5F1C120A61BC7D0E9339
+ B5354D92ED5395B5555DEFAD823C124CED3424F12A710FC73A2523E3A81B929C7BAD8A
+ 269409EA27B3B1CF3196AE0DC0E687633BAB43DA1ABB7227B853173149D0A782C5A25B
+ C44F25D5B55542FFFD78CDABB6D20DF10EA8B2CF069DD10E35C32BEDE755724222CEBD
+ B2E187E048A629A1D536803A547C332D8DB1AC83CA2492843335F6594CAF1A6EC6B251
+ 5EAB26720C4107CAAC9AE1E43F47AA429AA8E916451F3A8C608FE315FA20E746F369B7
+ 56F5EFFB5F66F1F108573606E8002B319AE042D77A3B861308FFE3BFD0F958B792AD4B
+ B4C6A28E28511289581E2A54A14ECCBEFCAEEC25309620EE4564B68CE40E8F9DEC73D9
+ 0D4CE75A01D769B3716A5E1331#)(e #010001#)(d
+  #0A0FE383B79E86822F479B6B5E20FD1ABE4395F803A0C974E2C3A3F0154FABB753DA
+ F908AF15566C351C994A8AF3240861DCD09B40E6F43A54238C1C989C39AB09E13DB280
+ 1FE257923594D99F8BCCF227D0837BFB5ECB39F4A0F49E0798B00F14D7503017C93E7A
+ 2A3A0922A98A83220176B5F37017F1B8320546C7C6E1FD9452B6F8AE2CA051501E570B
+ 0BB597CDCCBF74B4849FDAA7517BB4CE707B69D081574826682C4550005B3335E2E412
+ 9BFD502415C62E57FD99C776BA4BAA35864CE8B590CD55AC67761F7EDE2C94BAD0818B
+ AD929BE2C8C8EE7F71D219F9A2849087D1D66772D4F4646550DED35D50FD3B3AA267E2
+ 1B1207066D8AE5509DAF766056DC787403B0C14FB0794D0CDACA942943CFABCF447470
+ F430C8E71A6C4D1F6025901174714CF1590EAB7FBFF935C230A6606F1BB4248FA7C157
+ 09C11CB7985E4FED0F55EE8E3DC99C0A7AF1DB0495FFF9520289EE45D172A551186DBF
+ BE982C5C1B28294DB57B91C27C327503FBC6F33B0D1FE949AEFC953E9307FF0AA6F8BB
+ #)(p #00C71001D7F41A281376C036F046C9B6E257760BB789B1D7DB100C7E475E17B1
+ 00176D10DF954AB327BF32447437169D6A4FDE9372A24DDB141358534529454F05140C
+ 0CFA0BFB101FA0D28234D14144E2F803851CE36055964D755DBA2A27CEB9EC370634CD
+ D476CA0B7D00852C056F7E48D17CA364BA80C801602094143951BCCB0E5C2FCD5CCC54
+ 6C6AB39780D790DFD42EE8AC1ADD2C8A4DEFBBBE6FA32DBAADAC39DC587FD8AED46834
+ 86171805FFC6C4BF4A94029F3906413056F2A85B57#)(q
+  #00FF3F01CC7946963D4C1AF299A4294FB2F9A4CC99CD57093D0E14FFBB6BB906943F
+ FCDBCBC9154D6F4D8A07D61E389D3AF2867D81595D8D4E770BF73B486C4AF65465DCDE
+ DB9E4589D821DC06C6A7042C18B881604F35A2FD2966E29ABACE47C26D1936B81A0AB8
+ 00D4948F1D555D83A38B408ECC8192DA10B6C33BC5001FDD5A742DFB1366992E9A02AE
+ A996118522C6006A6E6AAD6DC184022648C45578EDA67A6D5A24550A6EFC49A7CBA1C0
+ EBADB71C86B0C943A3DF04D3C1B8AFB3EC78B7#)(u
+  #00FA1D07140F156D32EFA7249DE7DCBF10EEA8C9E9C5D97BABEA0323FEDD17F6D8EB
+ 1E0F83FE07263541EA5C24E0C2D049B355628F022F68059C53E0C4788BEBD698734D19
+ 91CC0F7F72EEE831D8875C5FF9A288B8AE6EE774B0A611FC7D4AE17A5F042C49F9E281
+ 6C62B06E8D73B64578D4CFE2E14255665588C9D71DC39FB5B7FADD767F82F0D7505654
+ 9A2B9383617FE093E7CCC83AFA063A0DBAE41CDEBAA972B14BEF89CB539733D0BB96E4
+ F2D3B005273FA9CFCAD2763363CE38D231A3FF#)))
+Created: 20220613T200440
Index: 
bmap-tools-3.6/tests/test-data/gnupg/private-keys-v1.d/CBE64D7E26AFF87DFDD758119B30F6F57B1B6D4D.key
===================================================================
--- /dev/null
+++ 
bmap-tools-3.6/tests/test-data/gnupg/private-keys-v1.d/CBE64D7E26AFF87DFDD758119B30F6F57B1B6D4D.key
@@ -0,0 +1,42 @@
+Key: (private-key (rsa (n #00E3F42F3C2AB6BCD2D0253FB78EF87BEDFA1B2BDFE5
+ 0EF573FA3D5147B0A9E7E34A9E74754AA77D812A4E79370D825745350BEE383C9E2CB9
+ 7F4670D15834D479AF6DB01BD6B03B10096F235EEBC756FCA3A86918CEEDEABDEF2F08
+ 4927D019970ED593E86BEB821C00346B5C1D5C1C6F68882807029B455D23B3BF9B2F8C
+ 1E6BD8211D35CED39C67097067C9759C7E4F2DBAF361D68FE95C7D89150FBC89E4A940
+ 30655A83CD837969FF8C484BCEA606B28F370878E7192F0C109A280B1090E512E4EDFB
+ 676A68793D8617A70DBFD1BD5C5A8B06C2043FAA5F5B7F7A28FAD06A7CEFADCD2473A4
+ CA11A1DF9532C90F662CAC5679F171A1822B25DF0BA8A940E6DCDFD64CAC6DFD4B97F5
+ 3AB4095812627769065A00B019EFDB5004188F27096675FF759102FD6D14F34B16DE92
+ 2BC73C45F0B5B39384FBD320443A4B6733643EAFC63F9E29D369EC83133DDBCF30CD8E
+ 1E36C4F4BBEF1A5B6B47100B0F9FE635711C2A861006E10BDA735D1DDC2CDA05964232
+ 7943B2733B54EDF1982F620551#)(e #010001#)(d
+  #03162E4CDE298AF20A7347C662A06C752C60655447A7B52148974CB8E7107EBC20C8
+ 5CFA4CC809ADCFD36DA5CB164FBC0034432FE5577995D642C566DBDE74EB526A46D04C
+ FF8758CBBA1D37FAE3E39894195B08C07213F07052942085E09FF0E8E6F602229A4F54
+ 311D3525B5A5B8604C2943D1C3A74E3E00DD0854B6E3DD7B3E7E8BBE1FB61BB10E0887
+ 07859023805400B616C1A638BB4D5D8445F0B9963DEB7E58F567881AF9F48E46C61C40
+ 65804C8B03D645B447CD890AF1329B78FD4C27540862B31E4F08CE19FE20119D130747
+ 8F00B5F9F5789303847FDF7D6F4B1D33E89A6B6B49937E2E95680C672503E257027402
+ 27F6C52A471FE83E7E11E88266021815535CB4CC331F91E9069DC16F55E09E91C3987E
+ 871F06194299436F54A248A3D09F41932C3F16FCF2A9FD576F207BE96048FB10F59AD8
+ E504DE9D97EF733289FAB35B73D8CBBACD2423C011BE6F1F659FBD0378992993DC57AB
+ 591B395559C31B3F8E94036F13D094CE7CAD9C9266542F05F76D30C68C17BBC16C085D
+ #)(p #00E415B09A77BA36DEA2F523E865D420506EAED1660965850251DBEBC93FB807
+ 628B1B7E117F2A33AC351ADCF7AEC8E11E7749117C50E6D93F8F6B5EE5BB30C0806ECC
+ 62017BA06A44D41E6AB65CF9765B74FCA085D0D7F0EC3E7099AAD81424317C930983A3
+ 33D53FEDBEBEBB008CA7409523FDC360D6322E031A6AD6DB8254A90675810D8DA41C92
+ E368F4F3F787463CD8A2600D9B395318386535D90511195AFF8AEB870EE45895919CB9
+ 9F15D08D03E05B528812EFD7F9B506B796B549F43B#)(q
+  #00FFDA64D91DCAEDB0664031367847C800FA390597DFA4FDD25A5FC578BA6BB34AB2
+ 30D2A0A49CA07CAB560E199AF2CD91311D85A72E55F4134105EF931C5B74EBF4AC619C
+ 4B345DACCFF12C786EEAC16F07C4B14CB6A37DFCCF0644BC3080F3E3B9804EFFDD6353
+ F63AFA7B887EA667574D1FC7F2620A87FF1D8958695221821406C92364C89B2A063C79
+ 9E6E860FDB0CC81C3DC290D171EDC4AD3BA5D9ABB12453CE7D95427B0A7912CFACA306
+ 1D20174DAB9922289F6587F32704CF6F8D0FE3#)(u
+  #37330A6F7F514DAEC91F9E15D9A3DFA0B83A36AC5EDC6C6B1A5A842A9B6E4F92F393
+ E7A245C1C7963153DEE7EA5980A26FC276CEE94D2452651C1BA3100D38ED07AB7D2091
+ A940E50A8AC06064D42E29155E7105D9507CF1D33D1117F9D9D68A399DAE123ECBBDF8
+ C77592D540096795DF7E4820C09D24CB6B9F4BDD8BBFCF051F555CF86AAB9E70EA0032
+ CC8F191E069DEB7DC88E8128FA749AD8F10DADBAB6C557832603D55CEA0E10C2341137
+ 2D33030E53CA0AB3250A8E333C6DE61E20DC#)))
+Created: 20220613T200440
Index: bmap-tools-3.6/tests/test-data/signatures/test.image.bmap.v2.0.asc
===================================================================
--- /dev/null
+++ bmap-tools-3.6/tests/test-data/signatures/test.image.bmap.v2.0.asc
@@ -0,0 +1,114 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA512
+
+<?xml version="1.0" ?>
+<!-- This file contains the block map for an image file, which is basically
+     a list of useful (mapped) block numbers in the image file. In other words,
+     it lists only those blocks which contain data (boot sector, partition
+     table, file-system metadata, files, directories, extents, etc). These
+     blocks have to be copied to the target device. The other blocks do not
+     contain any useful data and do not have to be copied to the target
+     device.
+
+     The block map an optimization which allows to copy or flash the image to
+     the image quicker than copying of flashing the entire image. This is
+     because with bmap less data is copied: <MappedBlocksCount> blocks instead
+     of <BlocksCount> blocks.
+
+     Besides the machine-readable data, this file contains useful commentaries
+     which contain human-readable information like image size, percentage of
+     mapped data, etc.
+
+     The 'version' attribute is the block map file format version in the
+     'major.minor' format. The version major number is increased whenever an
+     incompatible block map format change is made. The minor number changes
+     in case of minor backward-compatible changes. -->
+
+<bmap version="2.0">
+    <!-- Image size in bytes: 802.5 KiB -->
+    <ImageSize> 821752 </ImageSize>
+
+    <!-- Size of a block in bytes -->
+    <BlockSize> 4096 </BlockSize>
+
+    <!-- Count of blocks in the image file -->
+    <BlocksCount> 201 </BlocksCount>
+
+    <!-- Count of mapped blocks: 468.0 KiB or 58.2%    -->
+    <MappedBlocksCount> 117    </MappedBlocksCount>
+
+    <!-- Type of checksum used in this file -->
+    <ChecksumType> sha256 </ChecksumType>
+
+    <!-- The checksum of this bmap file. When it is calculated, the value of
+         the checksum has be zero (all ASCII "0" symbols).  -->
+    <BmapFileChecksum> 
d9cf7d44790d04fcbb089c5eeec7700e9233439ab6e4bd759035906e20f90070 
</BmapFileChecksum>
+
+    <!-- The block map which consists of elements which may either be a
+         range of blocks or a single block. The 'chksum' attribute
+         (if present) is the checksum of this blocks range. -->
+    <BlockMap>
+        <Range 
chksum="9eaf19215d55d23de1be1fe4bed4a95bfe620a404352fd06e782738fff58e500"> 0-1 
</Range>
+        <Range 
chksum="e8a26f49a71262870f8294a73f40f122d622fd70fb82bef01c0322785e9fd6b2"> 3-5 
</Range>
+        <Range 
chksum="9251ec146af47d2db881b4beabf39e8a09f400e9fdd587080ba872be250bfa66"> 9-10 
</Range>
+        <Range 
chksum="1f82b9594a9385934f7d62ad2c95b680adb0a715311da24a592353f4eedc9196"> 12 
</Range>
+        <Range 
chksum="f9abfd404b01ee6cc3aae89c0b2d32595d174067414d4c7ed347e01027e5198a"> 
15-18 </Range>
+        <Range 
chksum="7a6304c0e75f1db501e01ceaf03f925adb5046de4d8f21b4453ac1f34ad9a04a"> 20 
</Range>
+        <Range 
chksum="7efcfe912e7a0d603823ecd387040816d718dbe356abc33d75c7a4074b5166e6"> 22 
</Range>
+        <Range 
chksum="fa89f8bfa8647f253a65547f2fec7da8220beb2abf3e83387cfde4a5adc2e371"> 24 
</Range>
+        <Range 
chksum="b9b49e2335300e6c9cbc41f023b95262f1e8997a328cefac4e2ee98dbffe2876"> 
30-32 </Range>
+        <Range 
chksum="73d8a6f96db05475c61905707405707d881f975c6a20c4b3860e5da9cba7d0d6"> 
34-35 </Range>
+        <Range 
chksum="72ecd33adba1ce49626179d66500581e96d56b26882d1882fa73b0a8973a54ae"> 40 
</Range>
+        <Range 
chksum="343b15a5df354fa45c3e3a0755c2c0c65e1e8b6b8566c96ee018e3fdf22b7fea"> 
42-43 </Range>
+        <Range 
chksum="67632b2bd1704a7d3535fcd1224d1cc2e5defe5f8503416aba108deb0a8c5195"> 45 
</Range>
+        <Range 
chksum="567853b6db8ba8fc6b74b68bd054c4570c94c563421c791d4282271b218d1970"> 47 
</Range>
+        <Range 
chksum="4c6bea2040e058ac183e4f89740b6519e0acf7690cc8c1e3a92d4cadde18afc1"> 
49-50 </Range>
+        <Range 
chksum="a6923635cd40a502321dad8127db631eaae77af1adbd7c3af28e4c47a6cc17b4"> 
52-53 </Range>
+        <Range 
chksum="754d4a59d22aa4e635c12da22437a2980a47cac1ffd3e9319a16e935517a3d28"> 
55-56 </Range>
+        <Range 
chksum="d03670c239e2f30ef065da9848cef9f5386543d1d25bdce3b6b060f846c02336"> 
60-63 </Range>
+        <Range 
chksum="7c1092388c70a7f20eb73245cb3253c8a3e94fe4727c89ccc8175a83931f30c6"> 
65-67 </Range>
+        <Range 
chksum="69f6917acf67c408c6f904a0b4d1e4731fc63fcebf96b863c46e1f1345b89d5f"> 70 
</Range>
+        <Range 
chksum="584951a12f0a64d605cf5c40ecc5c35fea09320215b078ff1409a6c8cb53d779"> 72 
</Range>
+        <Range 
chksum="983775dfe44cf57c9c16f388fb0a0feb70b1fe1df5c15ccadf06fb52c687e090"> 
78-80 </Range>
+        <Range 
chksum="7792004ce7de28e55cee7ad365760e2717ed10ba85bd732fee821eada3ed851f"> 
82-83 </Range>
+        <Range 
chksum="9422e34ab590d8396203744c680411526d5ef1a9e75815a4c5f26fb45233c654"> 85 
</Range>
+        <Range 
chksum="bb8fbdd5ee992341e0344284f9ef2fd60f7fcc66022d5ddf5167cb4dbf4d77e0"> 88 
</Range>
+        <Range 
chksum="d7c2fe248a1f4faba0beb7ed7982721af09e43d39ba031adc47b92b7a512c2a6"> 
90-91 </Range>
+        <Range 
chksum="462a930c88a2e3c5319559feb39389c64b6c21dc2cb68552e7499208bd7103aa"> 96 
</Range>
+        <Range 
chksum="16dab0a1420bcf3fb47676ad3cf63d37018359bf8d74f69bda6deb584defe017"> 
98-105 </Range>
+        <Range 
chksum="dde77bda930499f1ca1f5926f3bbce02628312744035031ac985953c2b992fd6"> 111 
</Range>
+        <Range 
chksum="e53e4350a4a6f24d8535fe1889fd51620eb767ba9edf1f54e4716075024b4930"> 
114-116 </Range>
+        <Range 
chksum="483e868aa797d861b15623755e99e195b9bd2ae21cf65e13cbc3a31196ff1399"> 
119-133 </Range>
+        <Range 
chksum="c246d08bfb4c637c8ba4bc36de01c6d0a0fa1ccb6ce5073f36bee03553930dec"> 135 
</Range>
+        <Range 
chksum="112bf5a172bddfdaa3547ec75cec2e06f53469092877d3235f4875a5f2d27a6a"> 137 
</Range>
+        <Range 
chksum="cb0bd3e46ba71a0107e6565fcf9dd74e77890ef8e44233c2e622083264e32ee5"> 140 
</Range>
+        <Range 
chksum="84cd195fb6ba711efaab2c726a4b022b59c35411288ea195ac8de7c55770b8a0"> 
142-144 </Range>
+        <Range 
chksum="4581295e35fcc3192c67516f296833a0d7efb60c682ec5eb41d478fd471c7d37"> 
146-147 </Range>
+        <Range 
chksum="265121e906434c8f824116152a774d6f29d64dd9d824742437a1b43337376913"> 
150-151 </Range>
+        <Range 
chksum="751a8b29e92c1af64c0298c14e823b36c2e595d2b8f40e88a74a9cfec7969178"> 155 
</Range>
+        <Range 
chksum="f5323d152b5fa270485f8405d14697a3c85e7ebd81191b4d63472537d4e12820"> 157 
</Range>
+        <Range 
chksum="bfb2148640de1bfe102cd005978ccc06ee4d1da40b4f9ba62c0ed1ce62c08370"> 
159-160 </Range>
+        <Range 
chksum="dafa3fbd9fb00807231520ed080d412b16e7a64f2f22e5252ba435bba13f3094"> 
163-174 </Range>
+        <Range 
chksum="75678fa3017705a5c4015668beb2f69a88c7ad1ca981468ad9bac0322db90c98"> 177 
</Range>
+        <Range 
chksum="1e11b14396428302f3e6a6b770a5d55bd4211fd952a9acf5acad8996257615a9"> 
181-186 </Range>
+        <Range 
chksum="c9bb5fa33c4dee6cb6f846017dfca8ab33e5b211cb1dfa1a92fc26ce21ebf258"> 
188-189 </Range>
+        <Range 
chksum="229690ebe7f88e243b5b1ba3a87b20fa21cb63c52c31315c65c9075074be9384"> 191 
</Range>
+        <Range 
chksum="38997ca7da7129a382db6138e8f42102a22a482f859ddb9bdc2fba8a44fe1965"> 193 
</Range>
+        <Range 
chksum="af30597da547c8c0cf124b33159644f089ba2e172bddc1fe2864d80183565900"> 195 
</Range>
+        <Range 
chksum="cb732fc3f3a0f81f6a761a534201c05549c8efe4a92630ccd24241f72d7d618c"> 
198-199 </Range>
+    </BlockMap>
+</bmap>
+-----BEGIN PGP SIGNATURE-----
+
+iQGzBAEBCgAdFiEEkn/5dGQ0cExXdL5kjUnfsRY737QFAmKp2hMACgkQjUnfsRY7
+37R5kgwAvvGyq3BRzJiA+JoZbKTvQe7RA6t0mFjVozBfg8ZxpQAcqgJUR3qL72k4
+0FbOJOKrECwwxj6hfsjGHrC6cako7oqJDYwh1pal10o0sjzMT1HQiwqcmTk+VgtS
+R46zB4Mz1R4IWoQcAjvXkBoxeQ+vw6SxVBPTO6a6Aa4INSFX9szxcQeh+7POGlIi
+DZeWU6mLClws2OExSlcsNjttLF3EBJP7qXBPUCjiSZ1rVLtgvoVXzADYn0Em2y0+
+u2NfLOcAPAWqBJdNhXSOY+5vGfSkAN2WcQlmJiPceOlygiIVZj1WRhw6hpoAU5cM
+wq2QLA0l0UQ6gq5PrF/GAnLpYlHzID6agxyGbDpcuzUq4d8IsuyF3W38SJpuDf3u
+UcS/TR7l4c8t8EjxMG/L731D3n9nRy0mcHLEDKi5Afa/ppyrbp4GKmM/PO8JU1W2
+Uk8P+oUr3JFFVPdj0svHpHd9LTOjLiaWWFNiW72mSB9offswIZVBbznO+p7VYtYG
+mERuBkXP
+=7GH3
+-----END PGP SIGNATURE-----
Index: bmap-tools-3.6/tests/test_CLI.py
===================================================================
--- /dev/null
+++ bmap-tools-3.6/tests/test_CLI.py
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+# vim: ts=4 sw=4 et ai si
+#
+# Copyright (c) 2022 Benedikt Wildenhain
+# License: GPLv2
+# Author: Benedikt Wildenhain <benedikt.wildenh...@hs-bochum.de>
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License, version 2 or any later version,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+import unittest
+
+import os
+import subprocess
+import sys
+import tempfile
+import tests.helpers
+
+class TestCLI(unittest.TestCase):
+    def test_valid_signature(self):
+        completed_process = subprocess.run ([ './bmaptool', 'copy', '--bmap',
+           'tests/test-data/test.image.bmap.v2.0', '--bmap-sig',
+           'tests/test-data/test.image.bmap.v2.0.valid-sig',
+           'tests/test-data/test.image.gz', self.tmpfile ], check=False)
+        self.assertEqual(completed_process.returncode, 0)
+
+    def test_unknown_signer(self):
+        completed_process = subprocess.run ([ './bmaptool', 'copy', '--bmap',
+        'tests/test-data/test.image.bmap.v2.0', '--bmap-sig',
+        'tests/test-data/test.image.bmap.v2.0.sig-by-wrong-key',
+        'tests/test-data/test.image.gz', self.tmpfile ], check=False)
+        self.assertEqual(completed_process.returncode, 1)
+    
+    def test_wrong_signature(self):
+        completed_process = subprocess.run ([ './bmaptool', 'copy', '--bmap',
+        'tests/test-data/test.image.bmap.v1.4', '--bmap-sig',
+        'tests/test-data/test.image.bmap.v2.0.valid-sig',
+        'tests/test-data/test.image.gz', self.tmpfile ], check=False)
+        self.assertEqual(completed_process.returncode, 1)
+
+    def test_wrong_signature_uknown_signer(self):
+        completed_process = subprocess.run ([ './bmaptool', 'copy', '--bmap',
+        'tests/test-data/test.image.bmap.v1.4', '--bmap-sig',
+        'tests/test-data/test.image.bmap.v2.0.sig-by-wrong-key',
+        'tests/test-data/test.image.gz', self.tmpfile ], check=False)
+        self.assertEqual(completed_process.returncode, 1)
+
+    def setUp(self):
+        os.environ['GNUPGHOME']='tests/test-data/gnupg/'
+        self.tmpfile = tempfile.mkstemp(prefix="testfile_", dir=".")[1]
+
+    def tearDown(self):
+        os.unlink(self.tmpfile)
+
+if __name__ == '__main__':
+    unittest.main()

Reply via email to