Example #1
0
    def _initResource(self):
        """
        公共资源初始化
        :return:
        """
        self._loggers.stabilitySysbenchLogger.info('初始化命令行客户端')
        self._openstackClient=OpenstackClient(self._os_tenant_name,self._os_project_name,self._os_username,self._os_password)
        self._novaClient=NovaClient(self._os_project_name,self._os_username,self._os_password)
        self._cinderClient=CinderClient(self._os_tenant_name,self._os_project_name,self._os_username,self._os_password)
        self._troveClient = TroveClient(self._os_tenant_name, self._os_project_name, self._os_username,self._os_password)

        self._loggers.stabilitySysbenchLogger.info('初始化默认安全组、测试浮动ip、测试云主机镜像')
        self._default_secgroup_id=getDefaultSecGroupId(self._accountResource.get_secgroups(),self._readConfig.base.default_secgroup_name)
        self._admin_float_net_id=getAdminFloatNetId(self._accountResource.get_adminNets(),self._readConfig.base.admin_float_net_name)
        self._test_image_id=getTestImageId(self._accountResource.get_images(),self._readConfig.base.test_image_name)

        self._zone_names = self._readConfig.base.zone_names.split('||')

        #判断需要测试的类型
        if self._readConfig.executeTest.is_stability_test_memtester.lower()=='true':
            self._loggers.stabilitySysbenchLogger.info('===开始初始化稳定性测试sysbench资源===')
            self._initSysbench()

        self._loggers.stabilitySysbenchLogger.info('将测试初始化资源写入到文件dbs/stabilitySysbenchTestAccountResource.dbs')
        FileTool.writeObjectIntoFile(self._accountResource,'dbs/stabilitySysbenchTestAccountResource.dbs')
Example #2
0
    def _initResource(self):
        """
         """
        self._loggers.stabilityObjstoreLogger.info('初始化命令行客户端')
        self._openstackClient = OpenstackClient(self._os_tenant_name,
                                                self._os_project_name,
                                                self._os_username,
                                                self._os_password)
        self._novaClient = NovaClient(self._os_project_name, self._os_username,
                                      self._os_password)

        self._loggers.stabilityObjstoreLogger.info('初始化默认安全组、外部网络、测试镜像')
        self._default_secgroup_id = getDefaultSecGroupId(
            self._accountResource.get_secgroups(),
            self._readConfig.base.default_secgroup_name)
        self._admin_float_net_id = getAdminFloatNetId(
            self._accountResource.get_adminNets(),
            self._readConfig.base.admin_float_net_name)
        self._test_image_id = getTestImageId(
            self._accountResource.get_images(),
            self._readConfig.base.test_image_name)

        self._zone_names = self._readConfig.base.zone_names.split('||')

        if self._readConfig.executeTest.is_stability_test_objstore.lower(
        ) == 'true':
            self._loggers.stabilityObjstoreLogger.info(
                '===开始初始化对象存储稳定性测试资源===')
            self._initObjectstore()

        self._loggers.stabilityObjstoreLogger.info(
            '将测试初始化资源写入到文件dbs/stabilityObjectStorageTestAccountResource.dbs')
        FileTool.writeObjectIntoFile(
            self._accountResource,
            'dbs/stabilityObjectStorageTestAccountResource.dbs')
    def _initResource(self):
        """
        公共资源初始化
        :return:
        """
        self._loggers.basebenchLogger.info('初始化命令行客户端')
        self._openstackClient = OpenstackClient(self._os_tenant_name,
                                                self._os_project_name,
                                                self._os_username,
                                                self._os_password)
        self._novaClient = NovaClient(self._os_project_name, self._os_username,
                                      self._os_password)
        self._cinderClient = CinderClient(self._os_tenant_name,
                                          self._os_project_name,
                                          self._os_username, self._os_password)

        self._loggers.basebenchLogger.info('初始化默认安全组、测试镜像、测试镜像')
        self._default_secgroup_id = getDefaultSecGroupId(
            self._accountResource.get_secgroups(),
            self._readConfig.base.default_secgroup_name)
        self._admin_float_net_id = getAdminFloatNetId(
            self._accountResource.get_adminNets(),
            self._readConfig.base.admin_float_net_name)
        self._test_image_id = getTestImageId(
            self._accountResource.get_images(),
            self._readConfig.base.test_image_name)

        self._loggers.basebenchLogger.info('初始化可用域' +
                                           self._readConfig.base.zone_names)
        self._zone_names = self._readConfig.base.zone_names.split('||')

        #判断需要测试的类型
        if self._readConfig.executeTest.is_basebench_test_fio.lower(
        ) == 'true':
            self._loggers.basebenchLogger.info('===开始初始化fio资源===')
            self._initFio()
        if self._readConfig.executeTest.is_basebench_test_unixbench.lower(
        ) == 'true':
            self._loggers.basebenchLogger.info('===开始初始化unixbench资源===')
            self._initUnixbench()
        if self._readConfig.executeTest.is_basebench_test_iperf.lower(
        ) == 'true':
            self._loggers.basebenchLogger.info('===开始初始化iperf资源===')
            self._initIperf()

            self._loggers.basebenchLogger.info(
                '将测试初始化资源写入到文件dbs/basebenchTestAccountResource.dbs')
        FileTool.writeObjectIntoFile(self._accountResource,
                                     'dbs/basebenchTestAccountResource.dbs')
Example #4
0
    def _initResource(self):
        """
        公共资源初始化
        :return:
        """
        self._loggers.stabilityHeatLogger.info('初始化命令行客户端')
        self._openstackClient = OpenstackClient(self._os_tenant_name,
                                                self._os_project_name,
                                                self._os_username,
                                                self._os_password)
        self._novaClient = NovaClient(self._os_project_name, self._os_username,
                                      self._os_password)
        self._cinderClient = CinderClient(self._os_tenant_name,
                                          self._os_project_name,
                                          self._os_username, self._os_password)
        self._heatClient = HeatClient(self._os_tenant_name,
                                      self._os_project_name, self._os_username,
                                      self._os_password)

        self._loggers.stabilityHeatLogger.info('初始化默认安全组、测试镜像、测试镜像')
        self._default_secgroup_id = getDefaultSecGroupId(
            self._accountResource.get_secgroups(),
            self._readConfig.base.default_secgroup_name)
        self._admin_float_net_id = getAdminFloatNetId(
            self._accountResource.get_adminNets(),
            self._readConfig.base.admin_float_net_name)
        self._test_image_id = getTestImageId(
            self._accountResource.get_images(),
            self._readConfig.base.test_image_name)

        #判断是否进行memtester测试
        if self._readConfig.executeTest.is_stability_test_heat.lower(
        ) == 'true':
            self._loggers.stabilityHeatLogger.info('===开始初始化稳定性测试heat资源===')
            self._initHeat()

            self._loggers.stabilityHeatLogger.info(
                '将测试初始化资源写入到文件dbs/stabilityHeatTestAccountResource.dbs')
        FileTool.writeObjectIntoFile(
            self._accountResource, 'dbs/stabilityHeatTestAccountResource.dbs')