def setUp(self): if os.path.exists("%sglance-registry" % glance_bin_root()): reg_path = "%sglance-registry" % glance_bin_root() else: reg_path = "/usr/bin/glance-registry" self.service = Service(python_cmd_list() + [reg_path, glance_reg_conf()])
def check_agent_path_is_correct(self): """Make sure the agent binary listed in the config is correct.""" self.agent_bin = str(test_config.values["agent_bin"]) nova_conf = str(test_config.values["nova_conf"]) assert_true(path.exists(self.agent_bin), "Agent not found at path: %s" % self.agent_bin) self.agent = Service(cmd=[ self.agent_bin, "--flagfile=%s" % nova_conf, "--rabbit_reconnect_wait_time=1", "--preset_instance_id=-99" ])
def run(self): # Print out everything to make it print("Looking for config value %s..." % self.service_path_root) print(CONFIG.values[self.service_path_root]) path = self.service_path % CONFIG.values[self.service_path_root] print("Path = %s" % path) if not os.path.exists(path): path = self.alternate_path if path is None: fail("Could not find path to %s" % self.service_path_root) conf_path = str(CONFIG.values[self.conf_file_name]) cmds = CONFIG.python_cmd_list() + [path] + self.extra_cmds + \ [conf_path] print("Running cmds: %s" % cmds) self.service = Service(cmds) if not self.service.is_service_alive(): self.service.start()
def _setup(): """Initializes the module.""" from tests.util.users import Users global clean_slate global compute_service global dbaas global dbaas_image global dbaas_url global glance_image global keystone_service global nova global nova_auth_url global reddwarf_auth_url global test_mgmt global typical_nova_image_name global use_reaper global use_venv global users global values global version_url global volume_service global white_box global instance_create_time clean_slate = os.environ.get("CLEAN_SLATE", "False") == "True" values = load_configuration() if os.environ.get("FAKE_MODE", "False") == "True": values["fake_mode"] = True use_venv = values.get("use_venv", True) nova_auth_url = str( values.get("nova_auth_url", "http://localhost:5000/v2.0")) reddwarf_auth_url = str( values.get("reddwarf_auth_url", "http://localhost:5000/v1.1")) dbaas_url = str(values.get("dbaas_url", "http://localhost:8775/v1.0/dbaas")) version_url = str(values.get("version_url", "http://localhost:8775/")) nova_url = str(values.get("nova_url", "http://localhost:8774/v1.1")) nova_code_root = str(values["nova_code_root"]) nova_conf = str(values["nova_conf"]) keystone_conf = str(values["keystone_conf"]) reddwarf_code_root = str(values["reddwarf_code_root"]) reddwarf_conf = str(values["reddwarf_conf"]) glance_image = str(values["glance_image"]) use_reaper = values["use_reaper"] instance_create_time = values.get('instance_create_time', 16 * 60) if not nova_conf: raise ValueError("Configuration value \"nova_conf\" not found.") if str(values.get("reddwarf_api_format", "new")) == "old": dbaas = WebService(cmd=python_cmd_list() + [ "%s/bin/reddwarf-api" % reddwarf_code_root, "--flagfile=%s" % reddwarf_conf ], url=dbaas_url) else: dbaas = WebService(cmd=python_cmd_list() + [ "%s/bin/reddwarf-server" % reddwarf_code_root, "--config-file=%s" % reddwarf_conf ], url=dbaas_url) nova = WebService( cmd=python_cmd_list() + ["%s/bin/nova-api" % nova_code_root, "--flagfile=%s" % nova_conf], url=nova_url) volume_service = Service( cmd=python_cmd_list() + ["%s/bin/nova-volume" % nova_code_root, "--flagfile=%s" % nova_conf]) compute_service = Service( cmd=python_cmd_list() + ["%s/bin/nova-compute" % nova_code_root, "--flagfile=%s" % nova_conf]) keystone_service = Service( python_cmd_list() + [keystone_bin("keystone-auth"), "-c %s" % keystone_conf]) users = Users(values["users"]) dbaas_image = values.get("dbaas_image", None) typical_nova_image_name = values.get("typical_nova_image_name", None) # If true, we import certain classes and test using internal code. white_box = values.get("white_box", False) # If true, we run the mgmt tests, if not we don't. test_mgmt = values.get("test_mgmt", False)
def setUp(self): self.service = Service(python_cmd_list() + ["%s/bin/nova-reaper" % nova_code_root(), "--flagfile=%s" % nova_conf()])
def setUp(self): path = keystone_bin("keystone-all") self.service = Service(python_cmd_list() + [path, "-c %s" % keystone_conf()])