updateGroupsAndPriv: fix bugs and add tests
This commit adds a unit test for the |updateGroupsAndPriv| function.
Thanks to the test case, I found a bug that the exsting codes don't
updat the groups and privilege of the user after updating.
Added several neccessary functions to add unit test and fix bugs.
Tested: unit test passed.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ifcf88505f10b6bfdcca2de31a29ce055153463e8
diff --git a/users.cpp b/users.cpp
index 8906769..7957482 100644
--- a/users.cpp
+++ b/users.cpp
@@ -94,6 +94,16 @@
return UsersIface::userPrivilege(value);
}
+void Users::setUserPrivilege(const std::string& value)
+{
+ UsersIface::userPrivilege(value);
+}
+
+void Users::setUserGroups(const std::vector<std::string>& groups)
+{
+ UsersIface::userGroups(groups);
+}
+
/** @brief list user privilege
*
*/