summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMichael Weimann <mail@michael-weimann.eu>2018-08-04 20:39:51 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-08-20 15:24:10 +0200
commit1d2bc9c45ecbbb7521dbf14dba6560d925691f01 (patch)
treea2f3ba70eb4b38b8b793ed9acd239ec52f98f5b0 /core
parentc2fced446396dad822404f3fae3ccb1c7df0dc89 (diff)
downloadnextcloud-server-1d2bc9c45ecbbb7521dbf14dba6560d925691f01.tar.gz
nextcloud-server-1d2bc9c45ecbbb7521dbf14dba6560d925691f01.zip
Adds tests for the setup memory limit checks
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
Diffstat (limited to 'core')
-rw-r--r--core/js/tests/specs/setupchecksSpec.js78
1 files changed, 67 insertions, 11 deletions
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index e22fb35102e..bde1f6d6a79 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -170,7 +170,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);
@@ -217,7 +218,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);
@@ -265,7 +267,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);
@@ -311,7 +314,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);
@@ -355,7 +359,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);
@@ -399,7 +404,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);
@@ -443,7 +449,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);
@@ -456,6 +463,51 @@ describe('OC.SetupChecks tests', function() {
});
});
+ it('should return a warning if the memory limit is too small', function(done) {
+ var async = OC.SetupChecks.checkSetup();
+
+ suite.server.requests[0].respond(
+ 200,
+ {
+ 'Content-Type': 'application/json',
+ },
+ JSON.stringify({
+ hasFileinfoInstalled: true,
+ isGetenvServerWorking: true,
+ isReadOnlyConfig: false,
+ hasWorkingFileLocking: true,
+ hasValidTransactionIsolationLevel: true,
+ suggestedOverwriteCliURL: '',
+ isUrandomAvailable: true,
+ serverHasInternetConnection: true,
+ isMemcacheConfigured: true,
+ forwardedForHeadersWorking: true,
+ reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html',
+ isCorrectMemcachedPHPModuleInstalled: true,
+ hasPassedCodeIntegrityCheck: true,
+ isOpcacheProperlySetup: true,
+ hasOpcacheLoaded: true,
+ isSettimelimitAvailable: true,
+ hasFreeTypeSupport: true,
+ missingIndexes: [],
+ outdatedCaches: [],
+ cronErrors: [],
+ cronInfo: {
+ diffInSeconds: 0
+ },
+ isTheMemoryLimitHighEnough: false
+ })
+ );
+
+ async.done(function( data, s, x ){
+ expect(data).toEqual([{
+ msg: 'The PHP memory limit is below the recommended value of 512MB.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }]);
+ done();
+ });
+ });
+
it('should return an error if the response has no statuscode 200', function(done) {
var async = OC.SetupChecks.checkSetup();
@@ -508,7 +560,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);
@@ -553,7 +606,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);
@@ -598,7 +652,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);
@@ -643,7 +698,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
- }
+ },
+ isTheMemoryLimitHighEnough: true
})
);