diff --git a/test/app-flow-test.js b/test/app-flow-test.js index 77b5396..2c441eb 100644 --- a/test/app-flow-test.js +++ b/test/app-flow-test.js @@ -15,6 +15,11 @@ require('colors'); process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; +function cloudronName() { + var r = (Math.random() * 1000).toFixed(); + return 't-' + path.basename(__filename, '-test.js') + '-' + r + '.smartserver.io'; +} + function verifyResponse(res, errorMessage) { if (res.statusCode < 200 || res.statusCode > 299) { console.log('Response error statusCode:%s error:%s body:%s', res.statusCode, res.error, res.body); @@ -50,7 +55,7 @@ describe('Application flow test', function () { it('can create a cloudron', function () { box = appStore.createCloudron({ - name: 'testbox-' + path.basename(__filename, '-test.js') + '.smartserver.io', + name: cloudronName(), zoneName: 'smartserver.io', region: 'sfo1', size: '512mb', @@ -91,7 +96,8 @@ describe('Application flow test', function () { }); it('can configure app', function () { - cloudron.configureApp(appId, location + 'x'); + location = location + 'x'; + cloudron.configureApp(appId, location); }); it('can check the addons', function () { diff --git a/test/cloudron-user-test.js b/test/cloudron-user-test.js index 0ac1d21..5159435 100644 --- a/test/cloudron-user-test.js +++ b/test/cloudron-user-test.js @@ -15,6 +15,11 @@ require('colors'); process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; +function cloudronName() { + var r = (Math.random() * 1000).toFixed(); + return 't-' + path.basename(__filename, '-test.js') + '-' + r + '.smartserver.io'; +} + function verifyResponse(res, errorMessage) { if (res.statusCode < 200 || res.statusCode > 299) { console.log('Response error statusCode:%s error:%s body:%s', res.statusCode, res.error, res.body); @@ -50,7 +55,7 @@ describe('Cloudron user creation testing', function () { it('can create a cloudron', function () { box = appStore.createCloudron({ - name: 'testbox-' + path.basename(__filename, '-test.js') + '.smartserver.io', + name: cloudronName(), zoneName: 'smartserver.io', region: 'sfo1', size: '512mb', diff --git a/test/new-user-test.js b/test/new-user-test.js index 6ff0663..aa64586 100644 --- a/test/new-user-test.js +++ b/test/new-user-test.js @@ -15,6 +15,11 @@ require('colors'); process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; +function cloudronName() { + var r = (Math.random() * 1000).toFixed(); + return 't-' + path.basename(__filename, '-test.js') + '-' + r + '.smartserver.io'; +} + function verifyResponse(res, errorMessage) { if (res.statusCode < 200 || res.statusCode > 299) { console.log('Response error statusCode:%s error:%s body:%s', res.statusCode, res.error, res.body); @@ -50,7 +55,7 @@ describe('Appstore new user flow', function () { it('can create a cloudron', function () { box = appStore.createCloudron({ - name: 'testbox-' + path.basename(__filename, '-test.js') + '.smartserver.io', + name: cloudronName(), zoneName: 'smartserver.io', region: 'sfo1', size: '512mb', @@ -75,7 +80,8 @@ describe('Appstore new user flow', function () { }); it('can configure app', function () { - cloudron.configureApp(appId, location + 'x'); + location = location + 'x'; + cloudron.configureApp(appId, location); }); it('can uninstall app', function () { diff --git a/test/update-test.js b/test/update-test.js index 5512b9c..57a8941 100644 --- a/test/update-test.js +++ b/test/update-test.js @@ -15,6 +15,11 @@ require('colors'); process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; +function cloudronName() { + var r = (Math.random() * 1000).toFixed(); + return 't-' + path.basename(__filename, '-test.js') + '-' + r + '.smartserver.io'; +} + function verifyResponse(res, errorMessage) { if (res.statusCode < 200 || res.statusCode > 299) { console.log('Response error statusCode:%s error:%s body:%s', res.statusCode, res.error, res.body); @@ -53,7 +58,7 @@ describe('Cloudron update testing', function () { it('can create a cloudron', function () { box = appStore.createCloudron({ - name: 'testbox-' + path.basename(__filename, '-test.js') + '.smartserver.io', + name: cloudronName(), zoneName: 'smartserver.io', region: 'sfo1', size: '512mb',