def test_06_child_repo_content(self): # access the content of the pulp_child node # please note when the repo is created on the other node, # the distributor id used by default is yum_distributor # make sure the repo was published on the child node # the repo ID and distributor ID are the same on both the nodes child_repo = Repo.get(self.pulp_child, self.repo.id) response = child_repo.publish(self.pulp_child, self.distributor.id) assert response == ResponseLike(202), 'wrong response from the child node: %s' % response Task.wait_for_report(self.pulp_child, response) # fetch the repo content url on the child node repo_url = pulp_repo_url(self.pulp_child, self.repo.id) assert repo_url, 'invalid repo id on pulp_child node' # try accessing the content on the child node pkg_name = download_package_with_dnf(self.pulp_child, repo_url, 'bear') assert pkg_name == 'bear', 'not able to acces bear rpm on the child node'
def test_06_child_repo_content(self): # access the content of the pulp_child node # please note when the repo is created on the other node, # the distributor id used by default is yum_distributor # make sure the repo was published on the child node # the repo ID and distributor ID are the same on both the nodes child_repo = Repo.get(self.pulp_child, self.repo.id) response = child_repo.publish(self.pulp_child, self.distributor.id) assert response == ResponseLike( 202), 'wrong response from the child node: %s' % response Task.wait_for_report(self.pulp_child, response) # fetch the repo content url on the child node repo_url = pulp_repo_url(self.pulp_child, self.repo.id) assert repo_url, 'invalid repo id on pulp_child node' # try accessing the content on the child node pkg_name = download_package_with_dnf(self.pulp_child, repo_url, 'bear') assert pkg_name == 'bear', 'not able to acces bear rpm on the child node'
def testcase_01_upload_and_download_using_dnf_rpm(self): # create yum-repo, -importer, -distributor with deleting(self.pulp, *create_yum_repo(self.pulp, 'test_22_rpm_repo_for_dnf')) as (repo, (importer, (distributor))): # create and perform an rpm url upload with deleting(self.pulp, upload_url_rpm(self.pulp, self.rpm_url)) as upload: # assign the upload to the repo response = upload.import_to(self.pulp, repo) self.assertPulpOK() Task.wait_for_report(self.pulp, response) # check the content is accessible response = repo.publish(self.pulp, distributor.id) self.assertPulpOK() Task.wait_for_report(self.pulp, response) # fetch the package through the repo pulp_rpm_url = distributor.content_url(self.pulp, url_basename(self.rpm_url)) pulp_repo = distributor.content_url(self.pulp) with closing(temp_url(pulp_rpm_url)) as tmpfile: assert url_basename(self.rpm_url).startswith(rpm_metadata(tmpfile)['unit_key']['name']) assert "bear" == download_package_with_dnf(self.pulp, pulp_repo, "bear")
def testcase_01_upload_and_download_using_dnf_rpm(self): # create yum-repo, -importer, -distributor repo, importer, [distributor] = YumRepo(id='test_22_rpm_repo_for_dnf', importer=YumImporter(feed=None), distributors=[YumDistributor(relative_url='xyz')]).create(self.pulp) with deleting(self.pulp, repo, importer, distributor): # create and perform an rpm url upload with deleting(self.pulp, upload_url_rpm(self.pulp, self.rpm_url)) as (upload,): # assign the upload to the repo response = upload.import_to(self.pulp, repo) self.assertPulpOK() Task.wait_for_report(self.pulp, response) # check the content is accessible response = repo.publish(self.pulp, distributor.id) self.assertPulpOK() Task.wait_for_report(self.pulp, response) # fetch the package through the repo pulp_rpm_url = distributor.content_url(self.pulp, url_basename(self.rpm_url)) pulp_repo = distributor.content_url(self.pulp) with closing(temp_url(pulp_rpm_url)) as tmpfile: assert url_basename(self.rpm_url).startswith(rpm_metadata(tmpfile)['unit_key']['name']) assert "bear" == download_package_with_dnf(self.pulp, pulp_repo, "bear")