summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2020-09-06Add a partial experimental PGPy-based OpenPGP providerMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-06test_openpgp: Add more tests for importing key combosMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-06openpgp: Move get_wkd_url() to global scopeMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-06openpgp: Rename GPG-based environments to *GPGEnvironmentMichał Górny
Rename the GPG-based OpenPGP support implementations to SystemGPGEnvironment and IsolatedGPGEnvironment. OpenPGPEnvironment and OpenPGPSystemEnvironment remain as aliases to the currently preferred implementations. Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05Replace IOError/OSError whenever possibleMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05Do not call signal.strsignal() when not available (py<3.8)Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05Add gpg-wrap commandMichał Górny
Closes: https://github.com/mgorny/gemato/issues/18 Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05openpgp: Verify key validity for signaturesMichał Górny
Require keys to have at least minimal validity for signature verification to be successful. Appropriately mark imported keys ultimately trusted/valid by default. Closes: https://github.com/mgorny/gemato/issues/17 Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05openpgp: Move listing keys to a separate methodMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05test_openpgp: Test using UID with no e-mail addressMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05test_recursiveloader: Cache tmp_paths for read-only layoutsMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05Handle invalid compressed files when collecting ManifestsMichał Górny
Fix load_unregistered_manifests() not to crash on 'Manifest*' files that do not contain valid compressed data. Instead, treat them as unknown files, similarly how Manifests with invalid data are handled. Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05Fix wrongly determining uncompressed sizeMichał Górny
Flush the file after writing to ensure that .buffer.tell() gives non-zero value. This fixes a number of cases of Manifests not being compressed. It also pointed out a major mistake in profile tests. Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05tests: Port test_recursiveloader to pytestMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-09-05tests: Mark module-scope test dirs read-onlyMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-31tests: Port test_profile to pytestMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-30tests: Use module-scope fixtures whenever possibleMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-30test_openpgp: Fix system env tests to respect GNUPGMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-29tests: Test OpenPGPSystemEnvironment as wellMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-28tests: Port test_verify to pytestMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-27tests: Convert test_util to pytestMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-27tests: Extend OpenPGP un-expiration testsMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-27tests: Convert test_manifest to pytestMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-27tests: Rewrite test_hash to pytestMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-27tests: Migrate test_find_top_level to pytestMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-27Import names directly, fix coding style issuesMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-27Add tests for keys lacking signaturesMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-27test_compression: fix unused importsMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-26tests: Convert test_compression to pytestMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-26tests: Properly skip test_openpgp.py::test_cli when no gpgMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-26tests: Rewrite test_openpgp in pure pytestMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-25openpgp: Reimplement WKD support via requestsMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-25openpgp: Introduce a helper method to get WKD URLMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-25Remove compatibility code for py<3.6 supportMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-25tests: Add tests for unexpiring keysMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-25tests: Test for trivial cases of key forgingMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-25tests: Add a test for subkey-signatureMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-25tests: Store key data in split binary formMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-05-16openpgp: Default stdin='' in _spawn_gpg()Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-05-16openpgp: Pass 'gpg --batch' to _spawn_gpg() explicitlyMichał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-03-16tests: Fix MockedWKDOpenPGPEnvironment._spawn_gpg() return typesMichał Górny
2018-07-25tests: Add half-mocked tests for WKD-based refreshMichał Górny
2018-07-25tests: Add tests for keyserver-based refreshingMichał Górny
2018-03-13tests: Fix one more cross-fs test to test for mountpointMichał Górny
2018-02-22cli: Add -x option to prevent crossing filesystem boundariesMichał Górny
2018-02-22tests: Assert for /proc being a mountpoint for cross-fs testsMichał Górny
Skip cross-fs tests if /proc is not a mountpoint. This handles cases when /proc exists but is not mounted which is quite normal e.g. on Gentoo/FreeBSD.
2018-02-08recursiveloader: Allow cross-device processing by defaultMichał Górny
2018-02-08find_top_level: Remove broken cross-device testMichał Górny
Remove the cross-device test that wrongly assumed we will be traversing logical parent directories rather than physical. In other words, '..' in the symlinked filesystem will never contain the Manifest file.
2018-02-02recursiveloader: Detect symlink loops explicitlyMichał Górny
2018-02-02recursiveloader: Check for cross-device directories earlier in loopMichał Górny
Check for cross-device directory when starting to process the directory rather than for each subdirectory to be processed. This will avoid double stat() call in the future. It also means that cross-device exceptions are raised a little later, when recurring into the directory rather than before doing that. However, the starting directory is now also tested.