Exemplo n.º 1
0
    def _run_services(self):
        for service in self._services_list:
            if isinstance(service, str):
                # only service path supplied
                service_name = service_path2service_name(service)
                process = TestProcess(service)
                pass
            else:
                assert isinstance(service, tuple)
                assert isinstance(service[0], str)
                assert isinstance(service[1], ServiceConfig)
                service_config_path = self._get_tempfile()
                service[1].set_service_name(
                    service_path2service_name(service[0]))
                service[1].write(service_config_path)
                process = TestProcess(service[0], service_config_path)

            process.run()
            self._service_processes.append(process)
Exemplo n.º 2
0
    def _run_registry(self):
        registry_path = None
        registry_config_path = None

        if self._registry is None:
            return

        if type(self._registry) == type(True):
            if self._registry is False:
                return
            # we should run registry, but no path/config supplied
            self._registry_process = TestProcess(REGISTRY_DEFAULT_PATH)
        else:
            registry_config_path = self._get_tempfile()
            if isinstance(self._registry, tuple):
                registry_path = self._registry[0]
                self._registry[1].write(registry_config_path)
            else:
                assert isinstance(self._registry, RegistryConfig)
                self._registry.write(registry_config_path)
                self._registry_process = TestProcess(registry_path,
                                                     registry_config_path)

        self._registry_process.run()