delete the migrate instance as well

This commit is contained in:
Girish Ramakrishnan 2016-08-13 10:45:07 -07:00
parent c91f09a34f
commit f0f42b4f5e

View File

@ -58,7 +58,7 @@ describe('Selfhost EC2 Cloudron creation', function () {
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, restoreInstanceId, migrateInstanceId;
var fromVersion, toVersion, nextVersion;
it('can query versions', function () {
@ -222,9 +222,9 @@ describe('Selfhost EC2 Cloudron creation', function () {
assert(false, 'Restore failed');
}
newInstanceId = out.stdout.split('\n').filter(function (l) { return l.indexOf('ID: ') !== -1; })[0].split(':')[1].trim();
restoreInstanceId = out.stdout.split('\n').filter(function (l) { return l.indexOf('ID: ') !== -1; })[0].split(':')[1].trim();
console.log('New instance created with ID', newInstanceId);
console.log('New instance created with ID', restoreInstanceId);
});
it('runs the app', function () {
@ -250,6 +250,10 @@ describe('Selfhost EC2 Cloudron creation', function () {
if (out.stdout.indexOf('You can now use your Cloudron at') === -1) {
assert(false, 'Migrate failed');
}
migrateInstanceId = out.stdout.split('\n').filter(function (l) { return l.indexOf('ID: ') !== -1; })[0].split(':')[1].trim();
console.log('New instance created with ID', restoreInstanceId);
});
it('runs the app', function () {
@ -264,7 +268,7 @@ describe('Selfhost EC2 Cloudron creation', function () {
console.log('Cleanup EC2 instances');
var params = {
InstanceIds: [ instanceId, newInstanceId ]
InstanceIds: [ instanceId, restoreInstanceId, migrateInstanceId ]
};
ec2.terminateInstances(params, function (error) {