name -> domain
This commit is contained in:
parent
015c711bd0
commit
413a9dbcf1
17
common.js
17
common.js
@ -3,5 +3,22 @@
|
|||||||
exports = module.exports = {
|
exports = module.exports = {
|
||||||
TESTAPP_ID: 'io.cloudron.testapp',
|
TESTAPP_ID: 'io.cloudron.testapp',
|
||||||
TESTAPP_VERSION : '1.0.2'
|
TESTAPP_VERSION : '1.0.2'
|
||||||
|
|
||||||
|
cloudronDomain: cloudronDomain,
|
||||||
|
verifyResponse: verifyResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function cloudronDomain(filename) {
|
||||||
|
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);
|
||||||
|
console.log(errorMessage.red);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,19 +21,6 @@ require('colors');
|
|||||||
|
|
||||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
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);
|
|
||||||
console.log(errorMessage.red);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('Application flow test', function () {
|
describe('Application flow test', function () {
|
||||||
this.timeout(0);
|
this.timeout(0);
|
||||||
|
|
||||||
@ -49,7 +36,7 @@ describe('Application flow test', function () {
|
|||||||
|
|
||||||
it('can query versions', function () {
|
it('can query versions', function () {
|
||||||
res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
|
res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
|
||||||
verifyResponse(res);
|
common.verifyResponse(res);
|
||||||
var boxVersions = Object.keys(res.body).sort(semver.rcompare);
|
var boxVersions = Object.keys(res.body).sort(semver.rcompare);
|
||||||
latestVersion = boxVersions[0];
|
latestVersion = boxVersions[0];
|
||||||
});
|
});
|
||||||
@ -61,7 +48,7 @@ describe('Application flow test', function () {
|
|||||||
|
|
||||||
it('can create a cloudron', function () {
|
it('can create a cloudron', function () {
|
||||||
box = appStore.createCloudron({
|
box = appStore.createCloudron({
|
||||||
name: cloudronName(),
|
domain: cloudronDomain(__filename),
|
||||||
zoneName: 'smartserver.io',
|
zoneName: 'smartserver.io',
|
||||||
region: 'sfo1',
|
region: 'sfo1',
|
||||||
size: '512mb',
|
size: '512mb',
|
||||||
|
@ -22,19 +22,6 @@ require('colors');
|
|||||||
|
|
||||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
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);
|
|
||||||
console.log(errorMessage.red);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('Cloudron backup testing', function () {
|
describe('Cloudron backup testing', function () {
|
||||||
this.timeout(0);
|
this.timeout(0);
|
||||||
|
|
||||||
@ -50,7 +37,7 @@ describe('Cloudron backup testing', function () {
|
|||||||
|
|
||||||
it('can query versions', function () {
|
it('can query versions', function () {
|
||||||
res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
|
res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
|
||||||
verifyResponse(res);
|
common.verifyResponse(res);
|
||||||
var boxVersions = Object.keys(res.body).sort(semver.rcompare);
|
var boxVersions = Object.keys(res.body).sort(semver.rcompare);
|
||||||
latestVersion = boxVersions[0];
|
latestVersion = boxVersions[0];
|
||||||
});
|
});
|
||||||
@ -62,7 +49,7 @@ describe('Cloudron backup testing', function () {
|
|||||||
|
|
||||||
it('can create a cloudron', function () {
|
it('can create a cloudron', function () {
|
||||||
box = appStore.createCloudron({
|
box = appStore.createCloudron({
|
||||||
name: cloudronName(),
|
domain: common.cloudronDomain(__filename),
|
||||||
zoneName: 'smartserver.io',
|
zoneName: 'smartserver.io',
|
||||||
region: 'sfo1',
|
region: 'sfo1',
|
||||||
size: '512mb',
|
size: '512mb',
|
||||||
|
@ -25,19 +25,6 @@ require('colors');
|
|||||||
|
|
||||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
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);
|
|
||||||
console.log(errorMessage.red);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('Cloudron update testing', function () {
|
describe('Cloudron update testing', function () {
|
||||||
this.timeout(0);
|
this.timeout(0);
|
||||||
|
|
||||||
@ -53,7 +40,7 @@ describe('Cloudron update testing', function () {
|
|||||||
|
|
||||||
it('can query versions', function () {
|
it('can query versions', function () {
|
||||||
res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
|
res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
|
||||||
verifyResponse(res);
|
common.verifyResponse(res);
|
||||||
var boxVersions = Object.keys(res.body).sort(semver.rcompare);
|
var boxVersions = Object.keys(res.body).sort(semver.rcompare);
|
||||||
fromVersion = boxVersions[1];
|
fromVersion = boxVersions[1];
|
||||||
toVersion = boxVersions[0];
|
toVersion = boxVersions[0];
|
||||||
@ -69,7 +56,7 @@ describe('Cloudron update testing', function () {
|
|||||||
|
|
||||||
it('can create a cloudron', function () {
|
it('can create a cloudron', function () {
|
||||||
box = appStore.createCloudron({
|
box = appStore.createCloudron({
|
||||||
name: cloudronName(),
|
domain: common.cloudronDomain(__filename),
|
||||||
zoneName: 'smartserver.io',
|
zoneName: 'smartserver.io',
|
||||||
region: 'sfo1',
|
region: 'sfo1',
|
||||||
size: '512mb',
|
size: '512mb',
|
||||||
|
@ -21,19 +21,6 @@ require('colors');
|
|||||||
|
|
||||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
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);
|
|
||||||
console.log(errorMessage.red);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('Cloudron user creation testing', function () {
|
describe('Cloudron user creation testing', function () {
|
||||||
this.timeout(0);
|
this.timeout(0);
|
||||||
|
|
||||||
@ -49,7 +36,7 @@ describe('Cloudron user creation testing', function () {
|
|||||||
|
|
||||||
it('can query versions', function () {
|
it('can query versions', function () {
|
||||||
res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
|
res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
|
||||||
verifyResponse(res);
|
common.verifyResponse(res);
|
||||||
var boxVersions = Object.keys(res.body).sort(semver.rcompare);
|
var boxVersions = Object.keys(res.body).sort(semver.rcompare);
|
||||||
latestVersion = boxVersions[0];
|
latestVersion = boxVersions[0];
|
||||||
});
|
});
|
||||||
@ -61,7 +48,7 @@ describe('Cloudron user creation testing', function () {
|
|||||||
|
|
||||||
it('can create a cloudron', function () {
|
it('can create a cloudron', function () {
|
||||||
box = appStore.createCloudron({
|
box = appStore.createCloudron({
|
||||||
name: cloudronName(),
|
domain: common.cloudronDomain(__filename),
|
||||||
zoneName: 'smartserver.io',
|
zoneName: 'smartserver.io',
|
||||||
region: 'sfo1',
|
region: 'sfo1',
|
||||||
size: '512mb',
|
size: '512mb',
|
||||||
|
@ -21,19 +21,6 @@ require('colors');
|
|||||||
|
|
||||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
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);
|
|
||||||
console.log(errorMessage.red);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('Appstore new user flow', function () {
|
describe('Appstore new user flow', function () {
|
||||||
this.timeout(0);
|
this.timeout(0);
|
||||||
|
|
||||||
@ -49,7 +36,7 @@ describe('Appstore new user flow', function () {
|
|||||||
|
|
||||||
it('can query versions', function () {
|
it('can query versions', function () {
|
||||||
res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
|
res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
|
||||||
verifyResponse(res);
|
common.verifyResponse(res);
|
||||||
var boxVersions = Object.keys(res.body).sort(semver.rcompare);
|
var boxVersions = Object.keys(res.body).sort(semver.rcompare);
|
||||||
latestVersion = boxVersions[0];
|
latestVersion = boxVersions[0];
|
||||||
});
|
});
|
||||||
@ -61,7 +48,7 @@ describe('Appstore new user flow', function () {
|
|||||||
|
|
||||||
it('can create a cloudron', function () {
|
it('can create a cloudron', function () {
|
||||||
box = appStore.createCloudron({
|
box = appStore.createCloudron({
|
||||||
name: cloudronName(),
|
domain: cloudronDomain(__filename),
|
||||||
zoneName: 'smartserver.io',
|
zoneName: 'smartserver.io',
|
||||||
region: 'sfo1',
|
region: 'sfo1',
|
||||||
size: '512mb',
|
size: '512mb',
|
||||||
|
Loading…
Reference in New Issue
Block a user