Commit 15114f7
tests/test_CLI.py: create $GNUPGHOME on the fly (#31)
* tests/test_CLI.py: create $GNUPGHOME on the fly
- avoid expiration of keys by re-creating them
- prevent gnupg version being incompatible with $GNUPGHOME in git
Storing binary data is bad because:
- git is not good at handling binary data
- binary data is harder to inspect (remember the xz incident)
* TransRead.read: pass on -1 instead of 0xFFFFFFFFFFFFFFFF
Passing 0xFFFFFFFFFFFFFFFF to read causes python to complain about:
OverflowError: cannot fit 'int' into an index-sized integer
Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
* tests: Rework CLI tests
The current tests do not take into account whether the `gpg` package has
been installed or not. If it is missing, the tests should be skipped.
Furthermore, the output of the tests must be checked in order to decide
whether tests fail due to an exception or whether the desired error message
is displayed.
Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
* CLI: rework PGP verification
The verification of PGP signatures had some flaws and didn't work, because
the Python API and the GPG interface have changed. Inline signatures were
not detected, because of a comparison of string and byte array. And even
after this the code failed, because `sig.status` is no longer available.
Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
* tests/test_CLI.py: factor out verification logic into its own function
* add gpg verification methods using gpg and gpgv binaries
* ci: Fix GPG tests
Fixes up the way that the GPG tests work by adding a new "native" python
test version. This is required because the python 'gpg' module *must*
come from the host package in order to patch libgpgme (e.g.
'python3-gpg'). It's not possible to get this module installed with the
pre-canned python versions provided by GitHub Actions, so the gpg tests
are skipped for this version, but using the host native python can.
---------
Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
Co-authored-by: Jörg Sommer <joerg.sommer@navimatix.de>
Co-authored-by: Joshua Watt <JPEWhacker@gmail.com>1 parent 1f54211 commit 15114f7
File tree
15 files changed
+295
-393
lines changed- .github/workflows
- src/bmaptool
- tests
- test-data
- gnupg
- openpgp-revocs.d
- private-keys-v1.d
- signatures
15 files changed
+295
-393
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
25 | 36 | | |
26 | 37 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
30 | 42 | | |
31 | 43 | | |
32 | | - | |
| 44 | + | |
| 45 | + | |
33 | 46 | | |
34 | 47 | | |
35 | | - | |
| 48 | + | |
| 49 | + | |
36 | 50 | | |
37 | 51 | | |
38 | | - | |
| 52 | + | |
39 | 53 | | |
40 | 54 | | |
41 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
0 commit comments