Auto testing privilege operation is not feasible because it requires user interaction. So instead what we do
is check if the flag for privilege execution is set and if the sub-jobs have a parent job.
If the conditions are met then metadata "TestData" is added which tells that the job is properly configured
and can perform file operations with elevated privileges.
Details
Details
- Reviewers
dfaure - Maniphest Tasks
- T6561: Polkit support in KIO
- Commits
- R241:ac51e5769c84: Add unit tests for privilege excution in KIO
Diff Detail
Diff Detail
- Repository
- R241 KIO
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage
Comment Actions
Looks good, just some minor things.
autotests/privilegejobtest.cpp | ||
---|---|---|
38 | #define should not be used in C++11. This can just as well be an inline function (not that I see much point anyway, writing QUrl::fromLocalFile is more readable and not that many more characters) And the enum values above can be static const int or static const QFileDevice::Permissions. | |
46 | not needed, called by the line below | |
100 | extract this into a different test method |
Comment Actions
Also please improve the commit log to be more self contained (unit tests for what? And "T6561" will mean nothing to someone doing git log).