def test_pulp_push(self, openshift): # noqa:F811 platform_descriptors = {'x86_64': {'enable_v1': True}} osbs_api = osbs_with_pulp(openshift, platform_descriptors=platform_descriptors) additional_params = { 'base_image': 'fedora:latest', } _, build_json = self.get_worker_build_request(osbs_api, additional_params) plugins = get_plugins_from_build_json(build_json) args = plugin_value_get(plugins, 'postbuild_plugins', 'pulp_push', 'args') build_conf = osbs_api.build_conf # Use first docker registry and strip off /v2 pulp_registry_name = build_conf.get_pulp_registry() pulp_secret_path = '/'.join( [SECRETS_PATH, build_conf.get_pulp_secret()]) expected_args = { 'pulp_registry_name': pulp_registry_name, 'pulp_secret_path': pulp_secret_path, 'load_exported_image': True, 'dockpulp_loglevel': 'INFO', 'publish': False } assert args == expected_args
def test_pulp_push(self, openshift): # noqa:F811 platform_descriptors = {'x86_64': {'enable_v1': True}} osbs_api = osbs_with_pulp(openshift, platform_descriptors=platform_descriptors) additional_params = { 'base_image': 'fedora:latest', } _, build_json = self.get_worker_build_request(osbs_api, additional_params) plugins = get_plugins_from_build_json(build_json) args = plugin_value_get(plugins, 'postbuild_plugins', 'pulp_push', 'args') build_conf = osbs_api.build_conf # Use first docker registry and strip off /v2 pulp_registry_name = build_conf.get_pulp_registry() pulp_secret_path = '/'.join([SECRETS_PATH, build_conf.get_pulp_secret()]) expected_args = { 'pulp_registry_name': pulp_registry_name, 'pulp_secret_path': pulp_secret_path, 'load_exported_image': True, 'dockpulp_loglevel': 'INFO', 'publish': False } assert args == expected_args
def test_group_manifests(self, openshift, group): platform_descriptors = {'x86_64': {'architecture': 'amd64'}} osbs_api = osbs_with_pulp(openshift, platform_descriptors=platform_descriptors, group_manifests=group) additional_params = { 'base_image': 'fedora:latest', } _, build_json = self.get_orchestrator_build_request( osbs_api, additional_params) plugins = get_plugins_from_build_json(build_json) args = plugin_value_get(plugins, 'postbuild_plugins', 'group_manifests', 'args') docker_registry = self.get_pulp_sync_registry(osbs_api.build_conf) expected_args = { 'goarch': { 'x86_64': 'amd64' }, 'group': group, 'registries': { docker_registry: { 'insecure': True, 'version': 'v2' } } } assert args == expected_args
def test_group_manifests(self, openshift, group): platform_descriptors = {'x86_64': {'architecture': 'amd64'}} osbs_api = osbs_with_pulp(openshift, platform_descriptors=platform_descriptors, group_manifests=group) additional_params = { 'base_image': 'fedora:latest', } _, build_json = self.get_orchestrator_build_request(osbs_api, additional_params) plugins = get_plugins_from_build_json(build_json) args = plugin_value_get(plugins, 'postbuild_plugins', 'group_manifests', 'args') docker_registry = self.get_pulp_sync_registry(osbs_api.build_conf) expected_args = { 'goarch': {'x86_64': 'amd64'}, 'group': group, 'registries': {docker_registry: {'insecure': True, 'version': 'v2'}} } assert args == expected_args
def test_group_manifests(self, openshift): # noqa:F811 platform_descriptors = {'x86_64': {'architecture': 'amd64'}} osbs_api = osbs_with_pulp(openshift, platform_descriptors=platform_descriptors) additional_params = { 'base_image': 'fedora:latest', } _, build_json = self.get_orchestrator_build_request( osbs_api, additional_params) plugins = get_plugins_from_build_json(build_json) args = plugin_value_get(plugins, 'postbuild_plugins', 'group_manifests', 'args') expected_args = { 'goarch': { 'x86_64': 'amd64' }, 'group': False, 'pulp_registry_name': osbs_api.build_conf.get_pulp_registry() } assert args == expected_args