Пример #1
0
 def test_hdfs_creation_local_abs_url(self, check_data_source_unique_name):
     check_data_source_unique_name.return_value = True
     data = {
         "name": "test_data_data_source",
         "url": "/tmp/output",
         "type": "hdfs",
         "description": "correct url schema for absolute path on local hdfs"
     }
     ds.check_data_source_create(data)
Пример #2
0
 def test_hdfs_creation_local_rel_url(self, check_data_source_unique_name):
     check_data_source_unique_name.return_value = True
     data = {
         "name": "test_data_data_source",
         "url": "mydata/input",
         "type": "hdfs",
         "description": "correct url schema for relative path on local hdfs"
     }
     ds.check_data_source_create(data)
Пример #3
0
 def test_hdfs_creation_local_abs_url(self, check_data_source_unique_name):
     check_data_source_unique_name.return_value = True
     data = {
         "name": "test_data_data_source",
         "url": "/tmp/output",
         "type": "hdfs",
         "description": "correct url schema for absolute path on local hdfs"
     }
     ds.check_data_source_create(data)
Пример #4
0
 def test_hdfs_creation_local_rel_url(self, check_data_source_unique_name):
     check_data_source_unique_name.return_value = True
     data = {
         "name": "test_data_data_source",
         "url": "mydata/input",
         "type": "hdfs",
         "description": "correct url schema for relative path on local hdfs"
     }
     ds.check_data_source_create(data)
Пример #5
0
 def test_manila_creation_no_path(self, check_ds_unique_name):
     check_ds_unique_name.return_value = True
     data = {
         "name": "test_data_data_source",
         "url": "manila://%s" % uuid.uuid4(),
         "type": "manila",
         "description": ("netloc is not a uuid")
     }
     with testtools.ExpectedException(ex.InvalidDataException):
         ds.check_data_source_create(data)
Пример #6
0
 def test_manila_creation_empty_url(self, check_ds_unique_name):
     check_ds_unique_name.return_value = True
     data = {
         "name": "test_data_data_source",
         "url": "",
         "type": "manila",
         "description": ("empty url")
     }
     with testtools.ExpectedException(ex.InvalidDataException):
         ds.check_data_source_create(data)
Пример #7
0
 def test_manila_creation_wrong_schema(self, check_ds_unique_name):
     check_ds_unique_name.return_value = True
     data = {
         "name": "test_data_data_source",
         "url": "man://%s" % uuid.uuid4(),
         "type": "manila",
         "description": ("incorrect url schema for")
     }
     with testtools.ExpectedException(ex.InvalidDataException):
         ds.check_data_source_create(data)
Пример #8
0
 def test_manila_creation_no_path(self, check_ds_unique_name):
     check_ds_unique_name.return_value = True
     data = {
         "name": "test_data_data_source",
         "url": "manila://%s" % uuid.uuid4(),
         "type": "manila",
         "description": ("netloc is not a uuid")
     }
     with testtools.ExpectedException(ex.InvalidDataException):
         ds.check_data_source_create(data)
Пример #9
0
 def test_manila_creation_empty_url(self, check_ds_unique_name):
     check_ds_unique_name.return_value = True
     data = {
         "name": "test_data_data_source",
         "url": "",
         "type": "manila",
         "description": ("empty url")
     }
     with testtools.ExpectedException(ex.InvalidDataException):
         ds.check_data_source_create(data)
Пример #10
0
 def test_manila_creation_wrong_schema(self, check_ds_unique_name):
     check_ds_unique_name.return_value = True
     data = {
         "name": "test_data_data_source",
         "url": "man://%s" % uuid.uuid4(),
         "type": "manila",
         "description": ("incorrect url schema for")
     }
     with testtools.ExpectedException(ex.InvalidDataException):
         ds.check_data_source_create(data)
Пример #11
0
    def test_hdfs_creation_correct_url(self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "hdfs://test_cluster/",
            "type": "hdfs",
            "description": "correct url schema"
        }
        ds.check_data_source_create(data)
Пример #12
0
    def test_maprfs_creation_correct_url(self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "maprfs:///test_cluster/",
            "type": "maprfs",
            "description": "correct url schema"
        }
        ds.check_data_source_create(data)
Пример #13
0
    def test_swift_creation_wrong_schema(self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "swif://1234/object",
            "type": "swift",
            "description": "incorrect url schema"
        }
        with self.assertRaises(ex.InvalidException):
            ds.check_data_source_create(data)
