Skip to content

Commit

Permalink
Extends the setup check js tests
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
  • Loading branch information
weeman1337 committed Aug 4, 2018
1 parent f33bdd1 commit f8cd5f5
Showing 1 changed file with 69 additions and 11 deletions.
80 changes: 69 additions & 11 deletions core/js/tests/specs/setupchecksSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand Down Expand Up @@ -217,7 +218,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand Down Expand Up @@ -265,7 +267,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand Down Expand Up @@ -311,7 +314,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand Down Expand Up @@ -355,7 +359,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand All @@ -368,6 +373,53 @@ describe('OC.SetupChecks tests', function() {
});
});

it('should return a warning if there are app directories with wrong permissions', 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,
securityDocs: 'https://docs.owncloud.org/myDocs.html',
serverHasInternetConnection: true,
isMemcacheConfigured: true,
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
isOpcacheProperlySetup: true,
hasOpcacheLoaded: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true,
missingIndexes: [],
outdatedCaches: [],
cronErrors: [],
cronInfo: {
diffInSeconds: 0
},
appDirsWithDifferentOwner: [
'/some/path'
]
})
);

async.done(function( data, s, x ){
expect(data).toEqual([{
msg: 'Some app directories are owned by a different user than the web server one. This may be the case if apps have been installed manually. Check the permissions of the following app directories:<ul><li>/some/path</li></ul>',
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
}]);
done();
});
});

it('should return an error if the forwarded for headers are not working', function(done) {
var async = OC.SetupChecks.checkSetup();

Expand Down Expand Up @@ -399,7 +451,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand Down Expand Up @@ -443,7 +496,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand Down Expand Up @@ -508,7 +562,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand Down Expand Up @@ -553,7 +608,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand Down Expand Up @@ -598,7 +654,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand Down Expand Up @@ -643,7 +700,8 @@ describe('OC.SetupChecks tests', function() {
cronErrors: [],
cronInfo: {
diffInSeconds: 0
}
},
appDirsWithDifferentOwner: []
})
);

Expand Down

0 comments on commit f8cd5f5

Please sign in to comment.