From b1c5c2468aafb8b163e8ab09ec6e758d877b6685 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 13 Oct 2015 13:44:23 +0200 Subject: [PATCH] Fix test to support docker api up to 1.19 and v1.20 --- src/routes/test/apps-test.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/routes/test/apps-test.js b/src/routes/test/apps-test.js index ab979d3f5..baca363dd 100644 --- a/src/routes/test/apps-test.js +++ b/src/routes/test/apps-test.js @@ -675,7 +675,14 @@ describe('App installation', function () { it('installation - running container has volume mounted', function (done) { docker.getContainer(appEntry.containerId).inspect(function (error, data) { expect(error).to.not.be.ok(); - expect(data.Volumes['/app/data']).to.eql(paths.DATA_DIR + '/' + APP_ID + '/data'); + + // support newer docker versions + if (data.Volumes) { + expect(data.Volumes['/app/data']).to.eql(paths.DATA_DIR + '/' + APP_ID + '/data'); + } else { + expect(data.Mounts.filter(function (mount) { return mount.Destination === '/app/data'; })[0].Source).to.eql(paths.DATA_DIR + '/' + APP_ID + '/data'); + } + done(); }); }); @@ -1130,7 +1137,14 @@ describe('App installation - port bindings', function () { it('installation - running container has volume mounted', function (done) { docker.getContainer(appEntry.containerId).inspect(function (error, data) { expect(error).to.not.be.ok(); - expect(data.Volumes['/app/data']).to.eql(paths.DATA_DIR + '/' + APP_ID + '/data'); + + // support newer docker versions + if (data.Volumes) { + expect(data.Volumes['/app/data']).to.eql(paths.DATA_DIR + '/' + APP_ID + '/data'); + } else { + expect(data.Mounts.filter(function (mount) { return mount.Destination === '/app/data'; })[0].Source).to.eql(paths.DATA_DIR + '/' + APP_ID + '/data'); + } + done(); }); });