Example #1
0
class Romio(TestWithServers):
    """
    Runs Romio test.

    :avocado: recursive
    """

    def __init__(self, *args, **kwargs):

        super(Romio, self).__init__(*args, **kwargs)
        # Initialize a TestWithServers object.
        self.hostfile_clients_slots = None
        self.mpio = None

    def test_romio(self):
        """
        Test ID: DAOS-1994
        Run Romio test provided in mpich package
        Testing various I/O functions provided in romio test suite
        :avocado: tags=all,mpiio,pr,small,romio
        """
        # setting romio parameters
        romio_test_repo = self.params.get("romio_repo", '/run/romio/')

        # initialize MpioUtils
        self.mpio = MpioUtils()
        if self.mpio.mpich_installed(self.hostlist_clients) is False:
            self.fail("Exiting Test: Mpich not installed")

        try:
            # running romio
            self.mpio.run_romio(self.hostlist_clients, romio_test_repo)

            # Parsing output to look for failures
            # stderr directed to stdout
            stdout = self.logdir + "/stdout"
            searchfile = open(stdout, "r")
            error_message = ["non-zero exit code", "MPI_Abort", "errors",
                             "failed to create pool",
                             "failed to parse pool UUID",
                             "failed to destroy pool"]

            for line in searchfile:
                for i, _ in enumerate(error_message):
                    if error_message[i] in line:
                        self.fail("Romio Test Failed with error_message: "
                                  "{}".format(error_message[i]))

        except (MpioFailed) as excep:
            self.fail("<Romio Test Failed> \n{}".format(excep))
Example #2
0
class Romio(Test):
    """
    Runs Romio test.
    """
    def __init__(self, *args, **kwargs):

        super(Romio, self).__init__(*args, **kwargs)

        self.basepath = None
        self.server_group = None
        self.context = None
        self.hostlist_servers = None
        self.hostfile_servers = None
        self.hostlist_clients = None
        self.hostfile_clients = None

    def setUp(self):
        self.agent_sessions = None
        # get paths from the build_vars generated by build
        with open('../../../.build_vars.json') as build_file:
            build_paths = json.load(build_file)
        self.basepath = os.path.normpath(build_paths['PREFIX'] + "/../")

        self.server_group = self.params.get("name", '/server_config/',
                                            'daos_server')

        # setup the DAOS python API
        self.context = DaosContext(build_paths['PREFIX'] + '/lib/')

        self.hostlist_servers = self.params.get("test_servers", '/run/hosts/')
        self.hostfile_servers = (write_host_file.write_host_file(
            self.hostlist_servers, self.workdir))
        print("Host file servers is: {}".format(self.hostfile_servers))

        self.hostlist_clients = self.params.get("test_clients", '/run/hosts/')
        self.hostfile_clients = (write_host_file.write_host_file(
            self.hostlist_clients, self.workdir))
        print("Host file clients is: {}".format(self.hostfile_clients))

        # start servers
        self.agent_sessions = agent_utils.run_agent(self.basepath,
                                                    self.hostlist_servers,
                                                    self.hostlist_clients)
        server_utils.run_server(self.hostfile_servers, self.server_group,
                                self.basepath)

        self.mpio = None

    def tearDown(self):
        if self.agent_sessions:
            agent_utils.stop_agent(self.agent_sessions, self.hostlist_clients)
        server_utils.stop_server(hosts=self.hostlist_servers)

    @skipForTicket("CORCI-635")
    def test_romio(self):
        """
        Test ID: DAOS-1994
        Run Romio test provided in mpich package
        Testing various I/O functions provided in romio test suite
        :avocado: tags=all,mpiio,pr,small,romio
        """
        # setting romio parameters
        romio_test_repo = self.params.get("romio_repo", '/run/romio/')

        # initialize MpioUtils
        self.mpio = MpioUtils()
        if self.mpio.mpich_installed(self.hostlist_clients) is False:
            self.fail("Exiting Test: Mpich not installed")

        try:
            # Romio do not need slots in hostfile
            with open(self.hostfile_clients) as client_file:
                new_text = client_file.read().replace('slots=1', '')

            with open(self.hostfile_clients, "w") as client_file:
                client_file.write(new_text)

            # running romio
            self.mpio.run_romio(self.basepath, self.hostlist_clients,
                                romio_test_repo)

            # Parsing output to look for failures
            # stderr directed to stdout
            stdout = self.logdir + "/stdout"
            searchfile = open(stdout, "r")
            error_message = [
                "non-zero exit code", "MPI_Abort", "errors",
                "failed to create pool", "failed to parse pool UUID",
                "failed to destroy pool"
            ]

            for line in searchfile:
                for i in xrange(len(error_message)):
                    if error_message[i] in line:
                        self.fail("Romio Test Failed with error_message: "
                                  "{}".format(error_message[i]))

        except (MpioFailed) as excep:
            self.fail("<Romio Test Failed> \n{}".format(excep))
