def setUp(self):
        self.test_id, self.test_dir = test_utils.get_isolated_test_env()

        self.api_protocol = 'http'
        self.api_port = get_unused_port()
        self.registry_port = get_unused_port()

        self.copy_data_file('policy.json', self.test_dir)
        self.policy_file = os.path.join(self.test_dir, 'policy.json')

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

        self.scrubber_daemon = ScrubberDaemon(self.test_dir,
                                              self.registry_port)

        self.pid_files = [self.api_server.pid_file,
                          self.registry_server.pid_file,
                          self.scrubber_daemon.pid_file]
        self.files_to_destroy = []
        self.log_files = []
Beispiel #2
0
    def setUp(self):
        self.test_id, self.test_dir = test_utils.get_isolated_test_env()

        self.api_protocol = 'http'
        self.api_port = get_unused_port()
        self.registry_port = get_unused_port()

        self.copy_data_file('policy.json', self.test_dir)
        self.policy_file = os.path.join(self.test_dir, 'policy.json')

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

        self.scrubber_daemon = ScrubberDaemon(self.test_dir,
                                              self.registry_port)

        self.pid_files = [self.api_server.pid_file,
                          self.registry_server.pid_file,
                          self.scrubber_daemon.pid_file]
        self.files_to_destroy = []
        self.log_files = []
Beispiel #3
0
    def setUp(self):
        super(FunctionalTest, self).setUp()
        self.test_id, self.test_dir = test_utils.get_isolated_test_env()

        self.api_protocol = 'http'
        self.api_port = get_unused_port()
        self.registry_port = get_unused_port()

        conf_dir = os.path.join(self.test_dir, 'etc')
        utils.safe_mkdirs(conf_dir)
        self.copy_data_file('schema-image.json', conf_dir)
        self.copy_data_file('policy.json', conf_dir)
        self.policy_file = os.path.join(conf_dir, 'policy.json')

        self.api_server = ApiServer(self.test_dir, self.api_port,
                                    self.policy_file)

        self.registry_server = RegistryServer(self.test_dir,
                                              self.registry_port)

        self.scrubber_daemon = ScrubberDaemon(self.test_dir)

        self.pid_files = [
            self.api_server.pid_file, self.registry_server.pid_file,
            self.scrubber_daemon.pid_file
        ]
        self.files_to_destroy = []
        self.launched_servers = []
Beispiel #4
0
    def setUp(self):
        super(FunctionalTest, self).setUp()
        self.test_id, self.test_dir = test_utils.get_isolated_test_env()

        self.api_protocol = 'http'
        self.api_port = get_unused_port()
        self.registry_port = get_unused_port()

        conf_dir = os.path.join(self.test_dir, 'etc')
        utils.safe_mkdirs(conf_dir)
        self.copy_data_file('schema-image.json', conf_dir)
        self.copy_data_file('policy.json', conf_dir)
        self.policy_file = os.path.join(conf_dir, 'policy.json')

        self.api_server = ApiServer(self.test_dir,
                                    self.api_port,
                                    self.policy_file)

        self.registry_server = RegistryServer(self.test_dir,
                                              self.registry_port)

        self.scrubber_daemon = ScrubberDaemon(self.test_dir)

        self.pid_files = [self.api_server.pid_file,
                          self.registry_server.pid_file,
                          self.scrubber_daemon.pid_file]
        self.files_to_destroy = []
        self.launched_servers = []
Beispiel #5
0
    def setUp(self):
        self.test_id, self.test_dir = test_utils.get_isolated_test_env()
        self.stubs = stubout.StubOutForTesting()
        stubs.stub_out_registry_and_store_server(self.stubs, self.test_dir)
        options = {'sql_connection': 'sqlite://',
                   'verbose': False,
                   'debug': False,
                   'default_store': 'filesystem',
                   'filesystem_store_datadir': os.path.join(self.test_dir)}

        self.conf = test_utils.TestConfigOpts(options)
Beispiel #6
0
 def setUp(self):
     self.test_id, self.test_dir = test_utils.get_isolated_test_env()
     self.stubs = stubout.StubOutForTesting()
     policy_file = self._copy_data_file('policy.json', self.test_dir)
     self.config(sql_connection='sqlite://',
                 verbose=False,
                 debug=False,
                 default_store='filesystem',
                 filesystem_store_datadir=os.path.join(self.test_dir),
                 policy_file=policy_file)
     super(IsolatedUnitTest, self).setUp()
     stubs.stub_out_registry_and_store_server(self.stubs, self.test_dir)
Beispiel #7
0
 def setUp(self):
     self.test_id, self.test_dir = test_utils.get_isolated_test_env()
     self.stubs = stubout.StubOutForTesting()
     policy_file = self._copy_data_file('policy.json', self.test_dir)
     self.config(sql_connection='sqlite://',
                 verbose=False,
                 debug=False,
                 default_store='filesystem',
                 filesystem_store_datadir=os.path.join(self.test_dir),
                 policy_file=policy_file)
     super(IsolatedUnitTest, self).setUp()
     stubs.stub_out_registry_and_store_server(self.stubs, self.test_dir)
Beispiel #8
0
    def setUp(self):
        self.test_id, self.test_dir = test_utils.get_isolated_test_env()
        self.stubs = stubout.StubOutForTesting()
        stubs.stub_out_registry_and_store_server(self.stubs, self.test_dir)
        options = {
            "sql_connection": "sqlite://",
            "verbose": False,
            "debug": False,
            "default_store": "filesystem",
            "filesystem_store_datadir": os.path.join(self.test_dir),
        }

        self.conf = test_utils.TestConfigOpts(options)
    def setUp(self):
        self.test_id, self.test_dir = test_utils.get_isolated_test_env()
        self.stubs = stubout.StubOutForTesting()
        stubs.stub_out_registry_and_store_server(self.stubs, self.test_dir)
        policy_file = self._copy_data_file('policy.json', self.test_dir)
        options = {'sql_connection': 'sqlite://',
                   'verbose': False,
                   'debug': False,
                   'default_store': 'filesystem',
                   'filesystem_store_datadir': os.path.join(self.test_dir),
                   'policy_file': policy_file}

        self.conf = test_utils.TestConfigOpts(options)
Beispiel #10
0
 def setUp(self):
     super(IsolatedUnitTest, self).setUp()
     self.test_id, self.test_dir = test_utils.get_isolated_test_env()
     self.stubs = stubout.StubOutForTesting()
     policy_file = self._copy_data_file('policy.json', self.test_dir)
     options = {'sql_connection': 'sqlite://',
                'verbose': False,
                'debug': False,
                'default_store': 'filesystem',
                'known_stores': test_utils.get_default_stores(),
                'filesystem_store_datadir': os.path.join(self.test_dir),
                'policy_file': policy_file}
     self.conf = test_utils.TestConfigOpts(options)
     stubs.stub_out_registry_and_store_server(self.stubs,
                                              self.conf,
                                              self.test_dir)
Beispiel #11
0
    def setUp(self):
        self.test_id, self.test_dir = test_utils.get_isolated_test_env()

        self.api_protocol = 'http'
        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)

        self.scrubber_daemon = ScrubberDaemon(self.test_dir,
                                              self.registry_port)

        self.pid_files = [self.api_server.pid_file,
                          self.registry_server.pid_file,
                          self.scrubber_daemon.pid_file]
        self.files_to_destroy = []
Beispiel #12
0
    def setUp(self):
        self.test_id, self.test_dir = test_utils.get_isolated_test_env()

        self.api_protocol = 'http'
        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)

        self.scrubber_daemon = ScrubberDaemon(self.test_dir,
                                              self.registry_port)

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