Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement/arsn 24 revert arsn 24 use azure storage 2.10.3 #1590

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/storage/data/external/AwsClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ class AwsClient {

objectPutTagging(key, bucket, objectMD, log, callback) {
const awsBucket = this._awsBucketName;
const awsKey = this._createAwsKey(bucket.getName(), key, this._bucketMatch);
const awsKey = this._createAwsKey(bucket, key, this._bucketMatch);
const dataStoreVersionId = objectMD.location[0].dataStoreVersionId;
const tagParams = {
Bucket: awsBucket,
Expand Down Expand Up @@ -514,7 +514,7 @@ class AwsClient {

objectDeleteTagging(key, bucket, objectMD, log, callback) {
const awsBucket = this._awsBucketName;
const awsKey = this._createAwsKey(bucket.getName(), key, this._bucketMatch);
const awsKey = this._createAwsKey(bucket, key, this._bucketMatch);
const dataStoreVersionId = objectMD.location[0].dataStoreVersionId;
const tagParams = {
Bucket: awsBucket,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"ajv": "6.12.2",
"async": "~2.6.1",
"aws-sdk": "2.80.0",
"azure-storage": "~2.1.0",
"azure-storage": "2.10.3",
"backo": "^1.1.0",
"base62": "2.0.1",
"base-x": "3.0.8",
Expand Down
34 changes: 0 additions & 34 deletions tests/unit/storage/data/DummyService.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ const { EventEmitter } = require('events');

const DummyObjectStream = require('./DummyObjectStream');
const { parseRange } = require('../../../../lib/network/http/utils');
const assert = require('assert');
const errors = require('../../../../lib/errors');

const OBJECT_SIZE = 1024 * 1024 * 1024;

Expand Down Expand Up @@ -135,38 +133,6 @@ class DummyService {
objStream.pipe(writeStream);
return callback();
}
putObjectTagging(tagParams, callback) {
if (tagParams.Key === 'externalBackendTestBucket/externalBackendMissingKey') {
const err = errors.NoSuchKey;
return callback(err);
}

const keys = Object.keys(tagParams);
assert(keys.length > 0);
assert(tagParams.Tagging.TagSet.length > 0);
tagParams.Tagging.TagSet.forEach(tag => {
assert(tag.Key.length > 0);
assert(tag.Value.length > 0);
});

if (tagParams.VersionId) {
assert.strictEqual(tagParams.VersionId, 'latestversion');
}

return callback();
}
deleteObjectTagging(tagParams, callback) {
if (tagParams.Key === 'externalBackendTestBucket/externalBackendMissingKey') {
const err = errors.NoSuchKey;
return callback(err);
}

if (tagParams.VersionId) {
assert.strictEqual(tagParams.VersionId, 'latestversion');
}

return callback();
}
// To-Do: add tests for other methods
}

Expand Down
64 changes: 0 additions & 64 deletions tests/unit/storage/data/external/ExternalClients.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const assert = require('assert');
const async = require('async');
const stream = require('stream');

const AwsClient = require('../../../../../lib/storage/data/external/AwsClient');
Expand All @@ -8,7 +7,6 @@ const AzureClient =
require('../../../../../lib/storage/data/external/AzureClient');
const DummyService = require('../DummyService');
const { DummyRequestLogger } = require('../../../helpers');
const BucketInfo = require('../../../../../lib/models/BucketInfo');

const backendClients = [
{
Expand Down Expand Up @@ -156,68 +154,6 @@ describe('external backend clients', () => {
});
});
});

if (backend.config.type !== 'azure') {
it(`${backend.name} should set tags and then delete it`, done => {
const key = 'externalBackendTestKey';
const bucketData = {
_name: 'externalBackendTestBucket',
_owner: 'abcdef0123456789',
_ownerDisplayName: 'UnitTestOwner',
_creationDate: '2021-10-05T08:59:12.546Z',
};
const bucket = BucketInfo.fromObj(bucketData);
const objectMd = {
tags: {
Key1: 'value_1',
Key2: 'value_2',
},
location: [
{
dataStoreVersionId: 'latestversion',
},
],
};
async.series([
next => testClient.objectPutTagging(key.key, bucket, objectMd, log, next),
next => testClient.objectDeleteTagging(key.Key, bucket, objectMd, log, next),
], done);
});

it(`${backend.name} should fail to set tag on missing key`, done => {
const key = 'externalBackendMissingKey';
const bucketData = {
_name: 'externalBackendTestBucket',
_owner: 'abcdef0123456789',
_ownerDisplayName: 'UnitTestOwner',
_creationDate: '2021-10-05T08:59:12.546Z',
};
const bucket = BucketInfo.fromObj(bucketData);
const objectMD = {
tags: {
Key1: 'value_1',
},
location: [
{
dataStoreVersionId: 'latestversion',
},
],
};
async.series(
[
next => testClient.objectPutTagging(key, bucket, objectMD, log, (err) => {
assert(err.ServiceUnavailable);
next();
}),
next => testClient.objectDeleteTagging(key, bucket, objectMD, log, (err) => {
assert(err.ServiceUnavailable);
next();
}),
],
done,
);
});
}
// To-Do: test the other external client methods (delete, createMPU ...)
});
});
Loading