Пример #1
0
 def run(self):
     testobjectstorage = TestObjectstore()
     objectstoreAccountResource = FileTool.readJsonFromFile(self._accountResourceFilePath)
     compute_array = objectstoreAccountResource['_objectstorage']
     for compute in compute_array:
         tmp_compute = Compute()
         tmp_compute.__dict__=compute
         testobjectstorage.reStart(tmp_compute)
Пример #2
0
 def run(self):
     testMemtester = TestMemtester()
     memtesterAccountResource = FileTool.readJsonFromFile(
         self._accountResourceFilePath)
     compute_array = memtesterAccountResource['_memtesterComputes']
     for compute in compute_array:
         tmp_compute = Compute()
         tmp_compute.__dict__ = compute
         testMemtester.reStart(tmp_compute)
Пример #3
0
 def run(self):
     testUnixbench = TestUnixbench()
     unixbenchAccountResource = FileTool.readJsonFromFile(
         self._accountResourceFilePath)
     compute_array = unixbenchAccountResource['_unixbenchComputes']
     for compute in compute_array:
         tmp_compute = Compute()
         tmp_compute.__dict__ = compute
         testUnixbench.stop(tmp_compute)
Пример #4
0
 def run(self):
     testfio = TestFio()
     fioAccountResource = FileTool.readJsonFromFile(
         self._accountResourceFilePath)
     compute_array = fioAccountResource['_fioComputes']
     for compute in compute_array:
         tmp_compute = Compute()
         tmp_compute.__dict__ = compute
         testfio.stop(tmp_compute)
Пример #5
0
 def run(self):
     testSysbench = TestSysbench()
     sysbenchAccountResource=FileTool.readJsonFromFile(self._accountResourceFilePath)
     sysbench_pair_array=sysbenchAccountResource['_sysbenchComputePairs']
     for sysbench_pair in sysbench_pair_array:
         compute_client=Compute()
         trove_server=Compute()
         compute_client.__dict__ = sysbench_pair[0]
         trove_server.__dict__ = sysbench_pair[1]
         testSysbench.reStart(compute_client,trove_server)
Пример #6
0
    def run(self):
        testLoadbalancer = TestLoadbalancer()
        loadbalancerAccountResource = FileTool.readJsonFromFile(
            self._accountResourceFilePath)
        loadbalancers = loadbalancerAccountResource['_loadbalancers']

        for loadbalancer in loadbalancers:
            loadbalancer_jmeter = LoadBalancer()
            loadbalancer_jmeter.__dict__ = loadbalancer['load_compute']
            testLoadbalancer.stop(loadbalancer_jmeter)
Пример #7
0
 def run(self):
     testSysbench = TestSysbench()
     sysbenchAccountResource = FileTool.readJsonFromFile(
         self._accountResourceFilePath)
     compute_pair_array = sysbenchAccountResource['_sysbenchComputePairs']
     for compute_pair in compute_pair_array:
         compute_client = Compute()
         compute_server = Compute()
         compute_client.__dict__ = compute_pair[0]
         compute_server.__dict__ = compute_pair[1]
         testSysbench.stop(compute_client)
Пример #8
0
 def run(self):
     testIperf = TestIperf()
     iperfAccountResource = FileTool.readJsonFromFile(
         self._accountResourceFilePath)
     compute_pair_array = iperfAccountResource['_iperfComputePairs']
     for compute_pair in compute_pair_array:
         compute_client = Compute()
         compute_server = Compute()
         compute_client.__dict__ = compute_pair[0]
         compute_server.__dict__ = compute_pair[1]
         testIperf.reStart(compute_client, compute_server)
Пример #9
0
    def run(self):
        accountResource = FileTool.readJsonFromFile(
            self._accountResourceFIlePath)
        account_dict = accountResource['_account']
        computes_array = accountResource['_computes']
        volumes_array = accountResource['_volumes']
        floatIps_array = accountResource['_floatIps']
        routers_array = accountResource['_routers']
        nets_array = accountResource['_nets']
        secgroup_array = accountResource['_secgroups']
        loadbalancers_array = accountResource['_loadbalancers']
        sysbench_array = accountResource['_sysbenchComputePairs']
        heat_array = accountResource['_heatComputes']

        free = Free(account_dict)
        self._logger.info('释放数据库实例资源')
        free.freeSysbench(sysbench_array)
        self._logger.info('释放伸缩资源')
        free.freeHeat(heat_array)
        self._logger.info('释放云主机资源')
        free.freeCompute(computes_array)
        self._logger.info('释放负载均衡器资源')
        free.freeLoadbalancer(loadbalancers_array)
        self._logger.info('释放云硬盘资源')
        free.freeVolume(volumes_array)
        self._logger.info('释放浮动IP资源')
        free.freeFloatIp(floatIps_array)
        self._logger.info('释放路由器资源')
        free.freeRouter(routers_array)
        self._logger.info('释放网络资源')
        free.freeNet(nets_array)
        self._logger.info('释放安全组资源')
        free.freeSecgroup(secgroup_array)
        self._logger.info('释放对象存储资源')
        free.freeObejectstore()
        self._logger.info('释放账户')
        free.freeAccount()

        self._logger.info('删除账户资源文件' + self._accountResourceFIlePath)
        os.remove(self._accountResourceFIlePath)
Пример #10
0
    def free(self):
        if not os.path.exists('dbs/basebenchTestAccountResource.dbs'):
            return
        self._loggers.basebenchLogger.info(
            '读取文件' + 'dbs/basebenchTestAccountResource.dbs')
        accountResource = FileTool.readJsonFromFile(
            'dbs/basebenchTestAccountResource.dbs')
        account_dict = accountResource['_account']
        computes_array = accountResource['_computes']
        volumes_array = accountResource['_volumes']
        floatIps_array = accountResource['_floatIps']
        routers_array = accountResource['_routers']
        nets_array = accountResource['_nets']

        self._loggers.basebenchLogger.info(
            '释放账号' + account_dict['os_username'].encode('utf-8') + '资源')
        free = Free(account_dict)
        self._loggers.basebenchLogger.info(
            '释放账号' + account_dict['os_username'].encode('utf-8') + '的云主机资源')
        free.freeCompute(computes_array)
        self._loggers.basebenchLogger.info(
            '释放账号' + account_dict['os_username'].encode('utf-8') + '的云硬盘资源')
        free.freeVolume(volumes_array)
        self._loggers.basebenchLogger.info(
            '释放账号' + account_dict['os_username'].encode('utf-8') + '的浮动IP资源')
        free.freeFloatIp(floatIps_array)
        self._loggers.basebenchLogger.info(
            '释放账号' + account_dict['os_username'].encode('utf-8') + '的路由器资源')
        free.freeRouter(routers_array)
        self._loggers.basebenchLogger.info(
            '释放账号' + account_dict['os_username'].encode('utf-8') + '的网络资源')
        free.freeNet(nets_array)
        self._loggers.basebenchLogger.info(
            '释放账号' + account_dict['os_username'].encode('utf-8') + '账号')
        free.freeAccount()

        self._loggers.basebenchLogger.info(
            '删除文件dbs/basebenchTestAccountResource.dbs')
        os.remove('dbs/basebenchTestAccountResource.dbs')