Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekMichali committed Oct 7, 2024
1 parent c19a71b commit 540b4e2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions testing/e2e/skr/skr-binding-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ describe('SKR Binding test', function() {

it('Create SKR binding for service account using Kubernetes TokenRequest', async function() {
try {
kubeconfigFromBinding = await keb.createBinding(options.instanceID, true);
resp = await keb.createBinding(options.instanceID, true);
kubeconfigFromBinding = resp.data.credentials.kubeconfig;
} catch (err) {
console.log(err);
}
});

it('Initiate K8s client with kubeconfig from binding', async function() {
await initializeK8sClient({kubeconfig: kubeconfigFromBinding.data.credentials.kubeconfig});
await initializeK8sClient({kubeconfig: kubeconfigFromBinding});
});

it('Fetch sap-btp-manager secret using binding for service account from Kubernetes TokenRequest', async function() {
Expand All @@ -47,22 +48,23 @@ describe('SKR Binding test', function() {
it('Create SKR binding using Gardener', async function() {
const expirationSeconds = 900;
try {
kubeconfigFromBinding = await keb.createBinding(options.instanceID, false, expirationSeconds);
expect(getKubeconfigValidityInSeconds(kubeconfigFromBinding.data.credentials.kubeconfig)).to.equal(expirationSeconds);
resp = await keb.createBinding(options.instanceID, false, expirationSeconds);
kubeconfigFromBinding = resp.data.credentials.kubeconfig;
expect(getKubeconfigValidityInSeconds(kubeconfigFromBinding)).to.equal(expirationSeconds);
} catch (err) {
console.log(err);
}
});

it('Initiate K8s client with kubeconfig from binding', async function() {
await initializeK8sClient({kubeconfig: kubeconfigFromBinding.credentials.kubeconfig});
await initializeK8sClient({kubeconfig: kubeconfigFromBinding});
});

it('Fetch sap-btp-manager secret using binding from Gardener', async function() {
await getSecret(secretName, ns);
});

it('Should not allow creation of SKR binding when expiration seconds value is below the minimum value', async function() {
it('Should not allow creation of SKR binding when expiration seconds value is below the min value', async function() {
const expirationSeconds = 1;
try {
await keb.createBinding(options.instanceID, true, expirationSeconds);
Expand All @@ -79,7 +81,7 @@ describe('SKR Binding test', function() {
}
});

it('Should not allow creation of SKR binding when expiration seconds value is over the maximum value', async function() {
it('Should not allow creation of SKR binding when expiration seconds value is over the max value', async function() {
const expirationSeconds = 999999999;
try {
await keb.createBinding(options.instanceID, true, expirationSeconds);
Expand Down

0 comments on commit 540b4e2

Please sign in to comment.