Skip to content
Draft
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
2 changes: 1 addition & 1 deletion tests/ruby-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GIT_PROJECT_ROOT="$(git rev-parse --show-toplevel)"
cd "$GIT_PROJECT_ROOT"

export PULP_URL="${PULP_URL:-http://localhost:5001}"
COMPONENTS=(pulpcore pulp_file)
COMPONENTS=(pulpcore pulp_file pulp_rpm)

function setup-ruby(){
# Configure "isolated" ruby on host machine
Expand Down
23 changes: 23 additions & 0 deletions tests/test_ruby.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'pulpcore_client'
require 'pulp_file_client'
require 'pulp_rpm_client'
require 'tempfile'
require 'digest'

Expand All @@ -20,6 +21,13 @@
config.debugging=true
end

PulpRpmClient.configure do |config|
config.host= ENV['PULP_URL']
config.username= 'admin'
config.password= 'password'
config.debugging=true
end


@artifacts_api = PulpcoreClient::ArtifactsApi.new
@filerepositories_api = PulpFileClient::RepositoriesFileApi.new
Expand All @@ -30,6 +38,9 @@
@fileremotes_api = PulpFileClient::RemotesFileApi.new
@tasks_api = PulpcoreClient::TasksApi.new
@uploads_api = PulpcoreClient::UploadsApi.new
@content_modulemds_api = PulpRpmClient::ContentModulemdsApi.new
@rpmrepositories_api = PulpRpmClient::RepositoriesRpmApi.new
@rpmremotes_api = PulpRpmClient::RemotesRpmApi.new

def monitor_task(task_href)
# Polls the Task API until the task is in a completed state.
Expand Down Expand Up @@ -147,3 +158,15 @@ def upload_file_in_chunks(file_path)

distribution_data = PulpFileClient::FileFileDistribution.new({name: 'baz38', base_path: 'foo38', publication: publication_href})
distribution = @filedistributions_api.create(distribution_data)

# Exercise modular endpoint
# https://github.com/pulp/pulp_rpm/issues/4125
MODULAR_URL = 'https://fixtures.pulpproject.org/rpm-with-modules/'
rpm_remote_data = PulpRpmClient::RpmRpmRemote.new({name: 'rpm_modules_remote', url: MODULAR_URL})
rpm_remote = @rpmremotes_api.create(rpm_remote_data)
rpm_repository_data = PulpRpmClient::RpmRpmRepository.new({name: 'rpm_modules_repo', remote: rpm_remote.pulp_href})
rpm_repository = @rpmrepositories_api.create(rpm_repository_data)
repository_sync_data = PulpRpmClient::RpmRepositorySyncURL.new({})
sync_response = @rpmrepositories_api.sync(rpm_repository.pulp_href, repository_sync_data)
created_resources = monitor_task(sync_response.task)
@content_modulemds_api.list({})
Loading