Esempio n. 1
0
def restart_cinder(cinder_volume_only=True):
    if not is_devstack():
        execute_assert_success(["openstack-service", "restart", "cinder-volume" if cinder_volume_only else "cinder"])
        sleep(10 if cinder_volume_only else 60)  # give time for the volume drive to come up, no APIs to checking this
    else:
        cmdline = execute_assert_success(RESTART_CINDER_DEVSTACK_CMDLINE, shell=True)
        sleep(120)
 def test_create_fifty_image_copies(self):
     # TODO chaning the quota doesn't really work on devstack
     num_copies = 10 if is_devstack() else 50
     cirrus_image = self.get_cirros_image()
     with self.provisioning_pool_context(provisioning='thin') as pool:
         with self._use_multipath_for_image_xfer_context():
             with self._cinder_quota_context(num_copies):
                 self._do_image_copy_and_assert_size(pool, cirrus_image, num_copies)
Esempio n. 3
0
 def setup_host(cls):
     if not path.exists("/usr/bin/cinder") and not is_devstack():
         raise SkipTest("openstack not installed")
     prepare_host()
     ensure_package_is_installed()
     cls.cleanup_infiniboxes_from_cinder()
Esempio n. 4
0
def restart_apache():
    if not is_devstack():
        execute_assert_success(["service", "httpd", "restart"])
        sleep(2)
Esempio n. 5
0
def restart_openstack():
    if not is_devstack():
        execute_assert_success(["openstack-service", "restart"])
        sleep(2)
Esempio n. 6
0
def prepare_host():
    """using cached_function to make sure this is called only once"""
    execute(["bin/infinihost", "settings", "check", "--auto-fix"])
    if not is_devstack():
        fix_ip_addresses_in_openstack()