Пример #14
0
    def test_swift_creation_missing_credentials(self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": SAMPLE_SWIFT_URL,
            "type": "swift",
            "description": "long description",
        }
        with testtools.ExpectedException(ex.InvalidCredentials):
            ds.check_data_source_create(data)
Пример #15
0
    def test_swift_creation_wrong_schema(self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "swif://1234/object",
            "type": "swift",
            "description": "incorrect url schema"
        }
        with testtools.ExpectedException(ex.InvalidDataException):
            ds.check_data_source_create(data)
Пример #16
0
    def test_swift_creation_wrong_schema(self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "swif://1234%s/object" % su.SWIFT_URL_SUFFIX,
            "type": "swift",
            "description": "incorrect url schema"
        }
        with self.assertRaises(ex.InvalidException):
            ds.check_data_source_create(data)
Пример #17
0
    def test_hdfs_creation_wrong_schema(self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "hdf://test_cluster/",
            "type": "hdfs",
            "description": "incorrect url schema"
        }
        with self.assertRaises(ex.InvalidException):
            ds.check_data_source_create(data)
Пример #18
0
    def test_maprfs_creation_wrong_schema(self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "maprf://test_cluster/",
            "type": "maprfs",
            "description": "incorrect url schema"
        }
        with testtools.ExpectedException(ex.InvalidException):
            ds.check_data_source_create(data)
Пример #19
0
    def test_swift_creation_wrong_suffix(self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "swift://1234.suffix/object",
            "type": "swift",
            "description": "incorrect url schema"
        }
        with testtools.ExpectedException(ex.InvalidDataException):
            ds.check_data_source_create(data)
Пример #20
0
    def test_maprfs_creation_wrong_schema(self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "maprf://test_cluster/",
            "type": "maprfs",
            "description": "incorrect url schema"
        }
        with testtools.ExpectedException(ex.InvalidDataException):
            ds.check_data_source_create(data)
Пример #21
0
    def test_swift_creation_missing_object(self,
                                           check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "swift://1234%s/" % su.SWIFT_URL_SUFFIX,
            "type": "swift",
            "description": "incorrect url schema"
        }
        with self.assertRaises(ex.InvalidException):
            ds.check_data_source_create(data)
Пример #22
0
    def test_swift_creation_missing_object(self,
                                           check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "swift://1234/",
            "type": "swift",
            "description": "incorrect url schema"
        }
        with self.assertRaises(ex.InvalidException):
            ds.check_data_source_create(data)
Пример #23
0
    def test_swift_creation_missing_credentials(self,
                                                check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": SAMPLE_SWIFT_URL,
            "type": "swift",
            "description": "long description"
        }
        with self.assertRaises(ex.InvalidCredentials):
            ds.check_data_source_create(data)
Пример #24
0
    def test_swift_creation_missing_credentials(self,
                                                check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "swift://1234",
            "type": "swift",
            "description": "long description"
        }
        with self.assertRaises(ex.InvalidCredentials):
            ds.check_data_source_create(data)
Пример #25
0
    def test_swift_creation_missing_credentials(self,
                                                check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": SAMPLE_SWIFT_URL,
            "type": "swift",
            "description": "long description"
        }
        with testtools.ExpectedException(ex.InvalidCredentials):
            ds.check_data_source_create(data)
        # proxy enabled should allow creation without credentials
        self.override_config('use_domain_for_proxy_users', True)
        ds.check_data_source_create(data)
Пример #26
0
    def test_swift_creation_missing_credentials(self,
                                                check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": SAMPLE_SWIFT_URL,
            "type": "swift",
            "description": "long description"
        }
        with testtools.ExpectedException(ex.InvalidCredentials):
            ds.check_data_source_create(data)
        # proxy enabled should allow creation without credentials
        self.override_config('use_domain_for_proxy_users', True)
        ds.check_data_source_create(data)
Пример #27
0
    def test_swift_creation_credentials_missing_password(
            self, check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": "swift://1234",
            "type": "swift",
            "credentials": {
                "user": "******",
            },
            "description": "long description"
        }
        with self.assertRaises(ex.InvalidCredentials):
            ds.check_data_source_create(data)
Пример #28
0
    def test_swift_creation_credentials_missing_password(
            self,
            check_data_source_unique_name):
        check_data_source_unique_name.return_value = True

        data = {
            "name": "test_data_data_source",
            "url": SAMPLE_SWIFT_URL,
            "type": "swift",
            "credentials": {
                "user": "******",
            },
            "description": "long description"
        }
        with self.assertRaises(ex.InvalidCredentials):
            ds.check_data_source_create(data)