当前位置: 首页>>代码示例>>Python>>正文


Python AgentUtils.run_agent方法代码示例

本文整理汇总了Python中AgentUtils.run_agent方法的典型用法代码示例。如果您正苦于以下问题:Python AgentUtils.run_agent方法的具体用法?Python AgentUtils.run_agent怎么用?Python AgentUtils.run_agent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AgentUtils的用法示例。


在下文中一共展示了AgentUtils.run_agent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    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
开发者ID:daos-stack,项目名称:daos,代码行数:35,代码来源:romio.py

示例2: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):
        self.agent_sessions = None
        self.hostlist = None
        self.subtest_name = self.params.get("test_name",
                                            '/run/daos_tests/Tests/*')
        self.subtest_name = self.subtest_name.replace(" ", "_")
        # get paths from the build_vars generated by build
        with open('../../../.build_vars.json') as build_vars:
            build_paths = json.load(build_vars)
        self.basepath = os.path.normpath(build_paths['PREFIX'] + "/../")

        self.server_group = self.params.get("name", '/server_config/',
                                            'daos_server')
        self.daos_test = self.basepath + '/install/bin/daos_test'
        self.orterun = self.basepath + '/install/bin/orterun'
        self.hostlist = self.params.get("test_machines", '/run/hosts/*')

        self.hostfile = write_host_file.write_host_file(self.hostlist,
                                                        self.workdir)
        logfile_env = os.environ['D_LOG_FILE']
        self.log_dir, self.server_log = os.path.split(logfile_env)
        self.client_log = os.path.join(self.log_dir,
                                       self.subtest_name + "_" + CLIENT_LOG)
        #To generate the seperate client log file
        self.orterun_env = '-x D_LOG_FILE={}'.format(self.client_log)

        self.agent_sessions = AgentUtils.run_agent(self.basepath, self.hostlist)
        server_utils.run_server(self.hostfile, self.server_group, self.basepath)
开发者ID:daos-stack,项目名称:daos,代码行数:30,代码来源:daos_core_test.py

示例3: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):
        self.agent_sessions = None
        self.hostlist = None
        self.pool = 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.pool = None

        self.hostlist = self.params.get("test_machines", '/run/hosts/*')
        self.hostfile = write_host_file.write_host_file(self.hostlist,
                                                        self.workdir)
        print("Host file is: {}".format(self.hostfile))

        self.agent_sessions = AgentUtils.run_agent(self.basepath, self.hostlist)
        server_utils.run_server(self.hostfile, self.server_group, self.basepath)
        time.sleep(10)
开发者ID:daos-stack,项目名称:daos,代码行数:27,代码来源:container_async.py

示例4: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):
        self.agent_sessions = None
        with open('../../../.build_vars.json') as json_f:
            build_paths = json.load(json_f)
        basepath = os.path.normpath(build_paths['PREFIX']  + "/../")
        server_group = self.params.get("name",
                                       '/server_config/',
                                       'daos_server')
        self.context = DaosContext(build_paths['PREFIX'] + '/lib/')
        self.container = None
        self.hostlist = self.params.get("test_machines", '/run/hosts/*')
        self.hostfile = write_host_file.write_host_file(self.hostlist,
                                                        self.workdir)

        self.agent_sessions = AgentUtils.run_agent(basepath, self.hostlist)
        server_utils.run_server(self.hostfile, server_group, basepath)

        self.pool = DaosPool(self.context)
        self.pool.create(self.params.get("mode", '/run/pool/createmode/*'),
                         os.geteuid(),
                         os.getegid(),
                         self.params.get("size", '/run/pool/createsize/*'),
                         self.params.get("setname", '/run/pool/createset/*'),
                         None)
        self.pool.connect(1 << 1)
开发者ID:daos-stack,项目名称:daos,代码行数:27,代码来源:create_many_dkeys.py

示例5: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):
        self.agent_sessions = None
        self.hostlist = None

        # get paths from the build_vars generated by build
        with open(os.path.join(os.path.dirname(os.path.realpath(__file__)),
                               "../../../../.build_vars.json")) as build_file:
            build_paths = json.load(build_file)
        self.basepath = os.path.normpath(build_paths['PREFIX'] + "/../")

        self.hostlist = self.params.get("test_machines", '/run/hosts/')

        # NULL is causing connect to blow up so skip that test for now
        uuidlist = self.params.get("uuid", '/run/connecttests/UUID/*/')
        connectuuid = uuidlist[0]
        if connectuuid == 'NULLPTR':
            self.cancel("skipping null pointer test until DAOS-1781 is fixed")

        # launch the server
        self.hostfile = write_host_file.write_host_file(self.hostlist,
                                                        self.workdir)
        server_group = self.params.get("name", '/server_config/',
                                       'daos_server')
        self.agent_sessions = AgentUtils.run_agent(self.basepath, self.hostlist)
        server_utils.run_server(self.hostfile, server_group, self.basepath)
