diff options
| author | Tom Joseph <tomjoseph@in.ibm.com> | 2018-11-19 09:49:21 +0530 |
|---|---|---|
| committer | Tom Joseph <tomjoseph@in.ibm.com> | 2018-11-20 09:45:55 +0530 |
| commit | f5bd891cf5afb30085d1a5e93d86bd022c097238 (patch) | |
| tree | 426c12cf2da3825056392426114aa3b919acde23 /phosphor-ldap-mapper/ldap_mapper_entry.cpp | |
| parent | 23886efd0780cd6c87741a9ecac2d55d9ab4c7a8 (diff) | |
| download | phosphor-user-manager-f5bd891cf5afb30085d1a5e93d86bd022c097238.tar.gz phosphor-user-manager-f5bd891cf5afb30085d1a5e93d86bd022c097238.zip | |
Refactor mapper application to enable unit tests
Change-Id: I58cac8879f93ce49bfb654a1bf559d7f77b5b486
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Diffstat (limited to 'phosphor-ldap-mapper/ldap_mapper_entry.cpp')
| -rw-r--r-- | phosphor-ldap-mapper/ldap_mapper_entry.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/phosphor-ldap-mapper/ldap_mapper_entry.cpp b/phosphor-ldap-mapper/ldap_mapper_entry.cpp index 95f381d..8410942 100644 --- a/phosphor-ldap-mapper/ldap_mapper_entry.cpp +++ b/phosphor-ldap-mapper/ldap_mapper_entry.cpp @@ -20,12 +20,13 @@ using InvalidArgument = using Argument = xyz::openbmc_project::Common::InvalidArgument; LDAPMapperEntry::LDAPMapperEntry(sdbusplus::bus::bus &bus, const char *path, + const char *filePath, const std::string &groupName, const std::string &privilege, LDAPMapperMgr &parent) : Ifaces(bus, path, true), id(std::stol(std::experimental::filesystem::path(path).filename())), - manager(parent) + manager(parent), persistPath(filePath) { Ifaces::privilege(privilege, true); Ifaces::groupName(groupName, true); @@ -33,10 +34,10 @@ LDAPMapperEntry::LDAPMapperEntry(sdbusplus::bus::bus &bus, const char *path, } LDAPMapperEntry::LDAPMapperEntry(sdbusplus::bus::bus &bus, const char *path, - LDAPMapperMgr &parent) : + const char *filePath, LDAPMapperMgr &parent) : Ifaces(bus, path, true), id(std::stol(std::experimental::filesystem::path(path).filename())), - manager(parent) + manager(parent), persistPath(filePath) { } @@ -54,7 +55,7 @@ std::string LDAPMapperEntry::groupName(std::string value) manager.checkPrivilegeMapper(value); auto val = Ifaces::groupName(value); - serialize(*this, id); + serialize(*this, id, persistPath); return val; } @@ -67,7 +68,7 @@ std::string LDAPMapperEntry::privilege(std::string value) manager.checkPrivilegeLevel(value); auto val = Ifaces::privilege(value); - serialize(*this, id); + serialize(*this, id, persistPath); return val; } |

