userEnable: fix bug and add unit test
This commit adds unit tests for the |userEnable| function. To make it
happen, a new overload of |executeUserModify| is introduced. The idea
is the same as previous commits where we add sudo in unit tests.
Thanks to this unit test, this commit fixes an existing bug where the
corresponding user's |userEnabled| attribute isn't updated.
Tested: unit test passed
Coverage:
lines......: 81.3% (1918 of 2359 lines)
functions..: 93.9% (400 of 426 functions)
branches...: 32.0% (3029 of 9469 branches)
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I89752e5fcfc1aabb4090b0b2e8faf5f1b5ee5e76
diff --git a/users.hpp b/users.hpp
index 3541625..0f3065e 100644
--- a/users.hpp
+++ b/users.hpp
@@ -97,6 +97,8 @@
*/
bool userEnabled(void) const override;
+ void setUserEnabled(bool value);
+
/** @brief update user enabled state
*
* @param[in] value - bool value