rpmmd: allow check_gpg to be configured for system repos

The sources weldr API already supports this, so hook it up to be
represented on disk and in our internal state tracking too.

This does not yet hook this up to be respected by osbuild, which
currently takes this to be unconditionally set to true.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-06-03 11:27:37 +02:00 committed by Lars Karlitski
parent 32d81d7dbf
commit 6a7e57ce8d
8 changed files with 77 additions and 38 deletions

View file

@ -345,8 +345,9 @@ func (suite *storeTest) TestGetAllSourcesByID() {
func (suite *storeTest) TestNewSourceConfigWithBaseURL() {
myRepoConfig := rpmmd.RepoConfig{
Name: "testRepo",
BaseURL: "testURL",
Name: "testRepo",
BaseURL: "testURL",
CheckGPG: true,
}
expectedSource := SourceConfig{Name: "testRepo", Type: "yum-baseurl", URL: "testURL", CheckGPG: true, CheckSSL: true, System: true}
actualSource := NewSourceConfig(myRepoConfig, true)
@ -357,6 +358,7 @@ func (suite *storeTest) TestNewSourceConfigWithMetaLink() {
myRepoConfig := rpmmd.RepoConfig{
Name: "testRepo",
Metalink: "testURL",
CheckGPG: true,
}
expectedSource := SourceConfig{Name: "testRepo", Type: "yum-metalink", URL: "testURL", CheckGPG: true, CheckSSL: true, System: true}
actualSource := NewSourceConfig(myRepoConfig, true)
@ -368,7 +370,7 @@ func (suite *storeTest) TestNewSourceConfigWithMirrorList() {
Name: "testRepo",
MirrorList: "testURL",
}
expectedSource := SourceConfig{Name: "testRepo", Type: "yum-mirrorlist", URL: "testURL", CheckGPG: true, CheckSSL: true, System: true}
expectedSource := SourceConfig{Name: "testRepo", Type: "yum-mirrorlist", URL: "testURL", CheckGPG: false, CheckSSL: true, System: true}
actualSource := NewSourceConfig(myRepoConfig, true)
suite.Equal(expectedSource, actualSource)
}