tests: set skip_if_unavailable in test repos

dnf seems to have changed the default for skip_if_unavailable. Some
mock repositories are still around in later tests, which then fail
because metadata cannot be synced.

Also expose skip_if_unavailable in dnf_repo_to_file_repo(), so that
tests checking for equality of repo files continue to pass.
This commit is contained in:
Lars Karlitski 2019-07-08 22:26:46 +02:00
parent fce196ad4a
commit fd57e1106e
4 changed files with 6 additions and 0 deletions

View File

@ -404,6 +404,9 @@ def dnf_repo_to_file_repo(repo):
if repo.gpgkey: if repo.gpgkey:
repo_str += "gpgkey = %s\n" % ",".join(repo.gpgkey) repo_str += "gpgkey = %s\n" % ",".join(repo.gpgkey)
if repo.skip_if_unavailable:
repo_str += "skip_if_unavailable=1\n"
return repo_str return repo_str
def repo_to_source(repo, system_source): def repo_to_source(repo, system_source):

View File

@ -3,3 +3,4 @@ name = A fake repo with a baseurl
baseurl = https://fake-repo.base.url baseurl = https://fake-repo.base.url
sslverify = True sslverify = True
gpgcheck = True gpgcheck = True
skip_if_unavailable=1

View File

@ -3,3 +3,4 @@ name = A fake repo with a metalink
metalink = https://fake-repo.metalink metalink = https://fake-repo.metalink
sslverify = True sslverify = True
gpgcheck = True gpgcheck = True
skip_if_unavailable=1

View File

@ -3,3 +3,4 @@ name = A fake repo with a mirrorlist
mirrorlist = https://fake-repo.mirrorlist mirrorlist = https://fake-repo.mirrorlist
sslverify = True sslverify = True
gpgcheck = True gpgcheck = True
skip_if_unavailable=1