Randomize cloudron names

This commit is contained in:
Girish Ramakrishnan 2015-06-16 09:59:22 -07:00
parent 191f8ca8e9
commit 917319d91a
4 changed files with 28 additions and 6 deletions

View File

@ -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 () {

View File

@ -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',

View File

@ -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 () {

View File

@ -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',