开发者ID:daos-stack,项目名称:daos,代码行数:27,代码来源:bad_connect.py

示例6: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):
        """ setup for the test """
        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.context = DaosContext(build_paths['PREFIX'] + '/lib/')
        self.basepath = os.path.normpath(build_paths['PREFIX'] + "/../")

        # generate a hostfile
        self.hostlist = self.params.get("test_machines", '/run/hosts/')
        self.hostfile = write_host_file.write_host_file(self.hostlist,
                                                        self.workdir)

        # fire up the DAOS servers
        self.server_group = self.params.get("name", '/run/server_config/',
                                            'daos_server')
        self.agent_sessions = AgentUtils.run_agent(self.basepath, self.hostlist)
        server_utils.run_server(self.hostfile, self.server_group,
                                build_paths['PREFIX'] + '/../')

        # create a pool to test with
        createmode = self.params.get("mode", '/run/pool/createmode/')
        createuid = self.params.get("uid", '/run/pool/createuid/')
        creategid = self.params.get("gid", '/run/pool/creategid/')
        createsetid = self.params.get("setname", '/run/pool/createset/')
        createsize = self.params.get("size", '/run/pool/createsize/')
        self.pool = DaosPool(self.context)
        self.pool.create(createmode, createuid, creategid, createsize,
                         createsetid)
        self.pool.get_uuid_str()

        time.sleep(2)
开发者ID:daos-stack,项目名称:daos,代码行数:35,代码来源:destroy_rebuild.py

示例7: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):
        self.agent_sessions = None
        # get paths from the build_vars generated by build
        self.hostlist = None
        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')

        # parameters used in pool create
        self.createmode = self.params.get("mode",
                                          '/run/createtests/createmode/')
        self.createuid = os.geteuid()
        self.creategid = os.getegid()
        self.createsetid = self.params.get("setname",
                                           '/run/createtests/createset/')
        self.createsize = self.params.get("size",
                                          '/run/createtests/createsize/')

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

        # hostlist and logging
        self.d_log = DaosLog(self.context)

        self.hostlist = self.params.get("test_machines", '/run/hosts/*')
        self.hostfile = write_host_file.write_host_file(self.hostlist,
                                                        self.workdir)
        self.agent_sessions = AgentUtils.run_agent(self.basepath, self.hostlist)
        server_utils.run_server(self.hostfile, self.server_group, self.basepath)
开发者ID:daos-stack,项目名称:daos,代码行数:35,代码来源:delete.py

示例8: test_simple_delete

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def test_simple_delete(self):
        """
        Test destroying a pool created on a single server, nobody is using
        the pool, force is not needed.

        :avocado: tags=pool,pooldestroy,quick
        """
        self.hostlist = self.params.get("test_machines1", '/run/hosts/')
        hostfile = write_host_file.write_host_file(self.hostlist, self.tmp)

        self.agent_sessions = AgentUtils.run_agent(self.basepath, self.hostlist)
        server_utils.run_server(hostfile, self.server_group, self.basepath)

        setid = self.params.get("setname",
                                '/run/setnames/validsetname/')

        try:
            # use the uid/gid of the user running the test, these should
            # be perfectly valid
            uid = os.geteuid()
            gid = os.getegid()

            # TODO make these params in the yaml
            daosctl = self.basepath + '/install/bin/daosctl'

            create_cmd = ('{0} create-pool -m {1} -u {2} -g {3} -s {4}'
                          .format(daosctl, 0x731, uid, gid, setid))

            uuid_str = """{0}""".format(process.system_output(create_cmd))
            print ("uuid is {0}\n".format(uuid_str))

            host = self.hostlist[0]
            exists = check_for_pool.check_for_pool(host, uuid_str)
            if exists != 0:
                self.fail("Pool {0} not found on host {1}.\n"
                          .format(uuid_str, host))

            delete_cmd = ('{0} destroy-pool -i {1} -s {2}'
                          .format(daosctl, uuid_str, setid))
            process.system(delete_cmd)

            exists = check_for_pool.check_for_pool(host, uuid_str)
            if exists == 0:
                self.fail("Pool {0} found on host {1} when not expected.\n"
                          .format(uuid_str, host))

        except Exception as excep:
            print(excep)
            print(traceback.format_exc())
            self.fail("Expecting to pass but test has failed.\n")

        # no matter what happens shutdown the server
        finally:
            try:
                os.remove(hostfile)
            finally:
                if self.agent_sessions:
                    AgentUtils.stop_agent(self.hostlist, self.agent_sessions)
                server_utils.stop_server(hosts=self.hostlist)
开发者ID:daos-stack,项目名称:daos,代码行数:61,代码来源:destroy_tests.py

示例9: test_destroy_connect

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def test_destroy_connect(self):
        """
        Test destroying a pool that has a connected client with force == false.
        Should fail.

        :avocado: tags=pool,pooldestroy,x
        """
        host = self.hostlist[0]
        try:

            # write out a hostfile and start the servers with it
            self.hostlist = self.params.get("test_machines1", '/run/hosts/')
            hostfile = write_host_file.write_host_file(self.hostlist, self.tmp)

            self.agent_sessions = AgentUtils.run_agent(self.basepath,
                                                       self.hostlist)
            server_utils.run_server(hostfile, self.server_group, self.basepath)

            # parameters used in pool create
            createmode = self.params.get("mode", '/run/poolparams/createmode/')
            createuid = self.params.get("uid", '/run/poolparams/createuid/')
            creategid = self.params.get("gid", '/run/poolparams/creategid/')
            createsetid = self.params.get("setname",
                                          '/run/poolparams/createset/')
            createsize = self.params.get("size", '/run/poolparams/createsize/')

            # initialize a python pool object then create the underlying
            # daos storage
            pool = DaosPool(self.context)
            pool.create(createmode, createuid, creategid,
                        createsize, createsetid, None)

            # need a connection to create container
            pool.connect(1 << 1)

            # destroy pool with connection open
            pool.destroy(0)

            # should throw an exception and not hit this
            self.fail("Shouldn't hit this line.\n")

        except DaosApiError as excep:
            print("got exception which is expected so long as it is BUSY")
            print(excep)
            print(traceback.format_exc())
            # pool should still be there
            exists = check_for_pool.check_for_pool(host, pool.get_uuid_str)
            if exists != 0:
                self.fail("Pool gone, but destroy should have failed.\n")

        # no matter what happens cleanup
        finally:
            if self.agent_sessions:
                AgentUtils.stop_agent(self.hostlist, self.agent_sessions)
            server_utils.stop_server(hosts=self.hostlist)
            os.remove(hostfile)
开发者ID:daos-stack,项目名称:daos,代码行数:58,代码来源:destroy_tests.py

示例10: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):
        self.agent_sessions = None
        self.pool = None
        self.container = None
        self.obj = None
        self.ioreq = None
        self.hostlist = None
        self.hostfile = None
        self.no_of_dkeys = None
        self.no_of_akeys = None
        self.array_size = None
        self.record_length = None

        with open('../../../.build_vars.json') as json_f:
            build_paths = json.load(json_f)
        basepath = os.path.normpath(build_paths['PREFIX']  + "/../")
        server_group = self.params.get("name",
                                       '/server_config/',
                                       'daos_server')
        self.context = DaosContext(build_paths['PREFIX'] + '/lib/')
        self.d_log = DaosLog(self.context)
        self.hostlist = self.params.get("test_machines", '/run/hosts/*')
        self.hostfile = write_host_file.write_host_file(self.hostlist,
                                                        self.workdir)
        self.no_of_dkeys = self.params.get("no_of_dkeys", '/run/dkeys/*')[0]
        self.no_of_akeys = self.params.get("no_of_akeys", '/run/akeys/*')[0]
        self.array_size = self.params.get("size", '/array_size/')
        self.record_length = self.params.get("length", '/run/record/*')

        self.agent_sessions = AgentUtils.run_agent(basepath, self.hostlist)
        server_utils.run_server(self.hostfile, server_group, basepath)

        self.pool = DaosPool(self.context)
        self.pool.create(self.params.get("mode", '/run/pool/createmode/*'),
                         os.geteuid(),
                         os.getegid(),
                         self.params.get("size", '/run/pool/createsize/*'),
                         self.params.get("setname", '/run/pool/createset/*'),
                         None)
        self.pool.connect(2)

        self.container = DaosContainer(self.context)
        self.container.create(self.pool.handle)
        self.container.open()

        self.obj = DaosObj(self.context, self.container)
        self.obj.create(objcls=1)
        self.obj.open()
        self.ioreq = IORequest(self.context,
                               self.container,
                               self.obj, objtype=4)
开发者ID:daos-stack,项目名称:daos,代码行数:53,代码来源:object_integrity.py

