From fd57e1106ee48c8f2efd495b30f11746e12947fc Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Mon, 8 Jul 2019 22:26:46 +0200 Subject: [PATCH] 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. --- src/pylorax/api/projects.py | 3 +++ tests/pylorax/repos/baseurl-test.repo | 1 + tests/pylorax/repos/metalink-test.repo | 1 + tests/pylorax/repos/mirrorlist-test.repo | 1 + 4 files changed, 6 insertions(+) diff --git a/src/pylorax/api/projects.py b/src/pylorax/api/projects.py index 6f9de38c..7b5c08e2 100644 --- a/src/pylorax/api/projects.py +++ b/src/pylorax/api/projects.py @@ -404,6 +404,9 @@ def dnf_repo_to_file_repo(repo): if 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 def repo_to_source(repo, system_source): diff --git a/tests/pylorax/repos/baseurl-test.repo b/tests/pylorax/repos/baseurl-test.repo index 4c4209d6..c2f50374 100644 --- a/tests/pylorax/repos/baseurl-test.repo +++ b/tests/pylorax/repos/baseurl-test.repo @@ -3,3 +3,4 @@ name = A fake repo with a baseurl baseurl = https://fake-repo.base.url sslverify = True gpgcheck = True +skip_if_unavailable=1 diff --git a/tests/pylorax/repos/metalink-test.repo b/tests/pylorax/repos/metalink-test.repo index c1dbbcd3..c0e0223d 100644 --- a/tests/pylorax/repos/metalink-test.repo +++ b/tests/pylorax/repos/metalink-test.repo @@ -3,3 +3,4 @@ name = A fake repo with a metalink metalink = https://fake-repo.metalink sslverify = True gpgcheck = True +skip_if_unavailable=1 diff --git a/tests/pylorax/repos/mirrorlist-test.repo b/tests/pylorax/repos/mirrorlist-test.repo index cfd12c2d..0157aadb 100644 --- a/tests/pylorax/repos/mirrorlist-test.repo +++ b/tests/pylorax/repos/mirrorlist-test.repo @@ -3,3 +3,4 @@ name = A fake repo with a mirrorlist mirrorlist = https://fake-repo.mirrorlist sslverify = True gpgcheck = True +skip_if_unavailable=1