checkAddons many times
This commit is contained in:
parent
a872ae8bb4
commit
8ed0919a8c
33
cloudron.js
33
cloudron.js
@ -306,3 +306,36 @@ Cloudron.prototype.checkDMARC = function (callback) {
|
||||
});
|
||||
};
|
||||
|
||||
Cloudron.prototype.checkAddons = function (location, owner) {
|
||||
var lastError;
|
||||
|
||||
// try many times because the scheduler takes sometime to run
|
||||
for (var i = 0; i < 100; i++) {
|
||||
var res = request.post('https://' + location + '-' + this._box.domain + '/check_addons').query({ username: owner.username, password: owner.password }).end();
|
||||
|
||||
try {
|
||||
assert.strictEqual(res.statusCode, 200);
|
||||
assert.strictEqual(res.body.mysql, 'OK');
|
||||
assert.strictEqual(res.body.postgresql, 'OK');
|
||||
assert.strictEqual(res.body.mongodb, 'OK');
|
||||
assert.strictEqual(res.body.localstorage, 'OK');
|
||||
assert.strictEqual(res.body.ldap, 'OK');
|
||||
assert.strictEqual(res.body.sendmail, 'OK');
|
||||
assert.strictEqual(res.body.redis, 'OK');
|
||||
assert.strictEqual(res.body.simpleauth, 'OK');
|
||||
assert.strictEqual(res.body.scheduler, 'OK');
|
||||
|
||||
return;
|
||||
} catch (e) {
|
||||
lastError = e;
|
||||
|
||||
console.error(e);
|
||||
|
||||
console.log('Attempt %s failed. Trying again in 10 seconds', i);
|
||||
|
||||
sleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
throw lastError;
|
||||
};
|
||||
|
@ -76,16 +76,7 @@ describe('Application flow test', function () {
|
||||
});
|
||||
|
||||
it('can check the addons', function () {
|
||||
var res = request.post('https://' + location + '-' + box.domain + '/check_addons').query({ username: owner.username, password: owner.password }).end();
|
||||
assert.strictEqual(res.statusCode, 200);
|
||||
assert.strictEqual(res.body.mysql, 'OK');
|
||||
assert.strictEqual(res.body.postgresql, 'OK');
|
||||
assert.strictEqual(res.body.mongodb, 'OK');
|
||||
assert.strictEqual(res.body.localstorage, 'OK');
|
||||
assert.strictEqual(res.body.ldap, 'OK');
|
||||
assert.strictEqual(res.body.sendmail, 'OK');
|
||||
assert.strictEqual(res.body.redis, 'OK');
|
||||
assert.strictEqual(res.body.simpleauth, 'OK');
|
||||
cloudron.checkAddons(location, owner);
|
||||
});
|
||||
|
||||
it('can configure app', function () {
|
||||
@ -94,16 +85,7 @@ describe('Application flow test', function () {
|
||||
});
|
||||
|
||||
it('can check the addons', function () {
|
||||
var res = request.post('https://' + location + '-' + box.domain + '/check_addons').query({ username: owner.username, password: owner.password }).end();
|
||||
assert.strictEqual(res.statusCode, 200);
|
||||
assert.strictEqual(res.body.mysql, 'OK');
|
||||
assert.strictEqual(res.body.postgresql, 'OK');
|
||||
assert.strictEqual(res.body.mongodb, 'OK');
|
||||
assert.strictEqual(res.body.localstorage, 'OK');
|
||||
assert.strictEqual(res.body.ldap, 'OK');
|
||||
assert.strictEqual(res.body.sendmail, 'OK');
|
||||
assert.strictEqual(res.body.redis, 'OK');
|
||||
assert.strictEqual(res.body.simpleauth, 'OK');
|
||||
cloudron.checkAddons(location, owner);
|
||||
});
|
||||
|
||||
it('can reboot the cloudron', function () {
|
||||
@ -111,16 +93,7 @@ describe('Application flow test', function () {
|
||||
});
|
||||
|
||||
it('can check the addons', function () {
|
||||
var res = request.post('https://' + location + '-' + box.domain + '/check_addons').query({ username: owner.username, password: owner.password }).end();
|
||||
assert.strictEqual(res.statusCode, 200);
|
||||
assert.strictEqual(res.body.mysql, 'OK');
|
||||
assert.strictEqual(res.body.postgresql, 'OK');
|
||||
assert.strictEqual(res.body.mongodb, 'OK');
|
||||
assert.strictEqual(res.body.localstorage, 'OK');
|
||||
assert.strictEqual(res.body.ldap, 'OK');
|
||||
assert.strictEqual(res.body.sendmail, 'OK');
|
||||
assert.strictEqual(res.body.redis, 'OK');
|
||||
assert.strictEqual(res.body.simpleauth, 'OK');
|
||||
cloudron.checkAddons(location, owner);
|
||||
});
|
||||
|
||||
it('can uninstall app', function () {
|
||||
|
@ -77,15 +77,7 @@ describe('Cloudron backup testing', function () {
|
||||
});
|
||||
|
||||
it('can check the addons', function () {
|
||||
var res = request.post('https://' + location + '-' + box.domain + '/check_addons').query({ username: owner.username, password: owner.password }).end();
|
||||
assert.strictEqual(res.statusCode, 200);
|
||||
assert.strictEqual(res.body.mysql, 'OK');
|
||||
assert.strictEqual(res.body.postgresql, 'OK');
|
||||
assert.strictEqual(res.body.mongodb, 'OK');
|
||||
assert.strictEqual(res.body.localstorage, 'OK');
|
||||
assert.strictEqual(res.body.ldap, 'OK');
|
||||
assert.strictEqual(res.body.sendmail, 'OK');
|
||||
assert.strictEqual(res.body.simpleauth, 'OK');
|
||||
cloudron.checkAddons(location, owner);
|
||||
});
|
||||
|
||||
it('can backup the box', function () {
|
||||
@ -118,15 +110,7 @@ describe('Cloudron backup testing', function () {
|
||||
});
|
||||
|
||||
it('can check the addons', function () {
|
||||
var res = request.post('https://' + location + '-' + box.domain + '/check_addons').query({ username: owner.username, password: owner.password }).end();
|
||||
assert.strictEqual(res.statusCode, 200);
|
||||
assert.strictEqual(res.body.mysql, 'OK');
|
||||
assert.strictEqual(res.body.postgresql, 'OK');
|
||||
assert.strictEqual(res.body.mongodb, 'OK');
|
||||
assert.strictEqual(res.body.localstorage, 'OK');
|
||||
assert.strictEqual(res.body.ldap, 'OK');
|
||||
assert.strictEqual(res.body.sendmail, 'OK');
|
||||
assert.strictEqual(res.body.simpleauth, 'OK');
|
||||
cloudron.checkAddons(location, owner);
|
||||
});
|
||||
|
||||
it('can uninstall app', function () {
|
||||
|
@ -92,16 +92,7 @@ describe('Cloudron update testing', function () {
|
||||
});
|
||||
|
||||
it('can check the addons', function () {
|
||||
var res = request.post('https://' + location + '-' + box.domain + '/check_addons').query({ username: owner.username, password: owner.password }).end();
|
||||
assert.strictEqual(res.statusCode, 200);
|
||||
assert.strictEqual(res.body.mysql, 'OK');
|
||||
assert.strictEqual(res.body.postgresql, 'OK');
|
||||
assert.strictEqual(res.body.mongodb, 'OK');
|
||||
assert.strictEqual(res.body.localstorage, 'OK');
|
||||
assert.strictEqual(res.body.ldap, 'OK');
|
||||
assert.strictEqual(res.body.sendmail, 'OK');
|
||||
assert.strictEqual(res.body.redis, 'OK');
|
||||
assert.strictEqual(res.body.simpleauth, 'OK'); // disabled for this version since it returns 201
|
||||
cloudron.checkAddons(location, owner);
|
||||
});
|
||||
|
||||
it('can update the box', function () {
|
||||
@ -113,16 +104,7 @@ describe('Cloudron update testing', function () {
|
||||
});
|
||||
|
||||
it('can check the addons', function () {
|
||||
var res = request.post('https://' + location + '-' + box.domain + '/check_addons').query({ username: owner.username, password: owner.password }).end();
|
||||
assert.strictEqual(res.statusCode, 200);
|
||||
assert.strictEqual(res.body.mysql, 'OK');
|
||||
assert.strictEqual(res.body.postgresql, 'OK');
|
||||
assert.strictEqual(res.body.mongodb, 'OK');
|
||||
assert.strictEqual(res.body.localstorage, 'OK');
|
||||
assert.strictEqual(res.body.ldap, 'OK');
|
||||
assert.strictEqual(res.body.sendmail, 'OK');
|
||||
assert.strictEqual(res.body.redis, 'OK');
|
||||
assert.strictEqual(res.body.simpleauth, 'OK');
|
||||
cloudron.checkAddons(location, owner);
|
||||
});
|
||||
|
||||
it('can update to new version', function () {
|
||||
@ -136,16 +118,7 @@ describe('Cloudron update testing', function () {
|
||||
});
|
||||
|
||||
it('can check the addons', function () {
|
||||
var res = request.post('https://' + location + '-' + box.domain + '/check_addons').query({ username: owner.username, password: owner.password }).end();
|
||||
assert.strictEqual(res.statusCode, 200);
|
||||
assert.strictEqual(res.body.mysql, 'OK');
|
||||
assert.strictEqual(res.body.postgresql, 'OK');
|
||||
assert.strictEqual(res.body.mongodb, 'OK');
|
||||
assert.strictEqual(res.body.localstorage, 'OK');
|
||||
assert.strictEqual(res.body.ldap, 'OK');
|
||||
assert.strictEqual(res.body.sendmail, 'OK');
|
||||
assert.strictEqual(res.body.redis, 'OK');
|
||||
assert.strictEqual(res.body.simpleauth, 'OK');
|
||||
cloudron.checkAddons(location, owner);
|
||||
});
|
||||
|
||||
it('can uninstall app', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user