Ejemplo n.º 1
0
 def setUp(self):
     self.keeptmp = tempfile.mkdtemp()
     os.environ['KEEP_LOCAL_STORE'] = self.keeptmp
     self.mounttmp = tempfile.mkdtemp()
     run_test_server.run()
     run_test_server.authorize_with("admin")
     self.api = arvados.safeapi.ThreadSafeApiCache(arvados.config.settings())
Ejemplo n.º 2
0
 def setUp(self):
     self.keeptmp = tempfile.mkdtemp()
     os.environ['KEEP_LOCAL_STORE'] = self.keeptmp
     self.mounttmp = tempfile.mkdtemp()
     run_test_server.run(False)
     run_test_server.authorize_with("admin")
     self.api = api = fuse.SafeApi(arvados.config)
Ejemplo n.º 3
0
 def setUpClass(cls):
     # The apiclient library has support for mocking requests for
     # testing, but it doesn't extend to the discovery document
     # itself. For now, bring up an API server that will serve
     # a discovery document.
     # FIXME: Figure out a better way to stub this out.
     run_test_server.run()
     mock_responses = {
         'arvados.humans.delete':
         (fake_httplib2_response(500, **cls.ERROR_HEADERS), ""),
         'arvados.humans.get':
         cls.api_error_response(422, "Bad UUID format",
                                "Bad output format"),
         'arvados.humans.list':
         (None, json.dumps({
             'items_available': 0,
             'items': []
         })),
     }
     req_builder = apiclient_http.RequestMockBuilder(mock_responses)
     cls.api = arvados.api('v1',
                           host=os.environ['ARVADOS_API_HOST'],
                           token='discovery-doc-only-no-token-needed',
                           insecure=True,
                           requestBuilder=req_builder)
Ejemplo n.º 4
0
 def setUp(self):
     self.keeptmp = tempfile.mkdtemp()
     os.environ['KEEP_LOCAL_STORE'] = self.keeptmp
     self.mounttmp = tempfile.mkdtemp()
     run_test_server.run(False)
     run_test_server.authorize_with("admin")
     self.api = api = fuse.SafeApi(arvados.config)
Ejemplo n.º 5
0
 def setUpClass(cls):
     try:
         del os.environ['KEEP_LOCAL_STORE']
     except KeyError:
         pass
     run_test_server.run()
     run_test_server.run_keep(blob_signing_key='abcdefghijk0123456789',
                              enforce_permissions=False)
Ejemplo n.º 6
0
    def setUp(self):
        super(FuseTagsTest, self).setUp()

        cw = arvados.CollectionWriter()

        cw.start_new_file('foo')
        cw.write("foo")

        self.testcollection = cw.finish()

        run_test_server.run()
Ejemplo n.º 7
0
    def setUp(self):
        # The underlying C implementation of open() makes a fstat() syscall
        # with the GIL still held.  When the GETATTR message comes back to
        # llfuse (which in these tests is in the same interpreter process) it
        # can't acquire the GIL, so it can't service the fstat() call, so it
        # deadlocks.  The workaround is to run some of our test code in a
        # separate process.  Forturnately the multiprocessing module makes this
        # relatively easy.
        self.pool = multiprocessing.Pool(1)

        self.keeptmp = tempfile.mkdtemp()
        os.environ['KEEP_LOCAL_STORE'] = self.keeptmp
        self.mounttmp = tempfile.mkdtemp()
        run_test_server.run()
        run_test_server.authorize_with("admin")
        self.api = arvados.safeapi.ThreadSafeApiCache(arvados.config.settings())
Ejemplo n.º 8
0
    def setUpClass(cls):
        super(KeepProxyTestCase, cls).setUpClass()

        try:
            del os.environ['KEEP_LOCAL_STORE']
        except KeyError:
            pass

        os.environ["ARVADOS_KEEP_PROXY"] = ""
        os.environ["ARVADOS_EXTERNAL_CLIENT"] = ""

        run_test_server.run()
        run_test_server.run_keep()
        arvados.keep.global_client_object = None
        arvados.config._settings = None
        run_test_server.run_keep_proxy("admin")
        KeepProxyTestCase.arvados_keep_proxy = arvados.config.get("ARVADOS_KEEP_PROXY")
Ejemplo n.º 9
0
    def setUpClass(cls):
        super(KeepTestCase, cls).setUpClass()
        try:
            del os.environ['KEEP_LOCAL_STORE']
        except KeyError:
            pass

        # Make sure these are clear, we want to talk to the Keep servers
        # directly.
        os.environ["ARVADOS_KEEP_PROXY"] = ""
        os.environ["ARVADOS_EXTERNAL_CLIENT"] = ""

        run_test_server.run()
        run_test_server.run_keep()
        arvados.keep.global_client_object = None
        arvados.config._settings = None
        run_test_server.authorize_with("admin")
