Skip to content

Commit

Permalink
tests(api): add license from vault (#8907)
Browse files Browse the repository at this point in the history
Co-authored-by: Hayk Sardaryan <[email protected]>
  • Loading branch information
Hayk-S and Hayk-S authored May 15, 2024
1 parent 550b1ac commit 3424e55
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec-ee/kong-api-tests/test/gateway/admin-api/licenses.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('Gateway /licenses API tests', function () {
const licenseKey = 'ASDASDASDASDASDASDASDASDASD_a1VASASD';
const validLicense = authDetails.license.valid;
const inValidLicense = authDetails.license.invalid;
const validLicenseAws = '{vault://aws/gateway-secret-test/ee_license}'

const url = `${getBasePath({
environment: isGateway() ? Environment.gateway.admin : undefined,
Expand Down Expand Up @@ -254,6 +255,24 @@ describe('Gateway /licenses API tests', function () {
).to.include('postgres');
});

// unskip when https://konghq.atlassian.net/browse/KAG-4341 is fixed
it.skip('should delete the license and post a new one from aws vault', async function () {
let resp = await axios({
method: 'delete',
url: `${url}/${licenseId}`,
});
logResponse(resp);

expect(resp.status, 'Status should be 204').to.equal(204);

resp = await postNegative(url, { payload: validLicenseAws });
logResponse(resp);
expect(resp.data.message, 'Should not see license decode error').to.not.include('Unable to validate license: could not decode license json')

licenseId = resp.data.id;
assertBasicRespDetails(resp);
});

after(async function () {
// safegurad subsequent tests from failing due to ee license by additionally posting the ee license
const resp = await postNegative(url, { payload: validLicense });
Expand Down

0 comments on commit 3424e55

Please sign in to comment.