Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/w/7.70/improvement/CLDSRV-409-fi…
Browse files Browse the repository at this point in the history
…x-python-version' into w/8.6/improvement/CLDSRV-409-fix-python-version
  • Loading branch information
williamlardier committed Jun 22, 2023
2 parents eb5affd + bbe019f commit b328f70
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
7 changes: 2 additions & 5 deletions .github/actions/setup-ci/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ runs:
- name: Install python deps
shell: bash
run: pip install docker-compose
- name: Setup python2 test environment
- name: Setup python test environment
shell: bash
run: |
sudo apt-get install -y libdigest-hmac-perl
pip install virtualenv==20.21.0
virtualenv -p $(which python2) ~/.virtualenv/py2
source ~/.virtualenv/py2/bin/activate
pip install 's3cmd==1.6.1'
pip install 's3cmd==2.3.0'
1 change: 0 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ jobs:
run: |-
set -o pipefail;
bash wait_for_local_port.bash 8000 40
source ~/.virtualenv/py2/bin/activate
yarn run ft_test | tee /tmp/artifacts/${{ matrix.job-name }}/tests.log
- name: Upload logs to artifacts
uses: scality/action-artifacts@v3
Expand Down
42 changes: 22 additions & 20 deletions tests/functional/s3cmd/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ function readJsonFromChild(child, lineFinder, cb) {
const findBrace = data.indexOf('{', findLine);
const findEnd = findEndJson(data, findBrace);
const endJson = data.substring(findBrace, findEnd + 1)
.replace(/"/g, '\\"').replace(/'/g, '"');
.replace(/"/g, '\\"').replace(/'/g, '"')
.replace(/b'/g, '\'')
.replace(/b"/g, '"');
return cb(JSON.parse(endJson));
});
}
Expand Down Expand Up @@ -258,7 +260,7 @@ describe('s3cmd putBucket', () => {
exec([
'mb', `s3://${bucket}`,
'--bucket-location=scality-us-west-1',
], done, 13);
], done, 11);
});

it('put an invalid bucket, should fail', done => {
Expand Down Expand Up @@ -340,18 +342,18 @@ describe('s3cmd getService', () => {

it("should have response headers matching AWS's response headers",
done => {
provideLineOfInterest(['ls', '--debug'], 'DEBUG: Response: {',
provideLineOfInterest(['ls', '--debug'], '\'headers\': {',
parsedObject => {
assert(parsedObject.headers['x-amz-id-2']);
assert(parsedObject.headers['transfer-encoding']);
assert(parsedObject.headers['x-amz-request-id']);
const gmtDate = new Date(parsedObject.headers.date)
assert(parsedObject['x-amz-id-2']);
assert(parsedObject['transfer-encoding']);
assert(parsedObject['x-amz-request-id']);
const gmtDate = new Date(parsedObject.date)
.toUTCString();
assert.strictEqual(parsedObject.headers.date, gmtDate);
assert.strictEqual(parsedObject.date, gmtDate);
assert.strictEqual(parsedObject
.headers['content-type'], 'application/xml');
['content-type'], 'application/xml');
assert.strictEqual(parsedObject
.headers['set-cookie'], undefined);
['set-cookie'], undefined);
done();
});
});
Expand Down Expand Up @@ -391,11 +393,11 @@ describe('s3cmd getObject', function toto() {
});

it('get non existing file in existing bucket, should fail', done => {
exec(['get', `s3://${bucket}/${nonexist}`, 'fail'], done, 12);
exec(['get', `s3://${bucket}/${nonexist}`, 'fail'], done, 64);
});

it('get file in non existing bucket, should fail', done => {
exec(['get', `s3://${nonexist}/${nonexist}`, 'fail2'], done, 12);
exec(['get', `s3://${nonexist}/${nonexist}`, 'fail2'], done, 64);
});
});

Expand Down Expand Up @@ -507,22 +509,22 @@ describe('s3cmd delObject', () => {

it('delete an already deleted object, should return a 204', done => {
provideLineOfInterest(['rm', `s3://${bucket}/${upload}`, '--debug'],
'DEBUG: Response: {', parsedObject => {
'DEBUG: Response:\n{', parsedObject => {
assert.strictEqual(parsedObject.status, 204);
done();
});
});

it('delete non-existing object, should return a 204', done => {
provideLineOfInterest(['rm', `s3://${bucket}/${nonexist}`, '--debug'],
'DEBUG: Response: {', parsedObject => {
'DEBUG: Response:\n{', parsedObject => {
assert.strictEqual(parsedObject.status, 204);
done();
});
});

it('try to get the deleted object, should fail', done => {
exec(['get', `s3://${bucket}/${upload}`, download], done, 12);
exec(['get', `s3://${bucket}/${upload}`, download], done, 64);
});
});

Expand Down Expand Up @@ -617,7 +619,7 @@ describe('s3cmd multipart upload', function titi() {
});

it('should not be able to get deleted object', done => {
exec(['get', `s3://${bucket}/${MPUpload}`, download], done, 12);
exec(['get', `s3://${bucket}/${MPUpload}`, download], done, 64);
});
});

Expand Down Expand Up @@ -656,7 +658,7 @@ MPUploadSplitter.forEach(file => {
});

it('should not be able to get deleted object', done => {
exec(['get', `s3://${bucket}/${file}`, download], done, 12);
exec(['get', `s3://${bucket}/${file}`, download], done, 64);
});
});
});
Expand Down Expand Up @@ -724,15 +726,15 @@ describe('s3cmd info', () => {

// test that POLICY and CORS are returned as 'none'
it('should find that policy has a value of none', done => {
checkRawOutput(['info', `s3://${bucket}`], 'policy', 'none',
checkRawOutput(['info', `s3://${bucket}`], 'Policy', 'none',
'stdout', foundIt => {
assert(foundIt);
done();
});
});

it('should find that cors has a value of none', done => {
checkRawOutput(['info', `s3://${bucket}`], 'cors', 'none',
checkRawOutput(['info', `s3://${bucket}`], 'CORS', 'none',
'stdout', foundIt => {
assert(foundIt);
done();
Expand All @@ -758,7 +760,7 @@ describe('s3cmd info', () => {
});

it('should find that cors has a value', done => {
checkRawOutput(['info', `s3://${bucket}`], 'cors', corsConfig,
checkRawOutput(['info', `s3://${bucket}`], 'CORS', corsConfig,
'stdout', foundIt => {
assert(foundIt, 'Did not find value for cors');
done();
Expand Down

0 comments on commit b328f70

Please sign in to comment.