History log of /openbmc/phosphor-user-manager/ (Results 51 – 75 of 193)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
6b6f2d8024-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

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 previ

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

show more ...

784aecd424-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

accountUnlockTimeout: add unit test

This commit added several unit tests for the |accountUnlockTimeout|
function.

Tested: unit test passed

Coverage:
lines......: 80.7% (1874 of 2323 lines)
fun

accountUnlockTimeout: add unit test

This commit added several unit tests for the |accountUnlockTimeout|
function.

Tested: unit test passed

Coverage:
lines......: 80.7% (1874 of 2323 lines)
functions..: 93.7% (387 of 413 functions)
branches...: 32.2% (2930 of 9096 branches)

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I1dfb134d54f4086920f41c9020104e64af71f1f9

show more ...

cfabe6b324-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

MaxLoginAttemptBeforeLockout: add unit test

This commit adds the unit test for |maxLoginAttemptBeforeLockout|.

Tested: unit test passed.

Coverage:
lines......: 80.0% (1843 of 2304 lines)
funct

MaxLoginAttemptBeforeLockout: add unit test

This commit adds the unit test for |maxLoginAttemptBeforeLockout|.

Tested: unit test passed.

Coverage:
lines......: 80.0% (1843 of 2304 lines)
functions..: 93.3% (374 of 401 functions)
branches...: 32.3% (2893 of 8961 branches)

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I840dc472d6ac9d58273aaf754195e33276ea139f

show more ...

a6ce1faa24-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

rememberOldPasswordTimes: add unit test

This commit adds several test cases for |rememberOldPasswordTimes|.

Tested: unit test passed.

