Fix flaky usermod test - apparently even tests need AC these days#1677
Conversation
|
hmmm maybe the problem is not that exact test, but the last test in the list |
|
@hallyn I fear we'll need your help to investigate why the last test in |
|
I see |
|
I can reproduce it on my laptop, though I don't yet get it. I'll look into it. |
|
Bah. Looks like a change in whereas in the past, if it couldn't find the group name, it would not give the (number) for gid and groups. |
|
So the following patch Fixes the first failure. |
|
The second test failure seems to be pointing to a real bug in SUB_UID_MIN handling. |
Hummm, would you be able to bisect it?
Where/when was this changed? It'd be interesting to note it in the commit message. |
|
It worked as of d7164fc, so this should be bisectable. |
(I'm keeping the running log because about to be out of battery) |
Not sure, but i can verify that in ubuntu 22.04 it does not show that, while |
|
Anyway the simplest thing for that is to just add a group name in the config/etc/group file for the test. |
|
I notice that useradd from master branch does not create a subuid entry for new users. useradd from 26.04 ubuntu version correctly does. It does look at /etc/login.defs, presumably looking for SUB_UID_MIN. I suspect this is related. Also, we should probably have a regression test for subuid creation (both to make sure it gets created hwen it should and that it doesn't when it shouldn't). |
|
So, not related. src/useradd.c 2574 #ifdef ENABLE_SUBIDS should_assign_subuid() uses user_id, but thta doesn't get assigned until line 2639. |
|
@ikerexxe I've pushed two patches to your branch. So if you're making more changes , please pull before. |
…entary group Transform first test case from `tests/usertools/62_usermod_remove_supplementary_groups/usermod.test` to Python framework. Tests `usermod -rG` functionality to remove a user from an existing supplementary group while preserving membership in other groups. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
…oup they don't belong to Transform second test case from `tests/usertools/62_usermod_remove_supplementary_groups/usermod.test` to Python framework. Tests `usermod -rG` graceful handling when attempting to remove a user from a supplementary group they're not actually a member of. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Remove the original shell based test `tests/usertools/62_usermod_remove_supplementary_groups/` and its references from test runner scripts. The test was failing intermittently and has been successfully transformed to Python framework with improved reliability. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Fix src/new_subid_range.c, which is only used by this test case. It was not honoring the SUB_UID_MIN in login.defs. Then fix the testcase's expected end results. Signed-off-by: Serge Hallyn <serge@hallyn.com>
Historically, if a user is a member of a group with no name, id(1) would show that as 424243, not 424243(424243). But id(1) from the rust based uutils prints that group number. Rather than try to guess at the parsing, just add the group name in the testcases's group file, and expect 424243(testsuite). Signed-off-by: Serge Hallyn <serge@hallyn.com>
806175d to
684c744
Compare
The
test_62_usermod_remove_supplementary_groupsshell test was failing intermittently (apparently the heat is affecting this one too). Transformed it to Python framework for better reliability.I have added two focused tests in
test_usermod.pycovering both normal and edge case scenarios. I have removed the original flaky shell test and runner script references.