Compare commits

...

9 Commits

Author SHA1 Message Date
naren-scality bf04ff141b Merge branch 'w/8.1/3284-test' of github.com:scality/cloudserver into w/8.1/3284-test 2021-03-16 11:41:01 -07:00
naren-scality 3f392677b1 more corrections to package.json and lock file 2021-03-16 11:39:18 -07:00
naren-scality 4243d76d0d corrected package.json and lock file 2021-03-16 11:17:51 -07:00
naren-scality 8a62c44ff0 enable all functional tests 2021-03-16 07:22:07 -07:00
naren-scality 9727f22b78 test 2021-03-16 07:12:18 -07:00
naren-scality aac07c78f4 enable only md search tests 2021-03-15 23:06:10 -07:00
naren-scality 6a1b471888 copy config text 2021-03-10 11:58:34 -08:00
naren-scality 5b9d1e1866 copy config 2021-03-10 11:33:54 -08:00
naren-scality 8f43116b33 disable all tests but mongo 2021-03-10 10:16:06 -08:00
5 changed files with 587 additions and 991 deletions

View File

@ -167,12 +167,7 @@ stages:
stage_names:
- docker-build
- linting-coverage
- file-ft-tests
- multiple-backend-test
- mongo-ft-tests
- ceph-backend-tests
- kmip-ft-tests
- utapi-v2-tests
waitForFinish: true
haltOnFailure: true

View File

