def setUp(self): oss2.defaults.connect_timeout = self.default_connect_timeout oss2.defaults.multipart_threshold = self.default_multipart_num_threads oss2.defaults.multipart_num_threads = random.randint(1, 5) oss2.defaults.multiget_threshold = self.default_multiget_threshold oss2.defaults.multiget_part_size = self.default_multiget_part_size oss2.defaults.multiget_num_threads = random.randint(1, 5) global OSS_AUTH_VERSION OSS_AUTH_VERSION = os.getenv('OSS_TEST_AUTH_VERSION') self.bucket = oss2.Bucket(oss2.make_auth(OSS_ID, OSS_SECRET, OSS_AUTH_VERSION), OSS_ENDPOINT, OSS_BUCKET) try: self.bucket.create_bucket() except: pass self.rsa_crypto_bucket = oss2.CryptoBucket(oss2.make_auth(OSS_ID, OSS_SECRET, OSS_AUTH_VERSION), OSS_ENDPOINT, OSS_BUCKET, crypto_provider=oss2.LocalRsaProvider()) self.kms_crypto_bucket = oss2.CryptoBucket(oss2.make_auth(OSS_ID, OSS_SECRET, OSS_AUTH_VERSION), OSS_ENDPOINT, OSS_BUCKET, crypto_provider=oss2.AliKMSProvider(OSS_ID, OSS_SECRET, OSS_REGION, OSS_CMK)) self.key_list = [] self.temp_files = []
def setUp(self): OssTestCase.setUp(self) source_bucket_name = OSS_BUCKET + '-test-replica-source-' + random_string( 10) self.source_bucket = oss2.Bucket( oss2.make_auth(OSS_ID, OSS_SECRET, OSS_AUTH_VERSION), OSS_ENDPOINT, source_bucket_name) self.source_bucket.create_bucket() self.replica_endpoint = "oss-ap-south-1" self.transfer_type = 'oss_acc' self.replica_bucket_name = OSS_BUCKET + "-test-replica-dest-" + random_string( 10) self.replica_bucket = oss2.Bucket( oss2.make_auth(OSS_ID, OSS_SECRET, OSS_AUTH_VERSION), self.replica_endpoint + '.aliyuncs.com', self.replica_bucket_name) self.replica_bucket.create_bucket() import time time.sleep(3) index = OSS_INVENTORY_BUCKET_DESTINATION_ARN.rfind('/') self.sync_role_name = OSS_INVENTORY_BUCKET_DESTINATION_ARN[ index + 1:] if index != -1 else OSS_INVENTORY_BUCKET_DESTINATION_ARN
def setUp(self): OssTestCase.setUp(self) self.endpoint = "http://oss-ap-southeast-2.aliyuncs.com" bucket_name = OSS_BUCKET + "-test-inventory" self.bucket1 = oss2.Bucket( oss2.make_auth(OSS_ID, OSS_SECRET, OSS_AUTH_VERSION), self.endpoint, bucket_name) self.bucket1.create_bucket()
def setUp(self): OssTestCase.setUp(self) self.endpoint = OSS_ENDPOINT bucket_name = OSS_BUCKET + "-test-inventory" self.bucket1 = oss2.Bucket( oss2.make_auth(OSS_ID, OSS_SECRET, OSS_AUTH_VERSION), self.endpoint, bucket_name) self.bucket1.create_bucket()
def setUp(self): oss2.defaults.connect_timeout = self.default_connect_timeout oss2.defaults.multipart_threshold = self.default_multipart_num_threads oss2.defaults.multipart_num_threads = random.randint(1, 5) oss2.defaults.multiget_threshold = self.default_multiget_threshold oss2.defaults.multiget_part_size = self.default_multiget_part_size oss2.defaults.multiget_num_threads = random.randint(1, 5) global OSS_AUTH_VERSION OSS_AUTH_VERSION = os.getenv('OSS_TEST_AUTH_VERSION') self.bucket = oss2.Bucket(oss2.make_auth(OSS_ID, OSS_SECRET, OSS_AUTH_VERSION), OSS_ENDPOINT, OSS_BUCKET) self.bucket.create_bucket() self.key_list = [] self.temp_files = []
def setUp(self): oss2.defaults.connect_timeout = self.default_connect_timeout oss2.defaults.multipart_threshold = self.default_multipart_num_threads oss2.defaults.multipart_num_threads = random.randint(1, 5) oss2.defaults.multiget_threshold = self.default_multiget_threshold oss2.defaults.multiget_part_size = self.default_multiget_part_size oss2.defaults.multiget_num_threads = random.randint(1, 5) global OSS_AUTH_VERSION OSS_AUTH_VERSION = os.getenv('OSS_TEST_AUTH_VERSION') self.bucket = oss2.Bucket( oss2.make_auth(OSS_ID, OSS_SECRET, OSS_AUTH_VERSION), OSS_ENDPOINT, OSS_BUCKET) self.bucket.create_bucket() self.key_list = [] self.temp_files = []