Overall coverage rate:
lines......: 79.2% (1809 of 2283 line

rememberOldPasswordTimes: add unit test

This commit adds several test cases for |rememberOldPasswordTimes|.

Tested: unit test passed.

Overall coverage rate:
lines......: 79.2% (1809 of 2283 lines)
functions..: 92.8% (361 of 389 functions)
branches...: 32.4% (2852 of 8814 branches)

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Iea033026b79a81d67dfb3d513eb951b0b6cb21b6

show more ...

1803101c10-Nov-2022 Nan Zhou <nanzhoumails@gmail.com>

MinPasswordLength: add unit test

Add unit test for the |minPasswordLength| function.

It can be shown that the test coverage increased.

Tested: unit test passed.

Coverage data:
lines......: 78.7

MinPasswordLength: add unit test

Add unit test for the |minPasswordLength| function.

It can be shown that the test coverage increased.

Tested: unit test passed.

Coverage data:
lines......: 78.7% (1779 of 2261 lines)
functions..: 92.3% (348 of 377 functions)
branches...: 32.5% (2812 of 8655 branches)

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I85d309ac2cf1467ee1c56c6ecb076d82c5082e28

show more ...

4bc6981024-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

user_mgr: move constructor codes to separate func

Rafactorred the code so that the AccountPolicy part is moved into a
separate function out of the constructor. This is alligned with
existing code: |

user_mgr: move constructor codes to separate func

Rafactorred the code so that the AccountPolicy part is moved into a
separate function out of the constructor. This is alligned with
existing code: |initUserObject|.

Tested: code moving only.

Before this serial of code, coverage is
lines......: 61.7% (1217 of 1973 lines)
functions..: 77.9% (173 of 222 functions)
branches...: 32.2% (1852 of 5746 branches)

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I83fdc79a12c64039217605ed65def2f2352d7ef6

show more ...

fef6303824-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

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

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

show more ...

f25443e824-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

renameUser: add unit test

Like the previous change, this test added unit test for |renameUser|. To
make it happen, this commit introduces a virtual function
|executeUserModify| which is overridden i

renameUser: add unit test

Like the previous change, this test added unit test for |renameUser|. To
make it happen, this commit introduces a virtual function
|executeUserModify| which is overridden in unit test (see previous
change for why we need such overriding).

Tested: unit test passed.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I230a8c12fd6c86d0fccfc00872eff647473c1e94

show more ...

ecf8876824-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

ThrowForInvalidGroups: add unit test

This commit adds unit test for the |throwForInvalidGroups| function.

Tested: unit test passed

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I6c00

ThrowForInvalidGroups: add unit test

This commit adds unit test for the |throwForInvalidGroups| function.

Tested: unit test passed

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I6c004dde1e3a27f60ee7de5cb1775940e19fffc8

show more ...

589aeb4424-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

ThrowForInvalidPrivilege: add unit test

This commit adds unit test for the |throwForInvalidPrivilege| function.

Tested: unit test passed

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id:

ThrowForInvalidPrivilege: add unit test

This commit adds unit test for the |throwForInvalidPrivilege| function.

Tested: unit test passed

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I0722ce2483adeffd493528c9c952aea9af181de6

show more ...

49c8136424-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

user add/delete: add unit tests

This commit adds the test infrastructure such that we are able to
manipulate groups and users inside the unit test container.

To make it happen, the following change

user add/delete: add unit tests

This commit adds the test infrastructure such that we are able to
manipulate groups and users inside the unit test container.

To make it happen, the following changes are made:
1. executeCmd was moved to header
2. made the two userDelete and userAdd function virtual; this is needed
since on BMC the daemon is run as root by default; however on unit test
container, it's run as the current user on VMs. Thus in the unit test,
these two functions are overridden to dummy commands.

It can be shown that the unit test coverage increases a lot.

Tested: unit test pasesd

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I7be636d8acd487242831d1c74941e848e508b8f9

show more ...

40e4497924-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

name constraint check: add unit tests

This commit adds unit test for |ThrowForUserNameConstraints|. All lines
are covered by test now.

Tested: unit test passed

Signed-off-by: Nan Zhou <nanzhoumail

name constraint check: add unit tests

This commit adds unit test for |ThrowForUserNameConstraints|. All lines
are covered by test now.

Tested: unit test passed

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: If1a0ff823ca0767f068030f205efdc1eb33e3029

show more ...

8a11d99824-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

user exist: simplify expression, add unit test

Simplified two boolean expression and added unit tests. The unit test
container has the root user by default and can be leveraged in the unit
test.

Te

user exist: simplify expression, add unit test

Simplified two boolean expression and added unit tests. The unit test
container has the root user by default and can be leveraged in the unit
test.

Tested: unit test passed.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ia335ad9e14e5cdeca5c260ef67f308f7197be349

show more ...

e48085db24-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

PamModuleArgValue: add unit test coverage

This commit refactorred the codes such that it becomes possible to unit
test the two non-trivial method: setPamModuleArgValue and
getPamModuleArgValue.

The

PamModuleArgValue: add unit test coverage

This commit refactorred the codes such that it becomes possible to unit
test the two non-trivial method: setPamModuleArgValue and
getPamModuleArgValue.

The unit test manipulates temporary files in the unit test container
instead of real pam configs.

Check the coverage data before and after this commit to see how these
two files now get nearly 100% unit test coverage.

Tested: unit test.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ibad461ace0eae89183de0ddbfb189ee0458b1d2e

show more ...

332fb9dc24-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

RemoveStringFromCSV: add unit test

Tested: only added a unit test and it passed.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: If68e47545f184b9fa22d701e78fb15b2b1b7949f

e47c09d324-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

getCSVFromVector: optimize and add tests

Optimization: avoid copy; simpifiled unnessary branches; reduced
temperary string being created when doing string concatenation.

Added unit test for this fu

getCSVFromVector: optimize and add tests

Optimization: avoid copy; simpifiled unnessary branches; reduced
temperary string being created when doing string concatenation.

Added unit test for this function.

Tested: unit test

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I8c334dc4f087e262bb3e8613e86cfc2a93d525a0

show more ...

c5382dbf19-Sep-2022 Nan Zhou <nanzhoumails@gmail.com>

main: use process loop

In reference [1], sdbusplus introduces its own process loop. This patch
uses the sdbusplus built-in process loop instead of writing our own
loop.

[1] https://gerrit.openbmc.o

main: use process loop

In reference [1], sdbusplus introduces its own process loop. This patch
uses the sdbusplus built-in process loop instead of writing our own
loop.

[1] https://gerrit.openbmc.org/c/openbmc/sdbusplus/+/56891

Tested: the local user manager daemon is working correct on QEMU.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I7fc51b463a0c02be707f5778ceba40087af8e131

show more ...

0b6b801324-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

build tool: remove autotools

Meson is fully working now, remove autotools completely. See
[1] https://gerrit.openbmc.org/c/openbmc/openbmc/+/56842

Tested: see testing performed in the recipe change

build tool: remove autotools

Meson is fully working now, remove autotools completely. See
[1] https://gerrit.openbmc.org/c/openbmc/openbmc/+/56842

Tested: see testing performed in the recipe change.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I679e085cbc1bc59421781fe54e33b1813ef166a1

show more ...


0a26a4fb29-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

gitlint: check commit message

Check commit message when running CI for this project.

Reference:
[1] https://github.com/openbmc/openbmc-build-scripts/blob/fb9948a3a859500188e468d4f247b13687f3fefb/sc

gitlint: check commit message

Check commit message when running CI for this project.

Reference:
[1] https://github.com/openbmc/openbmc-build-scripts/blob/fb9948a3a859500188e468d4f247b13687f3fefb/scripts/format-code.sh#L30

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I66b14e41d1fdfc8201e699a23e43da43073c6475

show more ...

78d8504229-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

clang-tidy: enable clang-tidy

Enable the first check: readability-identifier-naming

Also fixed all check failures.

Tested:
1. compiles, no clang-tidy failures
2. the two daemons work correctly on

clang-tidy: enable clang-tidy

Enable the first check: readability-identifier-naming

Also fixed all check failures.

Tested:
1. compiles, no clang-tidy failures
2. the two daemons work correctly on hardware regarding DBus APIs

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ic415e857726e8f521c1d61a3e7f0c85121c0d284

show more ...

f3fb77c029-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

treewide: make code compie on clang

This patch fixed several minor issues that clang14 complains about.

1. clang-diagnostic-inconsistent-missing-override
2. clang-diagnostic-defaulted-function-dele

treewide: make code compie on clang

This patch fixed several minor issues that clang14 complains about.

1. clang-diagnostic-inconsistent-missing-override
2. clang-diagnostic-defaulted-function-deleted
3. clang-diagnostic-unused-const-variable

Tested:
1. it builds with clang14
2. tested on hardware, ldap config daemon and user manager daemon are
both good. Tested DBus APIs (e.g., create config) as well.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Idf8d0481fc05735b4b3d021f30aa44272f2369bf

show more ...

745ce2ed31-May-2022 Jiaqing Zhao <jiaqing.zhao@intel.com>

Check LDAP group name after PrivilegeMapperEntry fully parsed

Current code checks if the LDAP group name matches when looping through
the PrivilegeMapperEntry interface. When GroupName is parsed fir

Check LDAP group name after PrivilegeMapperEntry fully parsed

Current code checks if the LDAP group name matches when looping through
the PrivilegeMapperEntry interface. When GroupName is parsed first, it
may assign a wrong Privilege value to the group. This patch fixes such
issue by checking the LDAP group name after a mapping entry is fully
parsed, and also exits the loop after match to improve performance.

Tested:
Verified correct group privilege is returned when multiple mapping
entries are configured.

Change-Id: I4795e3f1f974624bb2b46c40ccd729e259512ce4
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>

show more ...

69570e5e07-Jun-2022 Jiaqing Zhao <jiaqing.zhao@intel.com>

Set default shell to /bin/sh for ldap users

Change the default shell of ldap users to /bin/sh to make it consistent
with local users.

Tested:
* `getent.ldap passwd` shows the default shell is /bin/

Set default shell to /bin/sh for ldap users

Change the default shell of ldap users to /bin/sh to make it consistent
with local users.

Tested:
* `getent.ldap passwd` shows the default shell is /bin/sh

Change-Id: I3f8071172e20be54c46df2717e005c25f9da19a1
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>

show more ...

1db5c73e29-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

gitignore: optimize items

1. explicitly enumerate indirect wrap files so they are ignored
2. add a missing test target via autoconf
3. add devtool modify files

Tested: local files on my workstation

gitignore: optimize items

1. explicitly enumerate indirect wrap files so they are ignored
2. add a missing test target via autoconf
3. add devtool modify files

Tested: local files on my workstation are ingored correctly

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I73b2fd1e8e91d7147c27bbf9bbcc970255dac6ac

show more ...

0076afe129-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

meson: fix the missing root mfg flag

The existing meson support missed this root mfg config so that root user
is bypassed. This patch fixed it.

After this change, Redfish/IPMI tests on meson built

meson: fix the missing root mfg flag

The existing meson support missed this root mfg config so that root user
is bypassed. This patch fixed it.

After this change, Redfish/IPMI tests on meson built pacakge starts
working.

Tested:
1. QEMU tests all pass
2. Tested on real hardware, user-manager creats the root user upon
startup. I don't have ldap server but I tested the ldap config APIs
which worked fine.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I57cd2829bc952d8062709b715c88a8efe02c349c

show more ...

12345678