Ejemplo n.º 10
0
    def setUp(self, api=None):
        # The underlying C implementation of open() makes a fstat() syscall
        # with the GIL still held.  When the GETATTR message comes back to
        # llfuse (which in these tests is in the same interpreter process) it
        # can't acquire the GIL, so it can't service the fstat() call, so it
        # deadlocks.  The workaround is to run some of our test code in a
        # separate process.  Forturnately the multiprocessing module makes this
        # relatively easy.
        self.pool = multiprocessing.Pool(1)

        self.keeptmp = tempfile.mkdtemp()
        os.environ['KEEP_LOCAL_STORE'] = self.keeptmp
        self.mounttmp = tempfile.mkdtemp()
        run_test_server.run()
        run_test_server.authorize_with("admin")
        self.api = api if api else arvados.safeapi.ThreadSafeApiCache(
            arvados.config.settings())
Ejemplo n.º 11
0
    def setUpClass(cls):
        try:
            del os.environ['KEEP_LOCAL_STORE']
        except KeyError:
            pass

        # Use the blob_signing_key from the Rails "test" configuration
        # to provision the Keep server.
        with open(os.path.join(os.path.dirname(__file__),
                               run_test_server.ARV_API_SERVER_DIR,
                               "config",
                               "application.yml")) as f:
            rails_config = yaml.load(f.read())
        try:
            config_blob_signing_key = rails_config["test"]["blob_signing_key"]
        except KeyError:
            config_blob_signing_key = rails_config["common"]["blob_signing_key"]
        run_test_server.run()
        run_test_server.run_keep(blob_signing_key=config_blob_signing_key,
                                 enforce_permissions=True)
Ejemplo n.º 12
0
 def setUpClass(cls):
     # The apiclient library has support for mocking requests for
     # testing, but it doesn't extend to the discovery document
     # itself. For now, bring up an API server that will serve
     # a discovery document.
     # FIXME: Figure out a better way to stub this out.
     run_test_server.run()
     mock_responses = {
         'arvados.humans.delete': (
             fake_httplib2_response(500, **cls.ERROR_HEADERS),
             ""),
         'arvados.humans.get': cls.api_error_response(
             422, "Bad UUID format", "Bad output format"),
         'arvados.humans.list': (None, json.dumps(
                 {'items_available': 0, 'items': []})),
         }
     req_builder = RequestMockBuilder(mock_responses)
     cls.api = arvados.api('v1', cache=False,
                           host=os.environ['ARVADOS_API_HOST'],
                           token='discovery-doc-only-no-token-needed',
                           insecure=True,
                           requestBuilder=req_builder)
Ejemplo n.º 13
0
def start():
    run_test_server.run()
    run_test_server.run_keep()
Ejemplo n.º 14
0
 def setUp(self):
     super(FuseTagsUpdateTestPoll, self).setUp()
     run_test_server.run(False)
Ejemplo n.º 15
0
 def setUp(self):
     super(FuseGroupsTest, self).setUp()
     run_test_server.run()
Ejemplo n.º 16
0
 def setUp(self):
     super(FuseTagsUpdateTestWebsockets, self).setUp()
     run_test_server.run(True)
Ejemplo n.º 17
0
 def setUp(self):
     run_test_server.run(websockets=True)
Ejemplo n.º 18
0
 def setUp(self):
     run_test_server.run()
Ejemplo n.º 19
0
 def setUpClass(cls):
     run_test_server.run()
     run_test_server.run_keep(enforce_permissions=True, num_servers=2)
     run_test_server.authorize_with('active')
Ejemplo n.º 20
0
 def setUp(self):
     self.mntdir = tempfile.mkdtemp()
     run_test_server.run()
     run_test_server.authorize_with("active")
     self.logger = logging.getLogger("null")
     self.logger.setLevel(logging.CRITICAL+1)
Ejemplo n.º 21
0
def start():
    run_test_server.run()
    run_test_server.run_keep()
Ejemplo n.º 22
0
 def setUpClass(cls):
     run_test_server.run()
Ejemplo n.º 23
0
 def setUpClass(cls):
     run_test_server.run()
     run_test_server.run_keep(enforce_permissions=True, num_servers=2)
Ejemplo n.º 24
0
 def setUpClass(cls):
     run_test_server.run()
     run_test_server.run_keep(enforce_permissions=True, num_servers=2)
     run_test_server.authorize_with('active')
Ejemplo n.º 25
0
 def setUpClass(cls):
     run_test_server.run()
     run_test_server.run_keep(enforce_permissions=True, num_servers=2)
Ejemplo n.º 26
0
 def setUpClass(cls):
     run_test_server.run()