The condition to disable/enable encryption checkbox on bucket form is broken because of the new structure of the get encryption config API response.
Fixes: https://tracker.ceph.com/issues/70646
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
// Select bucket owner
this.selectOwner(owner);
cy.get('#owner').should('have.class', 'ng-valid');
+ cy.get('input[name=encryption_enabled]').should('be.disabled');
if (isLocking) {
cy.get('#lock_enabled_input').click({ force: true });
configurations.getDataTables().should('contain.text', 'https://localhost:9090');
});
});
+
+ describe('check bucket encryption checkbox', () => {
+ it('should ensure encryption checkbox to be enabled in bucket form', () => {
+ configurations.checkBucketEncryption();
+ });
+ });
});
import { PageHelper } from '../page-helper.po';
+import { BucketsPageHelper } from './buckets.po';
+
+const buckets = new BucketsPageHelper();
export class ConfigurationPageHelper extends PageHelper {
pages = {
private selectSecretEngine(secret_engine: string) {
return this.selectOption('secret_engine', secret_engine);
}
+
+ checkBucketEncryption() {
+ buckets.navigateTo('create');
+ cy.get('input[name=encryption_enabled]').should('be.enabled');
+ }
}
this.kmsProviders = rgwBucketEncryptionModel.kmsProviders;
this.rgwBucketService.getEncryptionConfig().subscribe((data) => {
- if (data['SSE_KMS']?.length > 0) {
- this.kmsConfigured = true;
- }
- if (data['SSE_S3']?.length > 0) {
- this.s3Configured = true;
- }
+ this.s3Configured = data.s3 && Object.keys(data.s3).length > 0;
+ this.kmsConfigured = data.kms && Object.keys(data.kms).length > 0;
// Set the encryption type based on the configurations
if (this.kmsConfigured && this.s3Configured) {
this.bucketForm.get('encryption_type').setValue('');