Add update test for selfhosters

This commit is contained in:
Johannes Zellner 2016-06-28 14:43:09 +02:00
parent ef4b690b56
commit e23c80628b

View File

@ -53,10 +53,10 @@ describe('Selfhost EC2 Cloudron creation', function () {
this.timeout(0);
var appStore = new AppStore('https://api.staging.cloudron.io');
var ec2 = new AWS.Route53({ accessKeyId: AWS_ACCESS_KEY, secretAccessKey: AWS_ACCESS_SECRET, region: EC2_REGION });
var ec2 = new AWS.EC2({ accessKeyId: AWS_ACCESS_KEY, secretAccessKey: AWS_ACCESS_SECRET, region: EC2_REGION });
var owner = common.getOwner();
var cloudron, appId, backupInfo, instanceId, newInstanceId;
var cloudron, appId, backupInfo, instanceId, newInstanceId, updatedInstanceId;
it('can create a cloudron', function () {
var params = [
@ -171,6 +171,42 @@ describe('Selfhost EC2 Cloudron creation', function () {
cloudron.reboot();
});
it('runs the app', function () {
cloudron.waitForApp(appId);
});
it('can check the addons', function () {
cloudron.checkAddons(cloudron.appFqdn(location), owner);
});
it('can check mail', function (done) {
cloudron.checkMail(owner, done);
});
it('can update the box', function () {
cloudron.checkForUpdates();
var params = [
'--ssh-key ' + EC2_SSH_KEY,
'--instance-id ' + newInstanceId
];
var out = machine('update ' + params.join(' '));
if (out.stdout.indexOf('You can now use your Cloudron at') === -1) {
console.error(out.stdout, out.stderr);
assert(false, 'Update failed');
}
updatedInstanceId = out.stdout.split('\n').filter(function (l) { return l.indexOf('ID: ') !== -1; })[0].split(':')[1].trim();
console.log('New instance created with ID', updatedInstanceId);
});
it('runs the app', function () {
cloudron.waitForApp(appId);
});
it('can check the addons', function () {
cloudron.checkAddons(cloudron.appFqdn(location), owner);
});
@ -196,7 +232,7 @@ describe('Selfhost EC2 Cloudron creation', function () {
it('can delete the cloudron', function (done) {
var params = {
InstanceIds: [ instanceId, newInstanceId ]
InstanceIds: [ instanceId, newInstanceId, updatedInstanceId ]
};
ec2.terminateInstances(params, done);