def test_06_start_atomic_repo_sync(self): ''' start syncing the repo ''' atomic_repo_version = RHUIManagerRepo.get_repo_version( RHUA, self.atomic_repo_name) RHUIManagerSync.sync_repo( RHUA, [Util.format_repo(self.atomic_repo_name, atomic_repo_version)])
def test_11_check_repo_sync_status(self): ''' check if RH repos have been synced so RPMs can be installed from them ''' RHUIManagerSync.wait_till_repo_synced( RHUA, [Util.format_repo(self.yum_repo_name, self.yum_repo_version)]) # also wait for the publish Pulp task to complete (takes time in the case of large repos) RHUIManagerSync.wait_till_pulp_tasks_finish(RHUA)
def test_09_wait_for_sync(self): ''' wait until the repo is synced (takes a while) ''' atomic_repo_version = RHUIManagerRepo.get_repo_version( RHUA, self.atomic_repo_name) RHUIManagerSync.wait_till_repo_synced( RHUA, [Util.format_repo(self.atomic_repo_name, atomic_repo_version)])
def _sync_cds(self, cdslist): """ Sync cds """ if (not "RHUA" in self.rs.Instances.keys()) or len(self.rs.Instances["RHUA"]) < 1: raise nose.exc.SkipTest("can't test without RHUA!") try: RHUIManagerSync.sync_cds(self.rs.Instances["RHUA"][0], cdslist) except ExpectFailed: # The CDS is not available for syncing so most probably it's syncing right now # Trying to check the status Expect.enter(self.rs.Instances["RHUA"][0], "b") RHUIManager.quit(self.rs.Instances["RHUA"][0]) self._sync_wait_cds(cdslist)
def test_11_sync_again(self): ''' sync the repo again (workaround for RHBZ#1427190) ''' atomic_repo_version = RHUIManagerRepo.get_repo_version( RHUA, self.atomic_repo_name) RHUIManagerSync.sync_repo( RHUA, [Util.format_repo(self.atomic_repo_name, atomic_repo_version)]) RHUIManagerSync.wait_till_repo_synced( RHUA, [Util.format_repo(self.atomic_repo_name, atomic_repo_version)])
def test_06_sync_containers(self): ''' sync the containers ''' quay_repo_name = Util.safe_pulp_repo_name(self.container_quay["name"]) docker_repo_name = Util.safe_pulp_repo_name( self.container_docker["name"]) RHUIManagerSync.sync_repo( RHUA, [self.container_displayname, quay_repo_name, docker_repo_name]) RHUIManagerSync.wait_till_repo_synced( RHUA, [self.container_displayname, quay_repo_name, docker_repo_name])
def test_05_add_upload_sync_stuff(self): ''' add a custom and RH content repos to protect by a cli entitlement cert, upload rpm, sync ''' RHUIManagerRepo.add_custom_repo(RHUA, CUSTOM_REPO, "", CUSTOM_PATH, "1", "y") RHUIManagerRepo.upload_content( RHUA, [CUSTOM_REPO], "%s/%s" % (CUSTOM_RPMS_DIR, self.custom_rpm)) RHUIManagerRepo.add_rh_repo_by_repo(RHUA, [ Util.format_repo(self.yum_repo_name, self.yum_repo_version, self.yum_repo_kind) ]) RHUIManagerSync.sync_repo( RHUA, [Util.format_repo(self.yum_repo_name, self.yum_repo_version)])
def _sync_repo(self, repolist): """ Sync repo """ if (not "RHUA" in self.rs.Instances.keys()) or len(self.rs.Instances["RHUA"]) < 1: raise nose.exc.SkipTest("can't test without RHUA!") try: RHUIManagerSync.sync_repo(self.rs.Instances["RHUA"][0], repolist) except ExpectFailed: # The repo is not available for syncing so most probably it's syncing right now # Trying to check the status Expect.enter(self.rs.Instances["RHUA"][0], "b") RHUIManager.quit(self.rs.Instances["RHUA"][0]) for repo in repolist: reposync = ["In Progress", "", ""] while reposync[0] in ["In Progress", "Never"]: time.sleep(10) reposync = RHUIManagerSync.get_repo_status(self.rs.Instances["RHUA"][0], repo) nose.tools.assert_equal(reposync[2], "Success")
def _sync_wait_cds(self, cdslist): """ Sync CDS and wait """ # waits for the cds sync conclusion for cds in cdslist: cdssync = ["UP", "In Progress", "", ""] while cdssync[1] == "In Progress": time.sleep(10) cdssync = RHUIManagerSync.get_cds_status(self.rs.Instances["RHUA"][0], cds) nose.tools.assert_equal(cdssync[3], "Success")
def test_13_big_comps(): """import comps for the (big) RHEL 7Server repo and check if all its groups get processed""" # first force the RHUA to cache RHEL repodata # (using a recent 3.x AWS client RPM; remove this when such an RPM is common in RHEL 7 AMIs) Expect.expect_retval(RHUA, "yum -y update rh-amazon-rhui-client", timeout=60) Expect.expect_retval(RHUA, "yum repolist enabled", timeout=60) # get all groups from this repodata; using a wildcard as there's only one cached comps file original_comps_xml = "/var/cache/yum/x86_64/7Server/%s/*comps.xml" % BIG_REPO original_groups = Yummy.comps_xml_grouplist(RHUA, original_comps_xml, False) # create a custom repo for the 7Server repo, import the cached comps file RHUIManagerCLI.repo_create_custom(RHUA, BIG_REPO) RHUIManagerCLI.repo_add_comps(RHUA, BIG_REPO, original_comps_xml) # this can actually take a while to get fully processed, so better check for Pulp tasks RHUIManagerSync.wait_till_pulp_tasks_finish(RHUA) # get all groups from the imported metadata processed_comps_xml = Yummy.repodata_location(RHUA, BIG_REPO, "group") processed_groups = Yummy.comps_xml_grouplist(RHUA, processed_comps_xml, False) # compare the groups nose.tools.eq_(original_groups, processed_groups)
def test_04_wait_till_repo_synced(self): '''wait until the repo is synced''' RHUIManagerSync.wait_till_repo_synced( RHUA, [Util.format_repo(self.yum_repo_name, self.yum_repo_version)])
def test_03_check_sync_started(self): '''ensure that the sync started''' RHUIManagerSync.check_sync_started( RHUA, [Util.format_repo(self.yum_repo_name, self.yum_repo_version)])
def test_02_sync_repo(self): '''sync a RH repo ''' RHUIManagerSync.sync_repo( RHUA, [Util.format_repo(self.yum_repo_name, self.yum_repo_version)])
def test_12_wait_for_pulp_tasks(): ''' wait until the repo publish task is complete (takes extra time) ''' RHUIManagerSync.wait_till_pulp_tasks_finish(RHUA)