1) The ExportUser command calls isAppEnabledForUser but passes just the string value "uid" (the username). But the core method expects to be passed an OCP/IUser object.
Up to now, this error was not noticed. Tests had to call isAppEnabledForUser in an environment where there were combinations of apps whitelisted for various groups - that was the only situation when the parameter passed in was actually used as an IUser object.
Core PR https://github.com/owncloud/core/pull/40257 was merged yesterday. That added more code to isAppEnabledForUser, and that meant that the error in the data_exporter app is now causing test failures.
This PR fixes the calls. It is all backward-compatible with previous versions of oC10 core - so there is no need to increase the core min-version.
2) while I was trying export and import commands, I noticed that they always exit with "0" (success) status at the command line. The 2nd commit adds code to make them exit with status 1 in case of error.
Related Issue
Fixes #205
How Has This Been Tested?
Local run of test scenario:
$ make test-acceptance-cli BEHAT_FEATURE=tests/acceptance/features/cliDataExporter/export.feature:9
It fails before the code change, and passes after the code change.
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Description
1) The ExportUser command calls
isAppEnabledForUser
but passes just the string value "uid" (the username). But the core method expects to be passed anOCP/IUser
object.Up to now, this error was not noticed. Tests had to call
isAppEnabledForUser
in an environment where there were combinations of apps whitelisted for various groups - that was the only situation when the parameter passed in was actually used as anIUser
object.Core PR https://github.com/owncloud/core/pull/40257 was merged yesterday. That added more code to
isAppEnabledForUser
, and that meant that the error in the data_exporter app is now causing test failures.This PR fixes the calls. It is all backward-compatible with previous versions of oC10 core - so there is no need to increase the core min-version.
2) while I was trying export and import commands, I noticed that they always exit with "0" (success) status at the command line. The 2nd commit adds code to make them exit with status 1 in case of error.
Related Issue
Fixes #205
How Has This Been Tested?
Local run of test scenario:
It fails before the code change, and passes after the code change.
Types of changes
Checklist: