mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-19 16:40:46 -09:00
support/testing: test_gnupg2.py: use assertRunNotOk()
Use the helper to simplify the test. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
@@ -49,8 +49,7 @@ class TestGnupg2(infra.basetest.BRTest):
|
|||||||
# Test a failed decrypt with a bad password
|
# Test a failed decrypt with a bad password
|
||||||
cmd = "gpg --batch --decrypt"
|
cmd = "gpg --batch --decrypt"
|
||||||
cmd += " --passphrase 'A-Bad-Password' {}".format(gpg_file)
|
cmd += " --passphrase 'A-Bad-Password' {}".format(gpg_file)
|
||||||
_, exit_code = self.emulator.run(cmd)
|
self.assertRunNotOk(cmd)
|
||||||
self.assertNotEqual(exit_code, 0)
|
|
||||||
|
|
||||||
# Test the generation of an asymmetric key
|
# Test the generation of an asymmetric key
|
||||||
cmd = "gpg --batch --passphrase ''"
|
cmd = "gpg --batch --passphrase ''"
|
||||||
@@ -106,9 +105,7 @@ class TestGnupg2(infra.basetest.BRTest):
|
|||||||
self.assertRunOk(cmd)
|
self.assertRunOk(cmd)
|
||||||
|
|
||||||
cmd = "gpg --verify {}".format(sig_file)
|
cmd = "gpg --verify {}".format(sig_file)
|
||||||
_, exit_code = self.emulator.run(cmd)
|
self.assertRunNotOk(cmd)
|
||||||
self.assertNotEqual(exit_code, 0)
|
|
||||||
|
|
||||||
cmd = "gpg --armor --verify {}".format(asc_file)
|
cmd = "gpg --armor --verify {}".format(asc_file)
|
||||||
_, exit_code = self.emulator.run(cmd)
|
self.assertRunNotOK(cmd)
|
||||||
self.assertNotEqual(exit_code, 0)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user