def test_18_repo_select_0(): '''check if no repo is chosen if 0 is entered when adding a repo''' # for RHBZ#1305612 # upload the small cert and try entering 0 when the list of repos is displayed RHUIManagerEntitlements.upload_rh_certificate( RHUA, "/tmp/extra_rhui_files/rhcert_atomic.pem") RHUIManager.screen(RHUA, "repo") Expect.enter(RHUA, "a") Expect.expect(RHUA, "Enter value", 180) Expect.enter(RHUA, "3") Expect.expect(RHUA, "Enter value") Expect.enter(RHUA, "0") Expect.expect(RHUA, "Enter value") Expect.enter(RHUA, "c") Expect.expect(RHUA, "Proceed") Expect.enter(RHUA, "y") Expect.expect(RHUA, "Content") Expect.enter(RHUA, "q") # the RHUI repo list ought to be empty now; if not, delete the repo and fail repo_list = RHUIManagerRepo.list(RHUA) RHUIManager.remove_rh_certs(RHUA) if repo_list: RHUIManagerRepo.delete_all_repos(RHUA) raise AssertionError("The repo list is not empty: %s." % repo_list)
def test_13_upload_semi_bad_cert(): ''' upload a certificate containing a mix of valid and invalid repos ''' # for RHBZ#1588931 & RHBZ#1584527 cert = "/tmp/extra_rhui_files/rhcert_partially_invalid.pem" if Util.cert_expired(RHUA, cert): raise nose.exc.SkipTest( "The given certificate has already expired.") RHUIManagerEntitlements.upload_rh_certificate(RHUA, cert)
def test_17_missing_cert_handling(): '''check if rhui-manager can handle the loss of the RH cert''' # for RHBZ#1325390 RHUIManagerEntitlements.upload_rh_certificate(RHUA) # launch rhui-manager in one connection, delete the cert in the other RHUIManager.screen(RHUA, "repo") RHUIManager.remove_rh_certs(RHUA_2) Expect.enter(RHUA, "a") # a bit strange response to see in this context, but eh, no == all if you're a geek Expect.expect( RHUA, "All entitled products are currently deployed in the RHUI") Expect.enter(RHUA, "q") # an error message should be logged, though Expect.ping_pong(RHUA, "tail /root/.rhui/rhui.log", "The entitlement.*has no associated certificate")
def test_02_upload_rh_certificate(): ''' upload a new or updated Red Hat content certificate ''' if not getenv("RHUISKIPSETUP"): entlist = RHUIManagerEntitlements.upload_rh_certificate(RHUA) nose.tools.assert_not_equal(len(entlist), 0)
def test_04_upload_atomic_cert(): ''' upload the Atomic cert ''' entlist = RHUIManagerEntitlements.upload_rh_certificate( RHUA, "/tmp/extra_rhui_files/" + "rhcert_atomic.pem") nose.tools.assert_not_equal(len(entlist), 0)
def test_01_setup(self): '''log in to rhui-manager, upload RH cert, add a repo to sync ''' RHUIManager.initial_run(RHUA) entlist = RHUIManagerEntitlements.upload_rh_certificate(RHUA) nose.tools.assert_not_equal(len(entlist), 0) RHUIManagerRepo.add_rh_repo_by_repo(RHUA, [ Util.format_repo(self.yum_repo_name, self.yum_repo_version, self.yum_repo_kind) ])
def test_01_repo_setup(): '''log in to RHUI, upload cert, check if no repo exists''' RHUIManager.initial_run(RHUA) entlist = RHUIManagerEntitlements.upload_rh_certificate(RHUA) nose.tools.ok_(entlist) nose.tools.ok_(not RHUIManagerRepo.list(RHUA))
def test_04_upload_rh_certificate(): ''' upload a new or updated Red Hat content certificate ''' entlist = RHUIManagerEntitlements.upload_rh_certificate(RHUA) nose.tools.assert_not_equal(len(entlist), 0)