def _create_vpool(self):
        """
        Needed to actually run tests on
        This is not actually a test of "Add Vpool to OVS",
        so any failure here will be reported as a setUp error and no tests will run
        """
        pmachine = System.get_my_storagerouter().pmachine
        mgmt_center = MgmtCenter(
            data={
                'name': 'Openstack',
                'description': 'test',
                'username': OVSPluginTestCase.CINDER_USER,
                'password': OVSPluginTestCase.CINDER_PASS,
                'ip': OVSPluginTestCase.CINDER_CONTROLLER,
                'port': 80,
                'type': 'OPENSTACK',
                'metadata': {
                    'integratemgmt': True
                }
            })
        mgmt_center.save()
        pmachine.mgmtcenter = mgmt_center
        pmachine.save()
        self._debug('Creating vpool')

        parameters = {
            'storagerouter_ip': OVSPluginTestCase.ip,
            'vpool_name': OVSPluginTestCase.VPOOL_NAME,
            'type': 'local',
            'storage_ip': '127.0.0.1',  # KVM
            'vrouter_port': OVSPluginTestCase.VPOOL_PORT,
            'integrate_vpool': True,
            'connection_host': OVSPluginTestCase.ip,
            'connection_port': OVSPluginTestCase.VPOOL_PORT,
            'connection_username': '',
            'connection_password': '',
            'connection_backend': {},
            'readcache_size': 50,
            'writecache_size': 50
        }
        StorageRouterController.add_vpool(parameters)
        attempt = 0
        while attempt < 10:
            vpool = VPoolList.get_vpool_by_name(OVSPluginTestCase.VPOOL_NAME)
            if vpool is not None:
                self._debug('vpool {0} created'.format(
                    OVSPluginTestCase.VPOOL_NAME))
                try:
                    os.listdir(OVSPluginTestCase.VPOOL_MOUNTPOINT)
                    return vpool
                except Exception as ex:
                    # either it doesn't exist, or we don't have permission
                    self._debug('vpool not ready yet {0}'.format(str(ex)))
                    pass
            attempt += 1
            time.sleep(2)
        raise RuntimeError(
            'Vpool {0} was not modeled correctly or did not start.'.format(
                OVSPluginTestCase.VPOOL_NAME))
예제 #2
0
    def _create_vpool(self):
        """
        Needed to actually run tests on
        This is not actually a test of "Add Vpool to OVS",
        so any failure here will be reported as a setUp error and no tests will run
        """
        pmachine = System.get_my_storagerouter().pmachine
        mgmt_center = MgmtCenter(data={'name':'Openstack',
                                       'description':'test',
                                       'username':CINDER_USER,
                                       'password':CINDER_PASS,
                                       'ip':CINDER_CONTROLLER,
                                       'port':80,
                                       'type':'OPENSTACK',
                                       'metadata':{'integratemgmt':True}})
        mgmt_center.save()
        pmachine.mgmtcenter = mgmt_center
        pmachine.save()
        self._debug('Creating vpool')
        backend_type = 'local'
        fields = ['storage_ip', 'vrouter_port']

        parameters = {'storagerouter_ip': IP,
                      'vpool_name': VPOOL_NAME,
                      'type': 'local',
                      'mountpoint_bfs': VPOOL_BFS,
                      'mountpoint_temp': VPOOL_TEMP,
                      'mountpoint_md': VPOOL_MD,
                      'mountpoint_readcaches': [VPOOL_READCACHE],
                      'mountpoint_writecaches': [VPOOL_WRITECACHE],
                      'mountpoint_foc': VPOOL_FOC,
                      'storage_ip': '127.0.0.1', #KVM
                      'vrouter_port': VPOOL_PORT,
                      'integrate_vpool': True,
                      'connection_host': IP,
                      'connection_port': VPOOL_PORT,
                      'connection_username': '',
                      'connection_password': '',
                      'connection_backend': {},
                      }
        StorageRouterController.add_vpool(parameters)
        attempt = 0
        while attempt < 10:
            vpool = VPoolList.get_vpool_by_name(VPOOL_NAME)
            if vpool is not None:
                self._debug('vpool %s created' % VPOOL_NAME)
                try:
                    os.listdir(VPOOL_MOUNTPOINT)
                    return vpool
                except Exception as ex:
                    #either it doesn't exist, or we don't have permission
                    self._debug('vpool not ready yet %s' % (str(ex)))
                    pass
            attempt += 1
            time.sleep(2)
        raise RuntimeError('Vpool %s was not modeled correctly or did not start.' % VPOOL_NAME)
