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

Test SOSAPI PUTs with a bucket having a dot in its name #2153

Merged
merged 2 commits into from
Oct 25, 2024
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
33 changes: 22 additions & 11 deletions tests/ctst/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,31 @@ Given('an account', async function (this: Zenko) {
await this.createAccount();
});

Given('a {string} bucket', async function (this: Zenko, versioning: string) {
this.resetCommand();
const preName = this.getSaved<string>('accountName') ||
this.parameters.AccountName || Constants.ACCOUNT_NAME;
const bucketName = `${preName}${Constants.BUCKET_NAME_TEST}${Utils.randomString()}`.toLocaleLowerCase();
this.addToSaved('bucketName', bucketName);
this.addCommandParameter({ bucket: bucketName });
await S3.createBucket(this.getCommandParameters());
this.addToSaved('bucketVersioning', versioning);
async function createBucket(world: Zenko, versioning: string, bucketName: string) {
world.resetCommand();
world.addToSaved('bucketName', bucketName);
world.addCommandParameter({ bucket: bucketName });
await S3.createBucket(world.getCommandParameters());
world.addToSaved('bucketVersioning', versioning);
if (versioning !== 'Non versioned') {
const versioningConfiguration = versioning === 'Versioned' ? 'Enabled' : 'Suspended';
this.addCommandParameter({ versioningConfiguration: `Status=${versioningConfiguration}` });
await S3.putBucketVersioning(this.getCommandParameters());
world.addCommandParameter({ versioningConfiguration: `Status=${versioningConfiguration}` });
await S3.putBucketVersioning(world.getCommandParameters());
}
}

Given('a {string} bucket with dot', async function (this: Zenko, versioning: string) {
const preName = this.getSaved<string>('accountName') ||
this.parameters.AccountName || Constants.ACCOUNT_NAME;
await createBucket(this, versioning,
`${preName}.${Constants.BUCKET_NAME_TEST}${Utils.randomString()}`.toLocaleLowerCase());
});

Given('a {string} bucket', async function (this: Zenko, versioning: string) {
const preName = this.getSaved<string>('accountName') ||
this.parameters.AccountName || Constants.ACCOUNT_NAME;
await createBucket(this, versioning,
`${preName}${Constants.BUCKET_NAME_TEST}${Utils.randomString()}`.toLocaleLowerCase());
});

Given('an existing bucket {string} {string} versioning, {string} ObjectLock {string} retention mode', async function
Expand Down
15 changes: 15 additions & 0 deletions tests/ctst/features/sosapi.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,18 @@ Feature: Veeam SOSAPI
| Non versioned | invalid | capacity.xml | not accepted |
| Non versioned | valid | system.xml | accepted |
| Non versioned | invalid | system.xml | not accepted |

@2.6.0
@PreMerge
@SOSAPI
Scenario Outline: PUT routes for SOSAPI configuration files
Given a "<versioningConfiguration>" bucket with dot
When I PUT the "<isValid>" "<sosapiFile>" XML file
Then the request should be "<requestAccepted>"

Examples:
| versioningConfiguration | isValid | sosapiFile | requestAccepted |
| Non versioned | valid | capacity.xml | accepted |
| Non versioned | invalid | capacity.xml | not accepted |
| Non versioned | valid | system.xml | accepted |
| Non versioned | invalid | system.xml | not accepted |
Loading