def test_27_upload_expired_cert(): '''check expired certificate handling''' try: RHUIManagerCLI.cert_upload(RHUA, "%s/%s" % (DATADIR, CERTS["expired"])) except RuntimeError as err: nose.tools.ok_("The provided certificate is expired or invalid" in str(err), msg="unexpected error: %s" % err)
def test_45_multi_repo_product(self): '''check that all repos in a multi-repo product get added''' # for RHBZ#1651638 RHUIManagerCLI.cert_upload(RHUA, "%s/%s" % (DATADIR, CERTS["Atomic"])) RHUIManagerCLI.repo_add(RHUA, self.product["name"]) # wait a few seconds for the repo to actually get added time.sleep(4) repolist_actual = RHUIManagerCLI.repo_list(RHUA, True).splitlines() nose.tools.eq_([self.product["id"]], repolist_actual)
def test_28_upload_incompat_cert(): '''check incompatible certificate handling''' cert = "%s/%s" % (DATADIR, CERTS["incompatible"]) if Util.cert_expired(RHUA, cert): raise nose.exc.SkipTest( "The given certificate has already expired.") try: RHUIManagerCLI.cert_upload(RHUA, cert) except RuntimeError as err: nose.tools.ok_("does not contain any entitlements" in str(err), msg="unexpected error: %s" % err)
def test_44_upload_empty_cert(): '''check that an empty certificate is rejected (no traceback)''' # for RHBZ#1497028 cert = "%s/%s" % (DATADIR, CERTS["empty"]) if Util.cert_expired(RHUA, cert): raise nose.exc.SkipTest( "The given certificate has already expired.") try: RHUIManagerCLI.cert_upload(RHUA, cert) except RuntimeError as err: nose.tools.ok_("does not contain any entitlements" in str(err), msg="unexpected error: %s" % err)
def test_43_upload_semi_bad_cert(self): '''check that a partially invalid certificate can still be accepted''' # for RHBZ#1588931 & RHBZ#1584527 # delete currently used certificates and repos first RHUIManager.remove_rh_certs(RHUA) for repo in CUSTOM_REPOS + self.yum_repo_ids: RHUIManagerCLI.repo_delete(RHUA, repo) repolist = RHUIManagerCLI.repo_list(RHUA, True) nose.tools.ok_(not repolist, msg="can't continue as some repos remain: %s" % repolist) # try uploading the cert now cert = "%s/%s" % (DATADIR, CERTS["partial"]) if Util.cert_expired(RHUA, cert): raise nose.exc.SkipTest( "The given certificate has already expired.") RHUIManagerCLI.cert_upload(RHUA, cert) # the RHUI log must contain the fact that an invalid path was found in the cert Expect.ping_pong(RHUA, "tail /root/.rhui/rhui.log", "Invalid entitlement path") RHUIManager.remove_rh_certs(RHUA)
def test_08_upload_certificate(): '''upload the Atomic (the small) entitlement certificate''' RHUIManagerCLI.cert_upload(RHUA, "%s/%s" % (DATADIR, CERTS["Atomic"]))
def test_04_upload_certificate(): ''' upload an entitlement certificate ''' if not getenv("RHUISKIPSETUP"): RHUIManagerCLI.cert_upload(RHUA)