예제 #3
0
    def _create_vpool(self):
        """
        Needed to actually run tests on
        This is not actually a test of "Add Vpool to OVS",
        so any failure here will be reported as a setUp error and no tests will run
        """
        pmachine = System.get_my_storagerouter().pmachine
        mgmt_center = MgmtCenter(
            data={
                "name": "Openstack",
                "description": "test",
                "username": CINDER_USER,
                "password": CINDER_PASS,
                "ip": CINDER_CONTROLLER,
                "port": 80,
                "type": "OPENSTACK",
                "metadata": {"integratemgmt": True},
            }
        )
        mgmt_center.save()
        pmachine.mgmtcenter = mgmt_center
        pmachine.save()
        self._debug("Creating vpool")

        parameters = {
            "storagerouter_ip": IP,
            "vpool_name": VPOOL_NAME,
            "type": "local",
            "storage_ip": "127.0.0.1",  # KVM
            "vrouter_port": VPOOL_PORT,
            "integrate_vpool": True,
            "connection_host": IP,
            "connection_port": VPOOL_PORT,
            "connection_username": "",
            "connection_password": "",
            "connection_backend": {},
            "readcache_size": 50,
            "writecache_size": 50,
        }
        StorageRouterController.add_vpool(parameters)
        attempt = 0
        while attempt < 10:
            vpool = VPoolList.get_vpool_by_name(VPOOL_NAME)
            if vpool is not None:
                self._debug("vpool {0} created".format(VPOOL_NAME))
                try:
                    os.listdir(VPOOL_MOUNTPOINT)
                    return vpool
                except Exception as ex:
                    # either it doesn't exist, or we don't have permission
                    self._debug("vpool not ready yet {0}".format(str(ex)))
                    pass
            attempt += 1
            time.sleep(2)
        raise RuntimeError("Vpool {0} was not modeled correctly or did not start.".format(VPOOL_NAME))
예제 #4
0
    def _create_vpool(self):
        """
        Needed to actually run tests on
        This is not actually a test of "Add Vpool to OVS",
        so any failure here will be reported as a setUp error and no tests will run
        """
        pmachine = System.get_my_storagerouter().pmachine
        mgmt_center = MgmtCenter(data={'name': 'Openstack',
                                       'description': 'test',
                                       'username': OVSPluginTestCase.CINDER_USER,
                                       'password': OVSPluginTestCase.CINDER_PASS,
                                       'ip': OVSPluginTestCase.CINDER_CONTROLLER,
                                       'port': 80,
                                       'type': 'OPENSTACK',
                                       'metadata': {'integratemgmt': True}})
        mgmt_center.save()
        pmachine.mgmtcenter = mgmt_center
        pmachine.save()
        self._debug('Creating vpool')

        parameters = {'storagerouter_ip': OVSPluginTestCase.ip,
                      'vpool_name': OVSPluginTestCase.VPOOL_NAME,
                      'type': 'local',
                      'storage_ip': '127.0.0.1',  # KVM
                      'vrouter_port': OVSPluginTestCase.VPOOL_PORT,
                      'integrate_vpool': True,
                      'connection_host': OVSPluginTestCase.ip,
                      'connection_port': OVSPluginTestCase.VPOOL_PORT,
                      'connection_username': '',
                      'connection_password': '',
                      'connection_backend': {},
                      'readcache_size': 50,
                      'writecache_size': 50
                      }
        StorageRouterController.add_vpool(parameters)
        attempt = 0
        while attempt < 10:
            vpool = VPoolList.get_vpool_by_name(OVSPluginTestCase.VPOOL_NAME)
            if vpool is not None:
                self._debug('vpool {0} created'.format(OVSPluginTestCase.VPOOL_NAME))
                try:
                    os.listdir(OVSPluginTestCase.VPOOL_MOUNTPOINT)
                    return vpool
                except Exception as ex:
                    # either it doesn't exist, or we don't have permission
                    self._debug('vpool not ready yet {0}'.format(str(ex)))
                    pass
            attempt += 1
            time.sleep(2)
        raise RuntimeError('Vpool {0} was not modeled correctly or did not start.'.format(OVSPluginTestCase.VPOOL_NAME))
예제 #5
0
 def _create_vpool(self):
     """
     Needed to actually run tests on
     This is not actually a test of "Add Vpool to OVS",
     so any failure here will be reported as a setUp error and no tests will run
     """
     self._debug('Creating vpool')
     backend_type = 'local'
     fields = ['storage_ip', 'vrouter_port']
     parameters = {
         'storagerouter_ip': IP,
         'vpool_name': VPOOL_NAME,
         'type': 'LOCAL',
         'mountpoint_bfs': VPOOL_BFS,
         'mountpoint_temp': VPOOL_TEMP,
         'mountpoint_md': VPOOL_MD,
         'mountpoint_readcache1': VPOOL_READCACHE1,
         'mountpoint_readcache2': VPOOL_READCACHE2,
         'mountpoint_writecache': VPOOL_WRITECACHE,
         'mountpoint_foc': VPOOL_FOC,
         'storage_ip': '127.0.0.1',  #KVM
         'vrouter_port': VPOOL_PORT
     }
     StorageRouterController.add_vpool(parameters)
     attempt = 0
     while attempt < 10:
         vpool = VPoolList.get_vpool_by_name(VPOOL_NAME)
         if vpool is not None:
             self._debug('vpool %s created' % VPOOL_NAME)
             try:
                 self._get_shell_client()
                 self.shell_client('chown %s %s' %
                                   (self.current_user_id, VPOOL_MOUNTPOINT))
                 os.listdir(VPOOL_MOUNTPOINT)
                 return vpool
             except Exception as ex:
                 #either it doesn't exist, or we don't have permission
                 self._debug('vpool not ready yet %s' % (str(ex)))
                 pass
         attempt += 1
         time.sleep(1)
     raise RuntimeError(
         'Vpool %s was not modeled correctly or did not start.' %
         VPOOL_NAME)
