From: Jacob Bachmeyer Date: Fri, 17 Mar 2023 03:26:06 +0000 (-0500) Subject: Add key index support in gatekeeper test infrastructure X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fe18f1affbb22686cebc0537a1a55f4146eec132;p=gatekeeper.git Add key index support in gatekeeper test infrastructure --- diff --git a/testsuite/lib/gatekeeper.exp b/testsuite/lib/gatekeeper.exp index 521dfe6..5d599bd 100644 --- a/testsuite/lib/gatekeeper.exp +++ b/testsuite/lib/gatekeeper.exp @@ -95,6 +95,7 @@ proc make_test_environment { base_dir } { } load_lib mockgpg.exp +load_lib keyindex.exp # make_test_keyrings /some/dir/some/where { # some-package-name { @@ -129,6 +130,7 @@ proc make_test_keyrings { base_dir keylist } { # ... # } proc register_test_packages { base_dir packlist } { + set havekeys no foreach { package info } $packlist { file mkdir [file join $base_dir packages $package] foreach { element value } $info { switch $element { @@ -140,6 +142,7 @@ proc register_test_packages { base_dir packlist } { keys { write_test_keyring \ [file join $base_dir packages $package pubring.gpg] $value + set havekeys yes } maintainers { set c [open [file join $base_dir m.bypkg] a] @@ -149,6 +152,9 @@ proc register_test_packages { base_dir packlist } { } } } } + if { $havekeys } { + write_key_index [file join $base_dir packages keyindex] $packlist + } } # make_test_case /some/dir/some/where {