示例#1
0
文件: __init__.py 项目: emonty/glance
    def setUp(self):

        self.test_id = random.randint(0, 100000)
        self.test_dir = os.path.join("/", "tmp", "test.%d" % self.test_id)

        self.api_port = get_unused_port()
        self.registry_port = get_unused_port()

        self.api_server = ApiServer(self.test_dir,
                                    self.api_port,
                                    self.registry_port)
        self.registry_server = RegistryServer(self.test_dir,
                                              self.registry_port)

        registry_db = self.registry_server.sql_connection
        self.scrubber_daemon = ScrubberDaemon(self.test_dir,
                                              sql_connection=registry_db)

        self.pid_files = [self.api_server.pid_file,
                          self.registry_server.pid_file,
                          self.scrubber_daemon.pid_file]
        self.files_to_destroy = []