@ -32,7 +32,7 @@ function findConfigFile(fileName) {
});
if (!containingPath) {
throw new Error(`Unable to find the configuration file "${fileName}" ` +
`under the paths: ${JSON.stringify(configSearchPaths)}`);
`under the paths: ${JSON.stringify(configSearchPaths)}`);
}
return path.join(containingPath, fileName);
}
@ -180,7 +180,7 @@ function hdClientLocationConstraintAssert(configHd) {
.every(e => typeof e === 'string'),
'bad config: hdclient.bootstrap must be an array of strings');
assert(configHd.bootstrap.length > 0,
'bad config: hdclient bootstrap list is empty');
'bad config: hdclient bootstrap list is empty');
hdclientFields.push('bootstrap');
}
return hdclientFields;
@ -188,8 +188,8 @@ function hdClientLocationConstraintAssert(configHd) {
function locationConstraintAssert(locationConstraints) {
const supportedBackends =
['mem', 'file', 'scality',
'mongodb'].concat(Object.keys(validExternalBackends));
['mem', 'file', 'scality',
'mongodb'].concat(Object.keys(validExternalBackends));
assert(typeof locationConstraints === 'object',
'bad config: locationConstraints must be an object');
Object.keys(locationConstraints).forEach(l => {
@ -202,23 +202,23 @@ function locationConstraintAssert(locationConstraints) {
'bad config: locationConstraints[region].type must ' +
`be one of ${supportedBackends}`);
assert(typeof locationConstraints[l].objectId === 'string',
'bad config: locationConstraints[region].objectId is ' +
'mandatory and must be a unique string across locations');
'bad config: locationConstraints[region].objectId is ' +
'mandatory and must be a unique string across locations');
assert(Object.keys(locationConstraints)
.filter(loc => (locationConstraints[loc].objectId ===
locationConstraints[l].objectId))
.length === 1,
'bad config: location constraint objectId ' +
`"${locationConstraints[l].objectId}" is not unique across ` +
'configured locations');
.filter(loc => (locationConstraints[loc].objectId ===
locationConstraints[l].objectId))
.length === 1,
'bad config: location constraint objectId ' +
`"${locationConstraints[l].objectId}" is not unique across ` +
'configured locations');
assert(typeof locationConstraints[l].legacyAwsBehavior
=== 'boolean',
'bad config: locationConstraints[region]' +
'.legacyAwsBehavior is mandatory and must be a boolean');
assert(['undefined', 'boolean'].includes(
typeof locationConstraints[l].isTransient),
'bad config: locationConstraints[region]' +
'.isTransient must be a boolean');
'bad config: locationConstraints[region]' +
'.isTransient must be a boolean');
if (locationConstraints[l].sizeLimitGB !== undefined) {
assert(typeof locationConstraints[l].sizeLimitGB === 'number' ||
locationConstraints[l].sizeLimitGB === null,
@ -232,8 +232,8 @@ function locationConstraintAssert(locationConstraints) {
'mandatory and must be an object');
if (details.serverSideEncryption !== undefined) {
assert(typeof details.serverSideEncryption === 'boolean',
'bad config: locationConstraints[region]' +
'.details.serverSideEncryption must be a boolean');
'bad config: locationConstraints[region]' +
'.details.serverSideEncryption must be a boolean');
}
const stringFields = [
'awsEndpoint',
@ -299,7 +299,7 @@ function locationConstraintAssert(locationConstraints) {
}
if (locationConstraints[l].type === 'pfs') {
assert(typeof details.pfsDaemonEndpoint === 'object',
'bad config: pfsDaemonEndpoint is mandatory and must be an object');
'bad config: pfsDaemonEndpoint is mandatory and must be an object');
}
if (locationConstraints[l].type === 'scality' &&
locationConstraints[l].details.connector !== undefined &&
@ -310,7 +310,7 @@ function locationConstraintAssert(locationConstraints) {
});
assert(Object.keys(locationConstraints)
.includes('us-east-1'), 'bad locationConfig: must ' +
'include us-east-1 as a locationConstraint');
'include us-east-1 as a locationConstraint');
}
function parseUtapiReindex({ enabled, schedule, sentinel, bucketd }) {
@ -340,23 +340,23 @@ function parseUtapiReindex({ enabled, schedule, sentinel, bucketd }) {
function requestsConfigAssert(requestsConfig) {
if (requestsConfig.viaProxy !== undefined) {
assert(typeof requestsConfig.viaProxy === 'boolean',
'config: invalid requests configuration. viaProxy must be a ' +
'boolean');
'config: invalid requests configuration. viaProxy must be a ' +
'boolean');
if (requestsConfig.viaProxy) {
assert(Array.isArray(requestsConfig.trustedProxyCIDRs) &&
requestsConfig.trustedProxyCIDRs.length > 0 &&
requestsConfig.trustedProxyCIDRs
.every(ip => typeof ip === 'string'),
'config: invalid requests configuration. ' +
'trustedProxyCIDRs must be set if viaProxy is set to true ' +
'and must be an array');
requestsConfig.trustedProxyCIDRs.length > 0 &&
requestsConfig.trustedProxyCIDRs
.every(ip => typeof ip === 'string'),
'config: invalid requests configuration. ' +
'trustedProxyCIDRs must be set if viaProxy is set to true ' +
'and must be an array');
assert(typeof requestsConfig.extractClientIPFromHeader === 'string'
&& requestsConfig.extractClientIPFromHeader.length > 0,
'config: invalid requests configuration. ' +
'extractClientIPFromHeader must be set if viaProxy is ' +
'set to true and must be a string');
&& requestsConfig.extractClientIPFromHeader.length > 0,
'config: invalid requests configuration. ' +
'extractClientIPFromHeader must be set if viaProxy is ' +
'set to true and must be a string');
}
}
}
@ -405,7 +405,7 @@ class Config extends EventEmitter {
*/
this._basePath = path.join(__dirname, '..');
this.configPath = findConfigFile(process.env.S3_CONFIG_FILE ||
'config.json');
'config.json');
let locationConfigFileName = 'locationConfig.json';
if (process.env.CI === 'true' && !process.env.S3_END_TO_END) {
@ -413,7 +413,7 @@ class Config extends EventEmitter {
'tests/locationConfig/locationConfigTests.json';
}
this.locationConfigPath = findConfigFile(process.env.S3_LOCATION_FILE ||
locationConfigFileName);
locationConfigFileName);
if (process.env.S3_REPLICATION_FILE !== undefined) {
this.replicationConfigPath = process.env.S3_REPLICATION_FILE;
@ -429,7 +429,10 @@ class Config extends EventEmitter {
let locationConfig;
try {
const data = fs.readFileSync(this.locationConfigPath,
{ encoding: 'utf-8' });
{ encoding: 'utf-8' });
console.log('[LOCATION]');
console.log(data);
console.log('[LOCATION]');
locationConfig = JSON.parse(data);
} catch (err) {
throw new Error(`could not parse location config file:
@ -443,7 +446,7 @@ class Config extends EventEmitter {
const details = this.locationConstraints[l].details;
if (locationConfig[l].details.connector !== undefined) {
assert(typeof locationConfig[l].details.connector ===
'object', 'bad config: connector must be an object');
'object', 'bad config: connector must be an object');
if (locationConfig[l].details.connector.sproxyd !==
undefined) {
details.connector.sproxyd = parseSproxydConfig(
@ -462,14 +465,14 @@ class Config extends EventEmitter {
'bad config: TLS file specification must be a string');
}
const tlsFilePath = (tlsFileName[0] === '/')
? tlsFileName
: path.join(this._basepath, tlsFileName);
? tlsFileName
: path.join(this._basepath, tlsFileName);
let tlsFileContent;
try {
tlsFileContent = fs.readFileSync(tlsFilePath);
} catch (err) {
throw new Error(`Could not load tls file '${tlsFileName}':` +
` ${err.message}`);
` ${err.message}`);
}
return tlsFileContent;
}
@ -478,7 +481,10 @@ class Config extends EventEmitter {
let config;
try {
const data = fs.readFileSync(this.configPath,
{ encoding: 'utf-8' });
{ encoding: 'utf-8' });
console.log('[CONFIG]');
console.log(data);
console.log('[CONFIG]');
config = JSON.parse(data);
} catch (err) {
throw new Error(`could not parse config file: ${err.message}`);
@ -486,7 +492,7 @@ class Config extends EventEmitter {
if (this.replicationConfigPath) {
try {
const repData = fs.readFileSync(this.replicationConfigPath,
{ encoding: 'utf-8' });
{ encoding: 'utf-8' });
const replicationEndpoints = JSON.parse(repData);
config.replicationEndpoints.push(...replicationEndpoints);
} catch (err) {
@ -613,7 +619,7 @@ class Config extends EventEmitter {
this.clusters = false;
if (config.clusters !== undefined) {
assert(Number.isInteger(config.clusters) && config.clusters > 0,
'bad config: clusters must be a positive integer');
'bad config: clusters must be a positive integer');
this.clusters = config.clusters;
}
@ -631,27 +637,27 @@ class Config extends EventEmitter {
if (config.cdmi !== undefined) {
if (config.cdmi.host !== undefined) {
assert.strictEqual(typeof config.cdmi.host, 'string',
'bad config: cdmi host must be a string');
'bad config: cdmi host must be a string');
this.cdmi.host = config.cdmi.host;
}
if (config.cdmi.port !== undefined) {
assert(Number.isInteger(config.cdmi.port)
&& config.cdmi.port > 0,
'bad config: cdmi port must be a positive integer');
&& config.cdmi.port > 0,
'bad config: cdmi port must be a positive integer');
this.cdmi.port = config.cdmi.port;
}
if (config.cdmi.path !== undefined) {
assert(typeof config.cdmi.path === 'string',
'bad config: cdmi.path must be a string');
'bad config: cdmi.path must be a string');
assert(config.cdmi.path.length > 0,
'bad config: cdmi.path is empty');
'bad config: cdmi.path is empty');
assert(config.cdmi.path.charAt(0) === '/',
'bad config: cdmi.path should start with a "/"');
'bad config: cdmi.path should start with a "/"');
this.cdmi.path = config.cdmi.path;
}
if (config.cdmi.readonly !== undefined) {
assert(typeof config.cdmi.readonly === 'boolean',
'bad config: cdmi.readonly must be a boolean');
'bad config: cdmi.readonly must be a boolean');
this.cdmi.readonly = config.cdmi.readonly;
} else {
this.cdmi.readonly = true;
@ -660,11 +666,11 @@ class Config extends EventEmitter {
this.bucketd = { bootstrap: [] };
if (config.bucketd !== undefined
&& config.bucketd.bootstrap !== undefined) {
&& config.bucketd.bootstrap !== undefined) {
assert(config.bucketd.bootstrap instanceof Array
&& config.bucketd.bootstrap.every(
e => typeof e === 'string'),
'bad config: bucketd.bootstrap must be a list of strings');
&& config.bucketd.bootstrap.every(
e => typeof e === 'string'),
'bad config: bucketd.bootstrap must be a list of strings');
this.bucketd.bootstrap = config.bucketd.bootstrap;
}
@ -672,13 +678,13 @@ class Config extends EventEmitter {
if (config.vaultd) {
if (config.vaultd.port !== undefined) {
assert(Number.isInteger(config.vaultd.port)
&& config.vaultd.port > 0,
'bad config: vaultd port must be a positive integer');
&& config.vaultd.port > 0,
'bad config: vaultd port must be a positive integer');
this.vaultd.port = config.vaultd.port;
}
if (config.vaultd.host !== undefined) {
assert.strictEqual(typeof config.vaultd.host, 'string',
'bad config: vaultd host must be a string');
'bad config: vaultd host must be a string');
this.vaultd.host = config.vaultd.host;
}
if (process.env.VAULTD_HOST !== undefined) {
@ -691,14 +697,14 @@ class Config extends EventEmitter {
if (config.dataClient) {
this.dataClient = {};
assert.strictEqual(typeof config.dataClient.host, 'string',
'bad config: data client host must be ' +
'a string');
'bad config: data client host must be ' +
'a string');
this.dataClient.host = config.dataClient.host;
assert(Number.isInteger(config.dataClient.port)
&& config.dataClient.port > 0,
'bad config: dataClient port must be a positive ' +
'integer');
&& config.dataClient.port > 0,
'bad config: dataClient port must be a positive ' +
'integer');
this.dataClient.port = config.dataClient.port;
}
@ -710,9 +716,9 @@ class Config extends EventEmitter {
this.metadataClient.host = config.metadataClient.host;
assert(Number.isInteger(config.metadataClient.port)
&& config.metadataClient.port > 0,
'bad config: metadata client port must be a ' +
'positive integer');
&& config.metadataClient.port > 0,
'bad config: metadata client port must be a ' +
'positive integer');
this.metadataClient.port = config.metadataClient.port;
}
@ -738,9 +744,9 @@ class Config extends EventEmitter {
this.dataDaemon.bindAddress = config.dataDaemon.bindAddress;
assert(Number.isInteger(config.dataDaemon.port)
&& config.dataDaemon.port > 0,
'bad config: data daemon port must be a positive ' +
'integer');
&& config.dataDaemon.port > 0,
'bad config: data daemon port must be a positive ' +
'integer');
this.dataDaemon.port = config.dataDaemon.port;
/**
@ -750,7 +756,7 @@ class Config extends EventEmitter {
*/
this.dataDaemon.dataPath =
process.env.S3DATAPATH ?
process.env.S3DATAPATH : `${__dirname}/../localData`;
process.env.S3DATAPATH : `${__dirname}/../localData`;
this.dataDaemon.noSync = process.env.S3DATA_NOSYNC === 'true';
this.dataDaemon.noCache = process.env.S3DATA_NOCACHE === 'true';
}
@ -762,13 +768,13 @@ class Config extends EventEmitter {
'bad config: data daemon bind address must be a string');
this.pfsDaemon.bindAddress = config.pfsDaemon.bindAddress;
assert(Number.isInteger(config.pfsDaemon.port)
&& config.pfsDaemon.port > 0,
'bad config: data daemon port must be a positive ' +
'integer');
&& config.pfsDaemon.port > 0,
'bad config: data daemon port must be a positive ' +
'integer');
this.pfsDaemon.port = config.pfsDaemon.port;
this.pfsDaemon.dataPath =
process.env.PFSD_MOUNT_PATH ?
process.env.PFSD_MOUNT_PATH : `${__dirname}/../localPfs`;
process.env.PFSD_MOUNT_PATH : `${__dirname}/../localPfs`;
this.pfsDaemon.noSync = process.env.PFSD_NOSYNC === 'true';
this.pfsDaemon.noCache = process.env.PFSD_NOCACHE === 'true';
this.pfsDaemon.isReadOnly =
@ -784,9 +790,9 @@ class Config extends EventEmitter {
config.metadataDaemon.bindAddress;
assert(Number.isInteger(config.metadataDaemon.port)
&& config.metadataDaemon.port > 0,
'bad config: metadata daemon port must be a ' +
'positive integer');
&& config.metadataDaemon.port > 0,
'bad config: metadata daemon port must be a ' +
'positive integer');
this.metadataDaemon.port = config.metadataDaemon.port;
/**
@ -796,7 +802,7 @@ class Config extends EventEmitter {
*/
this.metadataDaemon.metadataPath =
process.env.S3METADATAPATH ?
process.env.S3METADATAPATH : `${__dirname}/../localMetadata`;
process.env.S3METADATAPATH : `${__dirname}/../localMetadata`;
this.metadataDaemon.restEnabled =
config.metadataDaemon.restEnabled;
@ -831,8 +837,10 @@ class Config extends EventEmitter {
if (typeof config.localCache.sentinels === 'string') {
config.localCache.sentinels.split(',').forEach(item => {
const [host, port] = item.split(':');
this.localCache.sentinels.push({ host,
port: Number.parseInt(port, 10) });
this.localCache.sentinels.push({
host,
port: Number.parseInt(port, 10)
});
});
} else if (Array.isArray(config.localCache.sentinels)) {
config.localCache.sentinels.forEach(item => {
@ -848,14 +856,14 @@ class Config extends EventEmitter {
}
} else {
assert(typeof config.localCache.host === 'string',
'config: bad host for localCache. host must be a string');
'config: bad host for localCache. host must be a string');
assert(typeof config.localCache.port === 'number',
'config: bad port for localCache. port must be a number');
'config: bad port for localCache. port must be a number');
if (config.localCache.password !== undefined) {
assert(
this._verifyRedisPassword(config.localCache.password),
'config: vad password for localCache. password must' +
' be a string');
' be a string');
}
this.localCache = {
host: config.localCache.host,
@ -870,8 +878,8 @@ class Config extends EventEmitter {
if (process.env.MONGODB_AUTH_USERNAME &&
process.env.MONGODB_AUTH_PASSWORD) {
this.mongodb.authCredentials = {
username: process.env.MONGODB_AUTH_USERNAME,
password: process.env.MONGODB_AUTH_PASSWORD,
username: process.env.MONGODB_AUTH_USERNAME,
password: process.env.MONGODB_AUTH_PASSWORD,
};
}
} else {
@ -892,8 +900,10 @@ class Config extends EventEmitter {
if (typeof config.redis.sentinels === 'string') {
config.redis.sentinels.split(',').forEach(item => {
const [host, port] = item.split(':');
this.redis.sentinels.push({ host,
port: Number.parseInt(port, 10) });
this.redis.sentinels.push({
host,
port: Number.parseInt(port, 10)
});
});
} else if (Array.isArray(config.redis.sentinels)) {
config.redis.sentinels.forEach(item => {
@ -908,7 +918,7 @@ class Config extends EventEmitter {
if (config.redis.sentinelPassword !== undefined) {
assert(
this._verifyRedisPassword(config.redis.sentinelPassword));
this._verifyRedisPassword(config.redis.sentinelPassword));
this.redis.sentinelPassword = config.redis.sentinelPassword;
}
} else {
@ -991,10 +1001,10 @@ class Config extends EventEmitter {
' must be a string');
this.utapi.redis.password = config.utapi.redis.password;
}
if (config.utapi.redis.sentinelPassword !== undefined) {
assert(
this._verifyRedisPassword(
config.utapi.redis.sentinelPassword),
if (config.utapi.redis.sentinelPassword !== undefined) {
assert(
this._verifyRedisPassword(
config.utapi.redis.sentinelPassword),
'config: invalid password for utapi redis. password' +
' must be a string');
this.utapi.redis.sentinelPassword =
@ -1075,7 +1085,7 @@ class Config extends EventEmitter {
}
}
if (Object.keys(this.locationConstraints).some(
loc => this.locationConstraints[loc].sizeLimitGB)) {
loc => this.locationConstraints[loc].sizeLimitGB)) {
assert(this.utapi && this.utapi.metrics &&
this.utapi.metrics.includes('location'),
'bad config: if storage size limit set on a location ' +
@ -1086,12 +1096,12 @@ class Config extends EventEmitter {
if (config.log !== undefined) {
if (config.log.logLevel !== undefined) {
assert(typeof config.log.logLevel === 'string',
'bad config: log.logLevel must be a string');
'bad config: log.logLevel must be a string');
this.log.logLevel = config.log.logLevel;
}
if (config.log.dumpLevel !== undefined) {
assert(typeof config.log.dumpLevel === 'string',
'bad config: log.dumpLevel must be a string');
'bad config: log.dumpLevel must be a string');
this.log.dumpLevel = config.log.dumpLevel;
}
}
@ -1126,13 +1136,13 @@ class Config extends EventEmitter {
* which also targets the present instant.
*/
compoundCreateActivate:
(process.env.S3KMIP_COMPOUND_CREATE === 'true') || false,
(process.env.S3KMIP_COMPOUND_CREATE === 'true') || false,
/* Set the bucket name attribute name here if the KMIP
* server supports storing custom attributes along
* with the keys.
*/
bucketNameAttributeName:
process.env.S3KMIP_BUCKET_ATTRIBUTE_NAME || '',
process.env.S3KMIP_BUCKET_ATTRIBUTE_NAME || '',
},
transport: {
/* Specify the request pipeline depth here.
@ -1158,10 +1168,10 @@ class Config extends EventEmitter {
host: process.env.S3KMIP_HOSTS,
key: this._loadTlsFile(process.env.S3KMIP_KEY || undefined),
cert: this._loadTlsFile(process.env.S3KMIP_CERT ||
undefined),
undefined),
ca: (process.env.S3KMIP_CA
? process.env.S3KMIP_CA.split(',')
: []).map(this._loadTlsFile),
? process.env.S3KMIP_CA.split(',')
: []).map(this._loadTlsFile),
},
},
};
@ -1169,13 +1179,13 @@ class Config extends EventEmitter {
if (config.kmip.client) {
if (config.kmip.client.compoundCreateActivate) {
assert(typeof config.kmip.client.compoundCreateActivate ===
'boolean');
'boolean');
this.kmip.client.compoundCreateActivate =
config.kmip.client.compoundCreateActivate;
}
if (config.kmip.client.bucketNameAttributeName) {
assert(typeof config.kmip.client.bucketNameAttributeName ===
'string');
'string');
this.kmip.client.bucketNameAttributeName =
config.kmip.client.bucketNameAttributeName;
}
@ -1183,25 +1193,25 @@ class Config extends EventEmitter {
if (config.kmip.transport) {
if (config.kmip.transport.pipelineDepth) {
assert(typeof config.kmip.transport.pipelineDepth ===
'number');
'number');
this.kmip.transport.pipelineDepth =
config.kmip.transport.pipelineDepth;
}
if (config.kmip.transport.tls) {
const { host, port, key, cert, ca } =
config.kmip.transport.tls;
config.kmip.transport.tls;
if (!!key !== !!cert) {
throw new Error('bad config: KMIP TLS certificate ' +
'and key must come along');
'and key must come along');
}
if (port) {
assert(typeof port === 'number',
'bad config: KMIP TLS Port must be a number');
'bad config: KMIP TLS Port must be a number');
this.kmip.transport.tls.port = port;
}
if (host) {
assert(typeof host === 'string',
'bad config: KMIP TLS Host must be a string');
'bad config: KMIP TLS Host must be a string');
this.kmip.transport.tls.host = host;
}
@ -1227,8 +1237,8 @@ class Config extends EventEmitter {
'be an array');
config.healthChecks.allowFrom.forEach(item => {
assert(typeof item === 'string',
'config: invalid healthcheck configuration. allowFrom IP ' +
'address must be a string');
'config: invalid healthcheck configuration. allowFrom IP ' +
'address must be a string');
});
this.healthChecks.allowFrom = defaultHealthChecks.allowFrom
.concat(config.healthChecks.allowFrom);
@ -1241,7 +1251,7 @@ class Config extends EventEmitter {
config.certFilePaths.ca &&
typeof config.certFilePaths.ca === 'string') ||
!config.certFilePaths.ca)
);
);
}
const { key, cert, ca } = config.certFilePaths ?
@ -1286,7 +1296,7 @@ class Config extends EventEmitter {
const authArray = auth.split(':');
assert(authArray.length === 2 && authArray[0].length > 0
&& authArray[1].length > 0, 'bad proxy config: ' +
'auth must be of format username:password');
'auth must be of format username:password');
}
this.outboundProxy.url = proxyUrl;
this.outboundProxy.certs = {};
@ -1321,15 +1331,15 @@ class Config extends EventEmitter {
if (config.managementAgent !== undefined) {
if (config.managementAgent.port !== undefined) {
assert(Number.isInteger(config.managementAgent.port)
&& config.managementAgent.port > 0,
'bad config: managementAgent port must be a positive ' +
'integer');
&& config.managementAgent.port > 0,
'bad config: managementAgent port must be a positive ' +
'integer');
this.managementAgent.port = config.managementAgent.port;
}
if (config.managementAgent.host !== undefined) {
assert.strictEqual(typeof config.managementAgent.host, 'string',
'bad config: management agent host must ' +
'be a string');
'bad config: management agent host must ' +
'be a string');
this.managementAgent.host = config.managementAgent.host;
}
}
@ -1417,13 +1427,13 @@ class Config extends EventEmitter {
// Auth only checks for 'mem' since mem === file
auth = 'mem';
const authfile = findConfigFile(process.env.S3AUTH_CONFIG ||
'authdata.json');
'authdata.json');
let authData;
if (process.env.SCALITY_ACCESS_KEY_ID &&
process.env.SCALITY_SECRET_ACCESS_KEY) {
process.env.SCALITY_SECRET_ACCESS_KEY) {
authData = buildAuthDataAccount(
process.env.SCALITY_ACCESS_KEY_ID,
process.env.SCALITY_SECRET_ACCESS_KEY);
process.env.SCALITY_ACCESS_KEY_ID,
process.env.SCALITY_SECRET_ACCESS_KEY);
} else {
authData = require(authfile);
}
@ -1506,15 +1516,15 @@ class Config extends EventEmitter {
setReplicationEndpoints(locationConstraints) {
this.replicationEndpoints =
Object.keys(locationConstraints)
.map(key => ({ site: key, type: locationConstraints[key].type }));
Object.keys(locationConstraints)
.map(key => ({ site: key, type: locationConstraints[key].type }));
}
getAzureEndpoint(locationConstraint) {
let azureStorageEndpoint =
process.env[`${locationConstraint}_AZURE_STORAGE_ENDPOINT`] ||
this.locationConstraints[locationConstraint]
.details.azureStorageEndpoint;
process.env[`${locationConstraint}_AZURE_STORAGE_ENDPOINT`] ||
this.locationConstraints[locationConstraint]
.details.azureStorageEndpoint;
if (!azureStorageEndpoint.endsWith('/')) {
// append the trailing slash
azureStorageEndpoint = `${azureStorageEndpoint}/`;
@ -1544,7 +1554,7 @@ class Config extends EventEmitter {
getPfsDaemonEndpoint(locationConstraint) {
return process.env[`${locationConstraint}_PFSD_ENDPOINT`] ||
this.locationConstraints[locationConstraint].details.pfsDaemonEndpoint;
this.locationConstraints[locationConstraint].details.pfsDaemonEndpoint;
}
isSameAzureAccount(locationConstraintSrc, locationConstraintDest) {
@ -1560,7 +1570,7 @@ class Config extends EventEmitter {
isAWSServerSideEncrytion(locationConstraint) {
return this.locationConstraints[locationConstraint].details
.serverSideEncryption === true;
.serverSideEncryption === true;
}
getPublicInstanceId() {
@ -1569,8 +1579,8 @@ class Config extends EventEmitter {
setPublicInstanceId(instanceId) {
this.publicInstanceId = crypto.createHash('sha256')
.update(instanceId)
.digest('hex');
.update(instanceId)
.digest('hex');
}
}

View File

@ -30,11 +30,10 @@
"commander": "^2.9.0",
"cron-parser": "^2.11.0",
"diskusage": "1.1.3",
"express": "^4.17.1",
"google-auto-auth": "^0.9.1",
"http-proxy": "^1.17.0",
"level-mem": "^5.0.1",
"https-proxy-agent": "^2.2.0",
"level-mem": "^5.0.1",
"moment": "^2.26.0",
"mongodb": "^2.2.31",
"node-forge": "^0.7.1",
@ -42,7 +41,6 @@
"npm-run-all": "~4.1.5",
"prom-client": "^10.2.3",
"request": "^2.81.0",
"sinon": "^9.0.2",
"sql-where-parser": "~2.2.1",
"utapi": "scality/utapi#357f8fe",
"utf-8-validate": "^4.0.2",
@ -59,6 +57,7 @@
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-scality": "scality/Guidelines#28e73a2",
"eslint-plugin-import": "^2.14.0",
"express": "^4.17.1",
"ioredis": "4.9.5",
"istanbul": "1.0.0-alpha.2",
"istanbul-api": "1.0.0-alpha.13",
@ -67,6 +66,7 @@
"mocha-junit-reporter": "^1.23.1",
"mocha-multi-reporters": "^1.1.7",
"node-mocks-http": "1.5.2",
"sinon": "^9.2.4",
"tv4": "^1.2.7"
},
"scripts": {
@ -85,7 +85,7 @@
"ft_s3cmd": "cd tests/functional/s3cmd && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 *.js",
"ft_s3curl": "cd tests/functional/s3curl && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 *.js",
"ft_util": "cd tests/functional/utilities && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 *.js",
"ft_test": "npm-run-all -s ft_awssdk ft_s3cmd ft_s3curl ft_node ft_healthchecks ft_management ft_util",
"ft_test": "npm-run-all -s ft_awssdk",
"ft_search": "cd tests/functional/aws-node-sdk && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 90000 test/mdSearch",
"ft_kmip": "cd tests/functional/kmip && mocha --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json -t 40000 *.js",
"install_ft_deps": "yarn install aws-sdk@2.28.0 bluebird@3.3.1 mocha@2.3.4 mocha-junit-reporter@1.23.1 tv4@1.2.7",
@ -110,4 +110,4 @@
"unit_coverage": "CI=true mkdir -p coverage/unit/ && S3BACKEND=mem istanbul cover --dir coverage/unit _mocha -- --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json --recursive tests/unit",
"unit_coverage_legacy_location": "CI=true mkdir -p coverage/unitlegacylocation/ && S3_LOCATION_FILE=tests/locationConfig/locationConfigLegacy.json S3BACKEND=mem istanbul cover --dir coverage/unitlegacylocation _mocha -- --reporter mocha-multi-reporters --reporter-options configFile=$INIT_CWD/tests/reporter-config.json --reporter mocha-junit-reporter --recursive tests/unit"
}
}
}

View File

@ -6,7 +6,9 @@ const userMetadata = { food: 'pizza' };
const updatedMetadata = { food: 'salad' };
const masterKey = 'master';
runIfMongo('Search in version enabled bucket', () => {
console.log('process.env.CI_CEPH', process.env.CI_CEPH);
describe('Search in version enabled bucket', () => {
const bucketName = `versionedbucket${Date.now()}`;
const VersioningConfiguration = {
MFADelete: 'Disabled',

1299
yarn.lock

File diff suppressed because it is too large Load Diff