Skip to content

Commit

Permalink
Merge branch 'w/2.8/improvement/ZENKO-4871-readonly-for-pra' into tmp…
Browse files Browse the repository at this point in the history
…/octopus/w/2.9/improvement/ZENKO-4871-readonly-for-pra
  • Loading branch information
bert-e committed Sep 6, 2024
2 parents 2c9f58c + 9ed58a2 commit bb8aca4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion tests/ctst/features/pra.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Feature: PRA operations
And object "obj-1" should "" be "transitioned" and have the storage class "e2e-cold" on "DR" site

# Test the readonly
When the "EnsureVaultSeeds" cronjobs completes without error on "Primary" site
When the "vault-check-seeds" cronjobs completes without error on "Primary" site
And the DATA_ACCESSOR user tries to perform PutObject on "DR" site
Then it "should not" pass Vault authentication

Expand Down
2 changes: 1 addition & 1 deletion tests/ctst/features/quotas/CountItems.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Feature: CountItems measures the utilization metrics
Scenario Outline: Countitems runs without error and compute utilization metrics
Given an existing bucket "" "without" versioning, "without" ObjectLock "without" retention mode
And an object "" that "exists"
When the "CountItems" cronjobs completes without error
When the "count-items" cronjobs completes without error
Then the operation finished without error
11 changes: 1 addition & 10 deletions tests/ctst/steps/cronjobs/countItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ async function runCronjob(this: Zenko, job: string, site?: string) {
zenkoName += '-pra';
}

switch (job) {
case 'CountItems':
await createJobAndWaitForCompletion(this, `${zenkoName}-ops-count-items`);
break;
case 'EnsureVaultSeeds':
await createJobAndWaitForCompletion(this, `${zenkoName}-ops-vault-check-seeds`);
break;
default:
throw new Error(`Unknown job: ${job}`);
}
await createJobAndWaitForCompletion(this, `${zenkoName}-ops-${job}`);
}

When('the {string} cronjobs completes without error', { timeout: 1200000 }, async function (this: Zenko, job: string) {
Expand Down
37 changes: 24 additions & 13 deletions tests/ctst/steps/pra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,22 +275,33 @@ Then('object {string} should {string} be {string} and have the storage class {st
}
});

When('the DATA_ACCESSOR user tries to perform PutObject on {string} site', async function (this: Zenko, site: string) {
if (site === 'DR') {
Identity.useIdentity(IdentityEnum.ACCOUNT, `${Zenko.sites['source'].accountName}-replicated`);
} else {
Identity.useIdentity(IdentityEnum.ACCOUNT, Zenko.sites['source'].accountName);
}
this.resetCommand();
this.addToSaved('accountName', Zenko.sites['source'].accountName);
When('the DATA_ACCESSOR user tries to perform PutObject on {string} site', { timeout: 5 * 60 * 1000 },
async function (this: Zenko, site: string) {
if (site === 'DR') {
Identity.useIdentity(IdentityEnum.ACCOUNT, `${Zenko.sites['source'].accountName}-replicated`);
} else {
Identity.useIdentity(IdentityEnum.ACCOUNT, Zenko.sites['source'].accountName);
}
this.resetCommand();
this.addToSaved('accountName', Zenko.sites['source'].accountName);

await this.setupEntity(EntityType.DATA_ACCESSOR);
// At this point, the role may take some time to be propagated
// so, tolerate up to 5m of retries
let conditionOk = false;
while (!conditionOk) {
try {
await this.setupEntity(EntityType.DATA_ACCESSOR);
conditionOk = true;
} catch (err) {
this.logger.error('Failed to setup entity', { err });
}
}

this.addCommandParameter({ bucket: this.getSaved<string>('bucketName') });
this.addCommandParameter({ key: `${Utils.randomString()}` });
this.addCommandParameter({ bucket: this.getSaved<string>('bucketName') });
this.addCommandParameter({ key: `${Utils.randomString()}` });

this.setResult(await S3.putObject(this.getCommandParameters()));
});
this.setResult(await S3.putObject(this.getCommandParameters()));
});

Then('the kafka DR volume exists', { timeout: 60000 }, async function (this: Zenko) {
const volumeClaim = await getPVCFromLabel(this, 'kafka_cr', 'end2end-pra-sink-base-queue');
Expand Down
1 change: 1 addition & 0 deletions tests/ctst/world/Zenko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ export default class Zenko extends World<ZenkoWorldParameters> {

nextMarker = GRFWIResponse.data.IsTruncated ? GRFWIResponse.data.Marker : undefined;
callNumber++;
await Utils.sleep(500);
} while (callNumber < 100);

// Ensure we can assume at least one role
Expand Down

0 comments on commit bb8aca4

Please sign in to comment.