-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add skr binding test * Lint * More tests * Add missing variables * Add missing variables * Update docs * Fix makefile * Fix field * Provision without init * Review * Lint * Lint
- Loading branch information
1 parent
fba6247
commit 2859e9b
Showing
6 changed files
with
105 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
const {gatherOptions} = require('../skr-test'); | ||
const {initializeK8sClient} = require('../utils/index.js'); | ||
const {getSecret} = require('../utils'); | ||
const {provisionSKRInstance} = require('../skr-test/provision/provision-skr'); | ||
const {deprovisionAndUnregisterSKR} = require('../skr-test/provision/deprovision-skr'); | ||
const {KEBClient, KEBConfig} = require('../kyma-environment-broker'); | ||
const keb = new KEBClient(KEBConfig.fromEnv()); | ||
|
||
const provisioningTimeout = 1000 * 60 * 30; // 30m | ||
const deprovisioningTimeout = 1000 * 60 * 95; // 95m | ||
let globalTimeout = 1000 * 60 * 70; // 70m | ||
const slowTime = 5000; | ||
const secretName = 'sap-btp-manager'; | ||
const ns = 'kyma-system'; | ||
|
||
describe('SKR Binding test', function() { | ||
globalTimeout += provisioningTimeout + deprovisioningTimeout; | ||
|
||
this.timeout(globalTimeout); | ||
this.slow(slowTime); | ||
|
||
const options = gatherOptions(); // with default values | ||
let kubeconfigFromBinding; | ||
|
||
before('Ensure SKR is provisioned', async function() { | ||
this.timeout(provisioningTimeout); | ||
await provisionSKRInstance(options, provisioningTimeout); | ||
}); | ||
|
||
it('Create SKR binding', async function() { | ||
try { | ||
kubeconfigFromBinding = await keb.createBinding(options.instanceID); | ||
} catch (err) { | ||
console.log(err); | ||
} | ||
}); | ||
|
||
it('Initiate K8s client with kubeconfig from binding', async function() { | ||
await initializeK8sClient({kubeconfig: kubeconfigFromBinding.credentials}); | ||
}); | ||
|
||
it('Fetch sap-btp-manager secret', async function() { | ||
await getSecret(secretName, ns); | ||
}); | ||
|
||
after('Cleanup the resources', async function() { | ||
this.timeout(deprovisioningTimeout); | ||
if (process.env['SKIP_DEPROVISIONING'] != 'true') { | ||
await deprovisionAndUnregisterSKR(options, deprovisioningTimeout, true); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters