From a0263ad282d350b548cbbc27e96f196d9217d040 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 12 Sep 2016 14:53:08 +0200 Subject: tests: Make signature notation test compatible with older GnuPGs. * lang/python/tests/t-sig-notation.py: Only check the critical flag when GnuPG >= 2.1.13 is used. * tests/gpg/t-sig-notation.c: Likewise. Fixes-commit: c88c9ef3 Signed-off-by: Justus Winter --- lang/python/tests/t-sig-notation.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lang/python/tests/t-sig-notation.py') diff --git a/lang/python/tests/t-sig-notation.py b/lang/python/tests/t-sig-notation.py index 0f77e37a..b024bb5a 100755 --- a/lang/python/tests/t-sig-notation.py +++ b/lang/python/tests/t-sig-notation.py @@ -29,6 +29,14 @@ expected_notations = { None: ("http://www.gnu.org/policy/", 0), } +# GnuPG prior to 2.1.13 did not report the critical flag correctly. +with core.Context() as c: + version = c.engine_info.version + have_correct_sig_data = not (version.startswith("1.") + or version == "2.1.1" + or (version.startswith("2.1.1") + and version[5] < '3')) + def check_result(result): assert len(result.signatures) == 1, "Unexpected number of signatures" sig = result.signatures[0] @@ -45,7 +53,8 @@ def check_result(result): assert r.human_readable \ == bool(flags&constants.SIG_NOTATION_HUMAN_READABLE) assert r.critical \ - == bool(flags&constants.SIG_NOTATION_CRITICAL) + == (bool(flags&constants.SIG_NOTATION_CRITICAL) + if have_correct_sig_data else False) assert len(expected_notations) == 0 -- cgit v1.2.3