Пример #1
0
def test_14_verbose_reporting():
    '''
    check if a failure is reported properly (if puppet is verbose)
    '''
    # for RHBZ#1751378
    # choose a random CDS and open port 443 on it, which will later prevent Apache from starting
    cds = random.choice(CDS)
    Expect.enter(cds, "ncat -l 443 --keep-open")
    # try adding the CDS and check for the specific error message in the output
    error_msg = "change from stopped to running failed"
    RHUIManager.screen(RHUA, "cds")
    Expect.enter(RHUA, "a")
    Expect.expect(RHUA, "Hostname")
    Expect.enter(RHUA, cds.hostname)
    Expect.expect(RHUA, "Username")
    Expect.enter(RHUA, SUDO_USER_NAME)
    Expect.expect(RHUA, "Absolute")
    Expect.enter(RHUA, SUDO_USER_KEY)
    Expect.expect(RHUA, "Proceed")
    Expect.enter(RHUA, "y")
    state = Expect.expect_list(RHUA,
                               [(re.compile(".*%s.*" % error_msg, re.DOTALL), 1),
                                (re.compile(".*Aborting.*", re.DOTALL), 2),
                                (re.compile(".*was successfully configured.*", re.DOTALL), 3)],
                               timeout=180)
    # quit rhui-manager, clean up, fail if the error message didn't appear
    Expect.enter(RHUA, "q")
    Expect.enter(cds, CTRL_C)
    cds_list = RHUIManagerInstance.list(RHUA, "cds")
    if cds_list:
        RHUIManagerInstance.delete_all(RHUA, "cds")
    if state != 1:
        raise AssertionError("The expected error message was not seen in rhui-manager's output.")
Пример #2
0
def test_13_delete_select_0():
    '''
    add a CDS and see if no issue occurs if it and "a zeroth" (ghost) CDSs are selected for deletion
    '''
    # for RHBZ#1305612
    # choose a random CDS and add it
    cds = random.choice(CDS_HOSTNAMES)
    RHUIManagerInstance.add_instance(RHUA, "cds", cds)
    cds_list = RHUIManagerInstance.list(RHUA, "cds")
    nose.tools.assert_not_equal(cds_list, [])

    # try the deletion
    RHUIManager.screen(RHUA, "cds")
    Expect.enter(RHUA, "d")
    Expect.expect(RHUA, "Enter value")
    Expect.enter(RHUA, "0")
    Expect.expect(RHUA, "Enter value")
    Expect.enter(RHUA, "1")
    Expect.expect(RHUA, "Enter value")
    Expect.enter(RHUA, "c")
    state = Expect.expect_list(RHUA,
                               [(re.compile(".*Are you sure.*", re.DOTALL), 1),
                                (re.compile(".*An unexpected error.*", re.DOTALL), 2)])
    if state == 1:
        Expect.enter(RHUA, "y")
        RHUIManager.quit(RHUA, timeout=180)
    else:
        Expect.enter(RHUA, "q")

    # the CDS list ought to be empty now; if not, delete the CDS and fail
    cds_list = RHUIManagerInstance.list(RHUA, "cds")
    if cds_list:
        RHUIManagerInstance.delete_all(RHUA, "cds")
        raise AssertionError("The CDS list is not empty after the deletion attempt: %s." % cds_list)
 def test_99_cleanup(self):
     '''
        remove the repo, uninstall hap, cds, cli rpm artefacts; remove rpms from cli
     '''
     Util.remove_rpm(CLI, [self.test["test_package"], self.test["repo_id"]])
     # the errata must be removed in the DB directly:
     Expect.expect_retval(
         RHUA, "mongo pulp_database --eval 'db.units_erratum.remove({})'")
     RHUIManagerRepo.delete_all_repos(RHUA)
     Expect.expect_retval(RHUA, "rm -rf /tmp/%s*" % self.test["repo_id"])
     if not getenv("RHUISKIPSETUP"):
         RHUIManagerInstance.delete_all(RHUA, "loadbalancers")
         RHUIManagerInstance.delete_all(RHUA, "cds")
