예제 #1
0
 def test_query_poolparams(self):
     # Test query pool parameters like read or write bw and read or
     # write iops, io await, recovering rate, recovered bytes
     self.body['poolid'] = test_utils.get_pool_id(self.env, self.params)
     kpi = self.params.get('kpi')
     self.body['kpi'] = kpi
     LOG.info("Try to query pool %s" % (kpi))
     resp = self.client.query_poolparams(**self.body)
     if not len(resp) > 0:
         raise exceptions.TestFail("Query pool failed")
     else:
         LOG.info("Got pool %s: %s" % (kpi, resp))
예제 #2
0
    def __get_pool_rbd_id(self):
        rbd_list = []
        pool_id = test_utils.get_pool_id(self.env, self.params)
        if self.params.get("rbd_count"):
            rbd_count = int(self.params.get("rbd_count"))
            for i in range(rbd_count):
                rbd_id = test_utils.create_rbd(pool_id=pool_id, params=self.params)
                rbd_list.append(str(rbd_id))
        else:
            rbd_id = test_utils.create_rbd(pool_id=pool_id, params=self.params)
            rbd_list.append(str(rbd_id))

        return pool_id, rbd_list
예제 #3
0
 def test_query_rbdparams(self):
     # Test query rbd parameters like read or write bw and read or
     # write iops, io await
     pool_id = test_utils.get_pool_id(self.env, self.params)
     self.body['rbdid'] = test_utils.get_available_rbd(pool_id, self.params)
     kpi = self.params.get('kpi')
     self.body['kpi'] = kpi
     LOG.info("Try to query rbd %s" % (kpi))
     resp = self.client.query_rbdparams(**self.body)
     if not len(resp) > 0:
         raise exceptions.TestFail("Query rbd failed")
     else:
         LOG.info("Got rbd %s: %s" % (kpi, resp))
예제 #4
0
    def setup(self):
        """
        Set up before executing test
        """
        if 'cluster' in self.env:
            self.cluster_id = self.env['cluster']
        elif self.params.get('cluster_id'):
            self.cluster_id = self.params.get('cluster_id')

        self.pool_id = test_utils.get_pool_id(self.env, self.params)

        for k, v in self.params.items():
            if 'rest_arg_' in k:
                new_key = k.split('rest_arg_')[1]
                self.body[new_key] = v
예제 #5
0
    def setup(self):
        """
        Set up before executing test
        """
        if self.env.get('cluster'):
            self.cluster_id = self.env.get('cluster')
        elif self.params.get('cluster_id'):
            self.cluster_id = int(self.params.get('cluster_id'))
        else:
            raise exceptions.TestSetupFail(
                'Please set cluster_id in config first')

        self.pool_id = test_utils.get_pool_id(self.env, self.params)
        if self.env.get('snapshot_rbd'):
            self.rbd_id = self.env.get('snapshot_rbd')
        else:
            self.rbd_id = test_utils.create_rbd(self.pool_id, self.params)
            LOG.info("rbd_id is %s" % self.rbd_id)
            self.env['snapshot_rbd'] = self.rbd_id

        if self.params.get('snapshots_id'):
            self.snapshot_id = self.params.get('snapshots_id')
예제 #6
0
    def setup(self):
        """
        Set up before executing test
        """
        if 'cluster' in self.env:
            self.cluster_id = self.env['cluster']
        elif self.params.get('cluster_id'):
            self.cluster_id = self.params.get('cluster_id')
        self.pools_id = test_utils.get_pool_id(self.env, self.params)
        self.params['pool_id'] = self.pools_id

        if 'rbds' in self.env:
            self.rbds_id = self.env['rbds']
        else:
            self.rbds_id = test_utils.create_rbd(self.pools_id, self.params)
            self.env['rbds'] = self.rbds_id
        self.params['rbds_id'] = self.rbds_id

        for k, v in self.params.items():
            if 'rest_arg_' in k:
                new_key = k.split('rest_arg_')[1]
                self.body[new_key] = v

        self.client = QosClient(self.params)
예제 #7
0
    def _lun_ops(self, ops):
        target_id = self.env.get('iscsi_target')['target_id']

        self.rbd_pool_id = test_utils.get_pool_id(self.env, self.params)

        if self.params.get('rbd_id'):
            self.rbd_id = self.params.get('rbd_id')
        else:
            self.rbd_id = test_utils.create_rbd(self.rbd_pool_id, self.params)

        if ops in 'add':
            body = {
                'target_id': target_id,
                'pool_id': self.rbd_pool_id,
                'rbd_id': self.rbd_id
            }
            resp = self.client.add_lun(**body)
            self.env['iscsi_target_lun'] = resp.body
            return resp

        elif ops in 'delete':
            body = {'target_id': target_id, 'lun_id': self.lun_id}

            return self.client.delete_lun(**body)
예제 #8
0
 def __get_pool_id(self):
     pool_id = test_utils.get_pool_id(self.env, self.params)
     return pool_id