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

Automate GitJob security context test #265

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
38 changes: 38 additions & 0 deletions tests/cypress/e2e/unit_tests/p0_fleet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,41 @@ if (!/\/2\.7/.test(Cypress.env('rancher_version')) && !/\/2\.8/.test(Cypress.env
);
})
};

if (!/\/2\.8/.test(Cypress.env('rancher_version')) && !/\/2\.9/.test(Cypress.env('rancher_version'))) {
describe('Test GitJob security context', { tags: '@p0' }, () => {
qase(160,
it('FLEET-160: Test GitJob pod security context', { tags: '@fleet-160' }, () => {
// Check the GitJob pod for Security Context.
cy.accesMenuSelection('local', 'Workloads', 'Pods');
cy.filterInSearchBox('gitjob');
cy.verifyTableRow(0, 'Running', 'gitjob');
cy.contains('gitjob').click();
cy.clickButton('Config');
cy.get('section#container-0')
.find('.side-tabs ul.tabs li')
.eq(3)
.should('have.id', 'securityContext')
sbulage marked this conversation as resolved.
Show resolved Hide resolved
.should("be.visible")
sbulage marked this conversation as resolved.
Show resolved Hide resolved
.click()

// Check Run as Non-Root
cy.get('input[name="runasNonRoot"]:checked')
.should('have.value', 'false');

// Check Privilege Escalation
cy.get('input[name="allowPrivilegeEscalation"]:checked')
.should('have.value', 'false');

// Check Read Only Root File System
cy.get('input[name="readOnlyRootFilesystem"]:checked')
.should('have.value', 'true');

// Check Drop Capabilities
cy.get('[data-testid="input-security-drop"] .labeled-select .v-select span.vs__selected')
.contains('ALL')
.should('be.visible')
})
);
});
};
Loading