diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-03-26 14:51:33 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-03-28 13:59:22 +0100 |
commit | 65202d2a18aca3b253ce5f3c7c9af17ee6d12e52 (patch) | |
tree | 04453d95db5dc3df386188cd85032052fded6db9 /core/js | |
parent | d3752ca1e925c3aed46c13f7ea26c8f540db05e0 (diff) | |
download | nextcloud-server-65202d2a18aca3b253ce5f3c7c9af17ee6d12e52.tar.gz nextcloud-server-65202d2a18aca3b253ce5f3c7c9af17ee6d12e52.zip |
Add check for activated local memcache
Also used the opportunity to refactor it into an AppFramework controller so that we can unit test it.
Fixes https://github.com/owncloud/core/issues/14956
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/setupchecks.js | 5 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 24 |
2 files changed, 26 insertions, 3 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 67925d75d34..82c068cd683 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -59,6 +59,11 @@ t('core', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.') ); } + if(!data.isMemcacheConfigured) { + messages.push( + t('core', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/8.0/admin_manual/configuration_server/performance_tuning.html">documentation</a>.') + ); + } } else { messages.push(t('core', 'Error occurred while checking server setup')); } diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index 70f64432e9e..779faa25449 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -66,11 +66,11 @@ describe('OC.SetupChecks tests', function() { { 'Content-Type': 'application/json' }, - JSON.stringify({data: {serverHasInternetConnection: false}}) + JSON.stringify({serverHasInternetConnection: false}) ); async.done(function( data, s, x ){ - expect(data).toEqual(['This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.']); + expect(data).toEqual(['This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/8.0/admin_manual/configuration_server/performance_tuning.html">documentation</a>.']); done(); }); }); @@ -83,7 +83,24 @@ describe('OC.SetupChecks tests', function() { { 'Content-Type': 'application/json' }, - JSON.stringify({data: {serverHasInternetConnection: false, dataDirectoryProtected: false}}) + JSON.stringify({serverHasInternetConnection: false, dataDirectoryProtected: false}) + ); + + async.done(function( data, s, x ){ + expect(data).toEqual(['This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/8.0/admin_manual/configuration_server/performance_tuning.html">documentation</a>.']); + done(); + }); + }); + + it('should return an error if server has no internet connection and data directory is not protected and memcache is available', function(done) { + var async = OC.SetupChecks.checkSetup(); + + suite.server.requests[0].respond( + 200, + { + 'Content-Type': 'application/json', + }, + JSON.stringify({serverHasInternetConnection: false, dataDirectoryProtected: false, isMemcacheConfigured: true}) ); async.done(function( data, s, x ){ @@ -92,6 +109,7 @@ describe('OC.SetupChecks tests', function() { }); }); + it('should return an error if the response has no statuscode 200', function(done) { var async = OC.SetupChecks.checkSetup(); |