def test_20_delete_unreachable(): ''' add a CDS, make it unreachable, and see if it can still be deleted from the RHUA ''' # for RHBZ#1639996 # choose a random CDS hostname from the list cds = random.choice(CDS_HOSTNAMES) status = RHUICLI.add(RHUA, "cds", cds, unsafe=True) nose.tools.ok_(status, msg="unexpected installation status: %s" % status) cds_list = RHUICLI.list(RHUA, "cds") nose.tools.eq_(cds_list, [cds]) Helpers.break_hostname(RHUA, cds) # delete it status = RHUICLI.delete(RHUA, "cds", [cds], force=True) nose.tools.ok_(status, msg="unexpected deletion status: %s" % status) # check it cds_list = RHUICLI.list(RHUA, "cds") nose.tools.eq_(cds_list, []) Helpers.unbreak_hostname(RHUA) # the node remains configured (RHUI mount point, httpd)... unconfigure it properly # do so by adding and deleting it again RHUICLI.add(RHUA, "cds", cds, unsafe=True) RHUICLI.delete(RHUA, "cds", [cds], force=True)
def test_20_delete_unreachable(): ''' add a Load-balancer, make it unreachable, and see if it can still be deleted from the RHUA ''' # for RHBZ#1639996 status = RHUICLI.add(RHUA, "haproxy", HA_HOSTNAME, unsafe=True) nose.tools.ok_(status, msg="unexpected installation status: %s" % status) hap_list = RHUICLI.list(RHUA, "haproxy") nose.tools.eq_(hap_list, [HA_HOSTNAME]) Helpers.break_hostname(RHUA, HA_HOSTNAME) # delete it status = RHUICLI.delete(RHUA, "haproxy", [HA_HOSTNAME], force=True) nose.tools.ok_(status, msg="unexpected deletion status: %s" % status) # check it hap_list = RHUICLI.list(RHUA, "haproxy") nose.tools.eq_(hap_list, []) Helpers.unbreak_hostname(RHUA) # the node remains configured (haproxy)... unconfigure it properly # do so by adding and deleting it again RHUICLI.add(RHUA, "haproxy", HA_HOSTNAME, unsafe=True) RHUICLI.delete(RHUA, "haproxy", [HA_HOSTNAME], force=True) # clean up the SSH key ConMgr.remove_ssh_keys(RHUA, [HA_HOSTNAME])
def test_12_delete_unreachable(): ''' add a CDS, make it unreachable, and see if it can still be deleted from the RHUA ''' # for RHBZ#1639996 # choose a random CDS hostname from the list cds = random.choice(CDS_HOSTNAMES) RHUIManagerInstance.add_instance(RHUA, "cds", cds) cds_list = RHUIManagerInstance.list(RHUA, "cds") nose.tools.assert_not_equal(cds_list, []) Helpers.break_hostname(RHUA, cds) # delete it RHUIManagerInstance.delete(RHUA, "cds", [cds]) # check it cds_list = RHUIManagerInstance.list(RHUA, "cds") nose.tools.assert_equal(cds_list, []) Helpers.unbreak_hostname(RHUA) # the node remains configured (RHUI mount point, httpd)... unconfigure it properly RHUIManagerInstance.add_instance(RHUA, "cds", cds) RHUIManagerInstance.delete(RHUA, "cds", [cds])