Example #3
0
class Romio(Test):
    """
    Runs Romio test.
    """

    def __init__(self, *args, **kwargs):

        super(Romio, self).__init__(*args, **kwargs)

        self.basepath = None
        self.server_group = None
        self.context = None
        self.hostlist_servers = None
        self.hostfile_servers = None
        self.hostlist_clients = None
        self.hostfile_clients = None

    def setUp(self):
        self.agent_sessions = None
        # get paths from the build_vars generated by build
        with open('../../../.build_vars.json') as build_file:
            build_paths = json.load(build_file)
        self.basepath = os.path.normpath(build_paths['PREFIX'] + "/../")

        self.server_group = self.params.get("name", '/server_config/',
                                            'daos_server')

        # setup the DAOS python API
        self.context = DaosContext(build_paths['PREFIX'] + '/lib/')

        self.hostlist_servers = self.params.get("test_servers", '/run/hosts/')
        self.hostfile_servers = (
            write_host_file.write_host_file(self.hostlist_servers,
                                            self.workdir))
        print("Host file servers is: {}".format(self.hostfile_servers))

        self.hostlist_clients = self.params.get("test_clients", '/run/hosts/')
        self.hostfile_clients = (
            write_host_file.write_host_file(self.hostlist_clients,
                                            self.workdir))
        print("Host file clients is: {}".format(self.hostfile_clients))

        # start servers
        self.agent_sessions = AgentUtils.run_agent(self.basepath,
                                                   self.hostlist_servers,
                                                   self.hostlist_clients)
        server_utils.run_server(self.hostfile_servers, self.server_group,
                                self.basepath)

        self.mpio = None

    def tearDown(self):
        if self.agent_sessions:
            AgentUtils.stop_agent(self.hostlist_clients, self.agent_sessions)
        server_utils.stop_server(hosts=self.hostlist_servers)

    def test_romio(self):
        """
        Test ID: DAOS-1994
        Run Romio test provided in mpich package
        Testing various I/O functions provided in romio test suite
        :avocado: tags=mpio,romio
        """
        # setting romio parameters
        romio_test_repo = self.params.get("romio_repo", '/run/romio/')

        # initialize MpioUtils
        self.mpio = MpioUtils()
        if self.mpio.mpich_installed(self.hostlist_clients) is False:
            self.fail("Exiting Test: Mpich not installed")

        try:
            # Romio do not need slots in hostfile
            with open(self.hostfile_clients) as client_file:
                new_text = client_file.read().replace('slots=1', '')

            with open(self.hostfile_clients, "w") as client_file:
                client_file.write(new_text)

            # running romio
            self.mpio.run_romio(self.basepath, self.hostlist_clients,
                                romio_test_repo)

            # Parsing output to look for failures
            # stderr directed to stdout
            stdout = self.logdir + "/stdout"
            searchfile = open(stdout, "r")
            error_message = ["non-zero exit code", "MPI_Abort", "errors",
                             "failed to create pool",
                             "failed to parse pool UUID",
                             "failed to destroy pool"]

            for line in searchfile:
                for i in xrange(len(error_message)):
                    if error_message[i] in line:
                        self.fail("Romio Test Failed with error_message: "
                                  "{}".format(error_message[i]))

        except (MpioFailed) as excep:
            self.fail("<Romio Test Failed> \n{}".format(excep))