From 45df699586968331b499f05c1ce05b93240e919c Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 12 Jan 2017 19:18:12 -0800 Subject: [PATCH] sprinkle dnsbl tests --- cloudron.js | 6 ++++++ test/app-flow-test.js | 8 ++++++++ test/cloudron-autoupdate-sfo1-test.js | 4 ++++ test/cloudron-migrate-test.js | 4 ++++ test/selfhost-digitalocean-filesystem-test.js | 8 ++++++++ test/selfhost-ec2-test.js | 4 ++++ 6 files changed, 34 insertions(+) diff --git a/cloudron.js b/cloudron.js index 2586d33..f928c17 100644 --- a/cloudron.js +++ b/cloudron.js @@ -628,6 +628,12 @@ Cloudron.prototype.checkAddons = function (domain, owner) { throw lastError; }; +Cloudron.prototype.checkDnsbl = function (domain) { + var res = request.post('https://' + domain + '/check_dnsbl').end(); + common.verifyResponse2xx(res, 'Could not query dnsbl'); + assert.strictEqual(res.body.status, 'OK'); +}; + Cloudron.prototype.setDnsConfig = function (dnsConfig) { var res = request.post(this._origin + '/api/v1/settings/dns_config').query({ access_token: this._credentials.accessToken }).send(dnsConfig).end(); common.verifyResponse2xx(res, 'Could not set dns config'); diff --git a/test/app-flow-test.js b/test/app-flow-test.js index 284e88d..6c88a25 100644 --- a/test/app-flow-test.js +++ b/test/app-flow-test.js @@ -71,6 +71,10 @@ describe('Application flow test', function () { cloudron.checkAddons(cloudron.appFqdn(location), owner); }); + it('can check dnsbl', function () { + cloudron.checkDnsbl(cloudron.appFqdn(location)); + }); + function checkExposedPort(port, done) { var client = new net.Socket(); var data = [ ]; @@ -104,6 +108,10 @@ describe('Application flow test', function () { cloudron.checkAddons(cloudron.appFqdn(location), owner); }); + it('can check dnsbl', function () { + cloudron.checkDnsbl(cloudron.appFqdn(location)); + }); + it('can access exposed port', function (done) { checkExposedPort(5151, done); }); diff --git a/test/cloudron-autoupdate-sfo1-test.js b/test/cloudron-autoupdate-sfo1-test.js index 572023b..1cd7042 100644 --- a/test/cloudron-autoupdate-sfo1-test.js +++ b/test/cloudron-autoupdate-sfo1-test.js @@ -132,6 +132,10 @@ describe('Cloudron update testing', function () { cloudron.checkAddons(cloudron.appFqdn(location), owner); }); + it('can check dnsbl', function () { + cloudron.checkDnsbl(cloudron.appFqdn(location)); + }); + it('can uninstall app', function () { cloudron.uninstallApp(appId); }); diff --git a/test/cloudron-migrate-test.js b/test/cloudron-migrate-test.js index 0bbd950..1634bdf 100644 --- a/test/cloudron-migrate-test.js +++ b/test/cloudron-migrate-test.js @@ -144,6 +144,10 @@ describe('Custom domain test', function () { cloudron.checkAddons(cloudron.appFqdn(location), owner); }); + it('can check dnsbl', function () { + cloudron.checkDnsbl(cloudron.appFqdn(location)); + }); + it('can migrate to bigger size', function () { cloudron.migrate({ size: '2gb' }); }); diff --git a/test/selfhost-digitalocean-filesystem-test.js b/test/selfhost-digitalocean-filesystem-test.js index 00e65d8..cc839c1 100644 --- a/test/selfhost-digitalocean-filesystem-test.js +++ b/test/selfhost-digitalocean-filesystem-test.js @@ -176,6 +176,10 @@ describe('Selfhost DigitalOcean with filesystem backend', function () { cloudron.checkAddons(cloudron.appFqdn(location), owner); }); + it('can check dnsbl', function () { + cloudron.checkDnsbl(cloudron.appFqdn(location)); + }); + it('can reboot the cloudron', function () { cloudron.reboot(); }); @@ -188,6 +192,10 @@ describe('Selfhost DigitalOcean with filesystem backend', function () { cloudron.checkAddons(cloudron.appFqdn(location), owner); }); + it('can check dnsbl', function () { + cloudron.checkDnsbl(cloudron.appFqdn(location)); + }); + it('can check mail', function (done) { cloudron.checkMail(owner, done); }); diff --git a/test/selfhost-ec2-test.js b/test/selfhost-ec2-test.js index 2e42207..c12dee6 100644 --- a/test/selfhost-ec2-test.js +++ b/test/selfhost-ec2-test.js @@ -184,6 +184,10 @@ describe('Selfhost EC2 Cloudron creation', function () { cloudron.checkAddons(cloudron.appFqdn(location), owner); }); + it('can check dnsbl', function () { + cloudron.checkDnsbl(cloudron.appFqdn(location)); + }); + it('can reboot the cloudron', function () { cloudron.reboot(); });