Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #28050 - rpm content upload #8461

Merged
merged 1 commit into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/services/katello/pulp3/rpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Katello
module Pulp3
class Rpm < PulpContentUnit
include LazyAccessor
CONTENT_TYPE = "rpm".freeze

PULP_INDEXED_FIELDS = %w(pulp_href name version release arch epoch summary is_modular rpm_sourcerpm location_href pkgId).freeze

Expand Down
31 changes: 31 additions & 0 deletions test/actions/pulp3/orchestration/rpm_upload_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require 'katello_test_helper'

module ::Actions::Pulp3
class RpmUploadTest < ActiveSupport::TestCase
include Katello::Pulp3Support

def setup
@master = FactoryBot.create(:smart_proxy, :default_smart_proxy, :with_pulp3)
@repo = katello_repositories(:fedora_17_x86_64)
tmp_file = File.join(Katello::Engine.root, 'test/fixtures/test_repos/zoo/duck-0.7-1.noarch.rpm')
@file = {path: tmp_file, filename: 'duck-0.7.1.noarch.rpm'}
create_repo(@repo, @master)
end

def test_upload
action_result = ""
@repo.reload
assert @repo.remote_href

VCR.use_cassette(cassette_name + '_binary', :match_requests_on => [:method, :path, :params]) do
action_result = ForemanTasks.sync_task(::Actions::Pulp3::Orchestration::Repository::UploadContent, @repo, @master, @file, 'rpm')
end
assert_equal "success", action_result.result
@repo.reload
repository_reference = Katello::Pulp3::RepositoryReference.find_by(
:root_repository_id => @repo.root.id,
:content_view_id => @repo.content_view.id)
assert_equal repository_reference.repository_href + "versions/1/", @repo.version_href
end
end
end
296 changes: 296 additions & 0 deletions test/fixtures/vcr_cassettes/actions/pulp3/rpm_upload/upload.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading