From f0f42b4f5e1e5369c615826dedb961f7c6c280a6 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sat, 13 Aug 2016 10:45:07 -0700 Subject: [PATCH] delete the migrate instance as well --- test/selfhost-ec2-create-test.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/selfhost-ec2-create-test.js b/test/selfhost-ec2-create-test.js index e8aa361..4047309 100644 --- a/test/selfhost-ec2-create-test.js +++ b/test/selfhost-ec2-create-test.js @@ -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) {