builder: map koji api image types to cloud ones

Map the image types used by the koji API to the image types used
by the cloud api. This should allow for a smooth transition when
the plugin is upgraded, i.e. the pungi configuration can be used
unmodified. After all the plugins are upgraded the pungi config
should be changed to use the native image types and then this
mapping could be removed again.
This commit is contained in:
Christian Kellner 2022-02-10 12:18:09 +00:00
parent 4edca7a82a
commit 47af69254c
2 changed files with 41 additions and 0 deletions

View file

@ -716,6 +716,26 @@ class TestBuilderPlugin(PluginTest):
with self.assertRaises(AssertionError):
self.uploads.assert_upload("x86_64-image_type.manifest.json")
@httpretty.activate
def test_kojiapi_image_types(self):
# Simulate api requests with koji api image types
session = self.mock_session()
handler = self.make_handler(session=session)
url = self.plugin.DEFAULT_COMPOSER_URL
composer = MockComposer(url)
composer.httpretty_regsiter()
for it in ("qcow2", "ec2", "ec2-ha", "ec2-sap"):
args = ["name", "version", "distro",
[it],
"fedora-candidate",
composer.architectures,
{"skip_tag": True}]
res = handler.handler(*args)
assert res, "invalid compose result"
@httpretty.activate
def test_skip_tag(self):
# Simulate a successful compose, where the tagging