test update with custom domain

This commit is contained in:
Girish Ramakrishnan 2017-01-28 01:55:13 -08:00
parent 3e82ec8e33
commit 827314c451

View File

@ -12,7 +12,10 @@ var AppStore = require('../appstore.js'),
async = require('async'), async = require('async'),
Cloudron = require('../cloudron.js'), Cloudron = require('../cloudron.js'),
common = require('../common.js'), common = require('../common.js'),
mailer = require('../mailer.js'); mailer = require('../mailer.js'),
request = require('superagent-sync'),
semver = require('semver'),
sleep = require('../shell.js').sleep;
require('colors'); require('colors');
@ -27,7 +30,16 @@ describe('Custom domain test', function () {
var owner = common.getOwner(); var owner = common.getOwner();
var admin = common.getAdmin(); var admin = common.getAdmin();
var cloudron, appId, box, backupInfo; var cloudron, appId, box, backupInfo, nextVersion;
it('can query versions', function () {
var res = request.get('https://s3.amazonaws.com/staging-cloudron-releases/versions.json').end();
common.verifyResponse2xx(res);
var boxVersions = Object.keys(common.stripUnreachable(res.body)).sort(semver.rcompare);
var curVersion = boxVersions[1];
assert.strictEqual(curVersion, BOX_VERSION);
nextVersion = boxVersions[0];
});
it('can login to the store', function () { it('can login to the store', function () {
var accessToken = appStore.getAccessToken(owner); var accessToken = appStore.getAccessToken(owner);
@ -166,6 +178,21 @@ describe('Custom domain test', function () {
cloudron.checkAddons(cloudron.appFqdn(location), owner); cloudron.checkAddons(cloudron.appFqdn(location), owner);
}); });
it('can update to new version', function () {
console.log('Wait for cloudron to get the update to ' + nextVersion);
cloudron.checkForUpdates();
sleep(60 * 2);
cloudron.update(nextVersion);
});
it('runs the app', function () {
cloudron.waitForApp(appId);
});
it('can check the addons', function () {
cloudron.checkAddons(cloudron.appFqdn(location), owner);
});
it('can uninstall app', function () { it('can uninstall app', function () {
cloudron.uninstallApp(appId); cloudron.uninstallApp(appId);
}); });