예제 #6
0
 def _create_vpool(self):
     """
     Needed to actually run tests on
     This is not actually a test of "Add Vpool to OVS",
     so any failure here will be reported as a setUp error and no tests will run
     """
     self._debug('Creating vpool')
     backend_type = 'local'
     fields = ['storage_ip', 'vrouter_port']
     parameters = {'storagerouter_ip': IP,
                   'vpool_name': VPOOL_NAME,
                   'type': 'local',
                   'mountpoint_bfs': VPOOL_BFS,
                   'mountpoint_temp': VPOOL_TEMP,
                   'mountpoint_md': VPOOL_MD,
                   'mountpoint_readcache1': VPOOL_READCACHE1,
                   'mountpoint_readcache2': VPOOL_READCACHE2,
                   'mountpoint_writecache': VPOOL_WRITECACHE,
                   'mountpoint_foc': VPOOL_FOC,
                   'storage_ip': '127.0.0.1', #KVM
                   'vrouter_port': VPOOL_PORT
                   }
     StorageRouterController.add_vpool(parameters)
     attempt = 0
     while attempt < 10:
         vpool = VPoolList.get_vpool_by_name(VPOOL_NAME)
         if vpool is not None:
             self._debug('vpool %s created' % VPOOL_NAME)
             try:
                 self._get_shell_client()
                 self.shell_client('sudo chown %s %s' % (self.current_user_id, VPOOL_MOUNTPOINT))
                 self.shell_client('sudo chmod 775 %s' % (VPOOL_MOUNTPOINT))
                 os.listdir(VPOOL_MOUNTPOINT)
                 return vpool
             except Exception as ex:
                 #either it doesn't exist, or we don't have permission
                 self._debug('vpool not ready yet %s' % (str(ex)))
                 pass
         attempt += 1
         time.sleep(2)
     raise RuntimeError('Vpool %s was not modeled correctly or did not start.' % VPOOL_NAME)
예제 #7
0
    def _create_vpool(self):
        """
        Needed to actually run tests on
        This is not actually a test of "Add Vpool to OVS",
        so any failure here will be reported as a setUp error and no tests will run
        """
        pmachine = System.get_my_storagerouter().pmachine
        mgmt_center = MgmtCenter(
            data={
                'name': 'Openstack',
                'description': 'test',
                'username': CINDER_USER,
                'password': CINDER_PASS,
                'ip': CINDER_CONTROLLER,
                'port': 80,
                'type': 'OPENSTACK',
                'metadata': {
                    'integratemgmt': True
                }
            })
        mgmt_center.save()
        pmachine.mgmtcenter = mgmt_center
        pmachine.save()
        self._debug('Creating vpool')
        backend_type = 'local'
        fields = ['storage_ip', 'vrouter_port']

        parameters = {
            'storagerouter_ip': IP,
            'vpool_name': VPOOL_NAME,
            'type': 'local',
            'mountpoint_bfs': VPOOL_BFS,
            'mountpoint_temp': VPOOL_TEMP,
            'mountpoint_md': VPOOL_MD,
            'mountpoint_readcaches': [VPOOL_READCACHE],
            'mountpoint_writecaches': [VPOOL_WRITECACHE],
            'mountpoint_foc': VPOOL_FOC,
            'storage_ip': '127.0.0.1',  #KVM
            'vrouter_port': VPOOL_PORT,
            'integrate_vpool': True,
            'connection_host': IP,
            'connection_port': VPOOL_PORT,
            'connection_username': '',
            'connection_password': '',
            'connection_backend': {},
        }
        StorageRouterController.add_vpool(parameters)
        attempt = 0
        while attempt < 10:
            vpool = VPoolList.get_vpool_by_name(VPOOL_NAME)
            if vpool is not None:
                self._debug('vpool %s created' % VPOOL_NAME)
                try:
                    os.listdir(VPOOL_MOUNTPOINT)
                    return vpool
                except Exception as ex:
                    #either it doesn't exist, or we don't have permission
                    self._debug('vpool not ready yet %s' % (str(ex)))
                    pass
            attempt += 1
            time.sleep(2)
        raise RuntimeError(
            'Vpool %s was not modeled correctly or did not start.' %
            VPOOL_NAME)