Add update test for selfhosters
This commit is contained in:
parent
ef4b690b56
commit
e23c80628b
|
@ -53,10 +53,10 @@ describe('Selfhost EC2 Cloudron creation', function () {
|
||||||
this.timeout(0);
|
this.timeout(0);
|
||||||
|
|
||||||
var appStore = new AppStore('https://api.staging.cloudron.io');
|
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 owner = common.getOwner();
|
||||||
var cloudron, appId, backupInfo, instanceId, newInstanceId;
|
var cloudron, appId, backupInfo, instanceId, newInstanceId, updatedInstanceId;
|
||||||
|
|
||||||
it('can create a cloudron', function () {
|
it('can create a cloudron', function () {
|
||||||
var params = [
|
var params = [
|
||||||
|
@ -171,6 +171,42 @@ describe('Selfhost EC2 Cloudron creation', function () {
|
||||||
cloudron.reboot();
|
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 () {
|
it('can check the addons', function () {
|
||||||
cloudron.checkAddons(cloudron.appFqdn(location), owner);
|
cloudron.checkAddons(cloudron.appFqdn(location), owner);
|
||||||
});
|
});
|
||||||
|
@ -196,7 +232,7 @@ describe('Selfhost EC2 Cloudron creation', function () {
|
||||||
|
|
||||||
it('can delete the cloudron', function (done) {
|
it('can delete the cloudron', function (done) {
|
||||||
var params = {
|
var params = {
|
||||||
InstanceIds: [ instanceId, newInstanceId ]
|
InstanceIds: [ instanceId, newInstanceId, updatedInstanceId ]
|
||||||
};
|
};
|
||||||
|
|
||||||
ec2.terminateInstances(params, done);
|
ec2.terminateInstances(params, done);
|
||||||
|
|
Loading…
Reference in New Issue