summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-08-21 09:51:33 +0200
committerGitHub <noreply@github.com>2018-08-21 09:51:33 +0200
commit383699398fc48b50b76f4eebcb25a489bcd2ec58 (patch)
treec1c3d1c59f355ae327747693bb376da078ca1d8a /core
parentbac545e7540295c39f94490536d0986a0693c533 (diff)
parent20839a422bd5fc33d6df1e778daae4999b181460 (diff)
downloadnextcloud-server-383699398fc48b50b76f4eebcb25a489bcd2ec58.tar.gz
nextcloud-server-383699398fc48b50b76f4eebcb25a489bcd2ec58.zip
Merge pull request #10539 from nextcloud/feature-8642-memory-check
Adds a setup and cli check for the recommended memory limit
Diffstat (limited to 'core')
-rw-r--r--core/js/setupchecks.js11
-rw-r--r--core/js/tests/specs/setupchecksSpec.js58
2 files changed, 68 insertions, 1 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js
index 13e351445e9..628606a9e5b 100644
--- a/core/js/setupchecks.js
+++ b/core/js/setupchecks.js
@@ -316,8 +316,17 @@
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
});
}
+ if (!data.isMemoryLimitSufficient) {
+ messages.push({
+ msg: t(
+ 'core',
+ 'The PHP memory limit is below the recommended value of 512MB.'
+ ),
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ })
+ }
- if(data.appDirsWithDifferentOwner.length > 0) {
+ if(data.appDirsWithDifferentOwner && data.appDirsWithDifferentOwner.length > 0) {
var appDirsWithDifferentOwner = data.appDirsWithDifferentOwner.reduce(
function(appDirsWithDifferentOwner, directory) {
return appDirsWithDifferentOwner + '<li>' + directory + '</li>';
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index 30c2ad9c5f0..4c0545b7b4f 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -171,6 +171,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);
@@ -219,6 +220,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);
@@ -268,6 +270,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);
@@ -315,6 +318,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);
@@ -360,6 +364,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);
@@ -405,6 +410,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: [
'/some/path'
]
@@ -452,6 +458,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);
@@ -497,6 +504,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);
@@ -510,6 +518,52 @@ describe('OC.SetupChecks tests', function() {
});
});
+ it('should return a warning if the memory limit is below the recommended value', 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
+ },
+ appDirsWithDifferentOwner: [],
+ isMemoryLimitSufficient: 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();
@@ -563,6 +617,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);
@@ -609,6 +664,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);
@@ -655,6 +711,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);
@@ -701,6 +758,7 @@ describe('OC.SetupChecks tests', function() {
cronInfo: {
diffInSeconds: 0
},
+ isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: []
})
);