Пример #4
0
def test_99_cleanup():
    '''
       clean up
    '''
    Util.remove_rpm(CLI, [SIGNED_PACKAGE, "gpg-pubkey-%s" % SIG, REPO])
    rhel = Util.get_rhel_version(CLI)["major"]
    if rhel <= 7:
        cache = "/var/cache/yum/x86_64/%sServer/rhui-custom-%s/" % (rhel, REPO)
    else:
        cache = "/var/cache/dnf/rhui-custom-%s*/" % REPO
    Expect.expect_retval(CLI, "rm -rf %s" % cache)
    RHUIManagerRepo.delete_all_repos(RHUA)
    Expect.expect_retval(RHUA, "rm -rf /tmp/%s*" % REPO)
    if not getenv("RHUISKIPSETUP"):
        RHUIManagerInstance.delete_all(RHUA, "loadbalancers")
        RHUIManagerInstance.delete_all(RHUA, "cds")
 def test_99_cleanup(self):
     '''
        remove repos, certs, cli rpms; remove rpms from cli, uninstall cds, hap
     '''
     test_rpm_name = self.custom_rpm.rsplit('-', 2)[0]
     RHUIManagerRepo.delete_all_repos(RHUA)
     nose.tools.assert_equal(RHUIManagerRepo.list(RHUA), [])
     Expect.expect_retval(RHUA, "rm -f /root/test_ent_cli*")
     Expect.expect_retval(RHUA, "rm -rf /root/test_cli_rpm-3.0/")
     Util.remove_rpm(CLI,
                     [self.test_package, "test_cli_rpm", test_rpm_name])
     rmtree(TMPDIR)
     Helpers.del_legacy_ca(CDS, LEGACY_CA_FILE)
     if not getenv("RHUISKIPSETUP"):
         RHUIManagerInstance.delete_all(RHUA, "loadbalancers")
         RHUIManagerInstance.delete_all(RHUA, "cds")
         RHUIManager.remove_rh_certs(RHUA)
 def test_99_cleanup(self):
     '''
        remove the repo and RH cert, uninstall CDS and HAProxy, delete the ostree configuration
     '''
     RHUIManagerRepo.delete_all_repos(RHUA)
     nose.tools.assert_equal(RHUIManagerRepo.list(RHUA), [])
     RHUIManagerInstance.delete_all(RHUA, "loadbalancers")
     RHUIManagerInstance.delete_all(RHUA, "cds")
     Expect.expect_retval(RHUA, "rm -f /root/test_atomic_ent_cli*")
     Expect.expect_retval(RHUA, "rm -f /root/test_atomic_pkg.tar.gz")
     RHUIManager.remove_rh_certs(RHUA)
     if AH_EXISTS:
         Expect.expect_retval(
             ATOMIC_CLI,
             "ostree remote delete %s" % self.atomic_repo_remote)
         Expect.expect_retval(
             ATOMIC_CLI, "mv -f /etc/containers/registries.conf{.backup,}")
def test_99_cleanup():
    '''
        delete the archives and their checksum files, local caches; remove CDS
    '''
    with open(SOSREPORT_LOCATION_RHUA) as location:
        sosreport_file = location.read()
    Expect.ping_pong(
        CONNECTION_RHUA,
        "rm -f " + sosreport_file + "* ; " + "ls " + sosreport_file + "* 2>&1",
        "No such file or directory")
    with open(SOSREPORT_LOCATION_CDS) as location:
        sosreport_file = location.read()
    Expect.ping_pong(
        CONNECTION_CDS,
        "rm -f " + sosreport_file + "* ; " + "ls " + sosreport_file + "* 2>&1",
        "No such file or directory")
    rmtree(TMPDIR)
    RHUIManagerInstance.delete_all(CONNECTION_RHUA, "cds")
Пример #8
0
 def test_99_cleanup(self):
     '''
        remove the containers from the client and the RHUA, uninstall HAProxy and CDS
     '''
     if self.cli_supported:
         Expect.expect_retval(CLI, "docker rm -f $(docker ps -a -f ancestor=%s -q)" % \
                              self.container_id)
         for container in [
                 self.container_id,
                 Util.safe_pulp_repo_name(self.container_quay["name"]),
                 Util.safe_pulp_repo_name(self.container_docker["name"])
         ]:
             Expect.expect_retval(CLI, "docker rmi %s" % container)
         Util.remove_rpm(CLI, [CONF_RPM_NAME])
         Util.restart_if_present(CLI, "docker")
     Expect.expect_retval(RHUA, "rm -rf /tmp/%s*" % CONF_RPM_NAME)
     RHUIManagerRepo.delete_all_repos(RHUA)
     if not getenv("RHUISKIPSETUP"):
         RHUIManagerInstance.delete_all(RHUA, "loadbalancers")
         RHUIManagerInstance.delete_all(RHUA, "cds")
Пример #9
0
def test_99_cleanup():
    """delete CDS and HAProxy nodes"""
    RHUIManagerInstance.delete_all(RHUA, "loadbalancers")
    RHUIManagerInstance.delete_all(RHUA, "cds")
Пример #10
0
def test_08_delete_cds():
    '''
        delete all CDSs
    '''
    RHUIManagerInstance.delete_all(RHUA, "cds")