示例11: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):
        self.agent_sessions = None
        try:
            # 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 = self.params.get("test_machines", '/run/hosts/*')
                self.hostfile = write_host_file.write_host_file(self.hostlist,
                                                                self.workdir)

                self.agent_sessions = AgentUtils.run_agent(self.basepath,
                                                           self.hostlist)
                server_utils.run_server(self.hostfile, self.server_group,
                                        self.basepath)

                # parameters used in pool create
                createmode = self.params.get("mode", '/run/pool/createmode/')
                createsetid = self.params.get("setname", '/run/pool/createset/')
                createsize = self.params.get("size", '/run/pool/createsize/')

                createuid = os.geteuid()
                creategid = os.getegid()

                # initialize a python pool object then create the underlying
                # daos storage
                self.pool = DaosPool(self.context)
                self.pool.create(createmode, createuid, creategid,
                                 createsize, createsetid, None)
                self.pool.connect(1 << 1)

                # create a container
                self.container = DaosContainer(self.context)
                self.container.create(self.pool.handle)

                # now open it
                self.container.open()

        except DaosApiError as excep:
            print(excep)
            print(traceback.format_exc())
            self.fail("Test failed during setup.\n")
开发者ID:daos-stack,项目名称:daos,代码行数:51,代码来源:punch_test.py

示例12: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):
        super(TestWithServers, self).setUp()

        self.server_group = self.params.get("server_group", '/server/',
                                            'daos_server')
        self.hostlist_servers = self.params.get("test_machines", '/run/hosts/*')

        self.hostfile_servers = write_host_file.write_host_file(
            self.hostlist_servers,
            self.workdir)

        self.agent_sessions = AgentUtils.run_agent(self.basepath,
                                                   self.hostlist_servers)
        server_utils.run_server(self.hostfile_servers, self.server_group,
                                self.basepath)
开发者ID:daos-stack,项目名称:daos,代码行数:17,代码来源:test.py

示例13: test_many_servers

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def test_many_servers(self):
        """
        Test destroy on a large (relative) number of servers.

        :avocado: tags=pool,pooldestroy,destroybig
        """
        try:
            # write out a hostfile and start the servers with it
            self.hostlist = self.params.get("test_machines6", '/run/hosts/')
            hostfile = write_host_file.write_host_file(self.hostlist, self.tmp)

            self.agent_sessions = AgentUtils.run_agent(self.basepath,
                                                       self.hostlist)
            server_utils.run_server(hostfile, self.server_group, self.basepath)

            # parameters used in pool create
            createmode = self.params.get("mode", '/run/poolparams/createmode/')
            createuid = self.params.get("uid", '/run/poolparams/createuid/')
            creategid = self.params.get("gid", '/run/poolparams/creategid/')
            createsetid = self.params.get("setname",
                                          '/run/poolparams/createset/')
            createsize = self.params.get("size", '/run/poolparams/createsize/')

            # initialize a python pool object then create the underlying
            # daos storage
            pool = DaosPool(self.context)
            pool.create(createmode, createuid, creategid,
                        createsize, createsetid, None)

            time.sleep(1)

            # okay, get rid of it
            pool.destroy(1)

        except DaosApiError as excep:
            print(excep)
            print(traceback.format_exc())
            self.fail("6 server test failed.\n")

        except Exception as excep:
            self.fail("Daos code segfaulted most likely.  Error: %s" % excep)

        # no matter what happens cleanup
        finally:
            if self.agent_sessions:
                AgentUtils.stop_agent(self.hostlist, self.agent_sessions)
            server_utils.stop_server(hosts=self.hostlist)
            os.remove(hostfile)
开发者ID:daos-stack,项目名称:daos,代码行数:50,代码来源:destroy_tests.py

示例14: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):

        # 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.hostlist = self.params.get("test_machines", '/run/hosts/')
        self.hostfile = write_host_file.write_host_file(self.hostlist,
                                                        self.workdir)

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

        self.agent_sessions = AgentUtils.run_agent(self.basepath, self.hostlist)
        server_utils.run_server(self.hostfile, server_group, self.basepath)
开发者ID:daos-stack,项目名称:daos,代码行数:18,代码来源:connect_test.py

示例15: setUp

# 需要导入模块: import AgentUtils [as 别名]
# 或者: from AgentUtils import run_agent [as 别名]
    def setUp(self):
        self.agent_sessions = None
        # there is a presumption that this test lives in a specific spot
        # in the repo
        # get paths from the build_vars generated by build
        self.hostlist = None
        with open('../../../.build_vars.json') as f_open:
            build_paths = json.load(f_open)
        basepath = os.path.normpath(build_paths['PREFIX']  + "/../")
        self.hostlist = self.params.get("test_machines", '/run/hosts/')
        self.hostfile = write_host_file.write_host_file(self.hostlist,
                                                        self.workdir)
        server_group = self.params.get("name", '/server_config/',
                                       'daos_server')

        self.agent_sessions = AgentUtils.run_agent(basepath, self.hostlist)
        server_utils.run_server(self.hostfile, server_group, basepath)
        self.dmg = basepath + '/install/bin/dmg'
开发者ID:daos-stack,项目名称:daos,代码行数:20,代码来源:multi_server_create_delete_test.py


注:本文中的AgentUtils.run_agent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。