Skip to content

Tests: Add system tests for groupadd in test_groupadd.py - #1695

Merged
ikerexxe merged 4 commits into
shadow-maint:masterfrom
asakure:system_tests_groupadd_25_26_27
Sep 3, 2026
Merged

Tests: Add system tests for groupadd in test_groupadd.py#1695
ikerexxe merged 4 commits into
shadow-maint:masterfrom
asakure:system_tests_groupadd_25_26_27

Conversation

@asakure

@asakure asakure commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Add system tests for groupadd in test_groupadd.py for
existing bash tests with numbering 25, 26, 27.

@asakure
asakure force-pushed the system_tests_groupadd_25_26_27 branch from f34312e to 159959b Compare July 22, 2026 18:34
@asakure
asakure force-pushed the system_tests_groupadd_25_26_27 branch 2 times, most recently from ff1df73 to 9522120 Compare September 1, 2026 10:51
@asakure
asakure marked this pull request as ready for review September 1, 2026 11:22
framework/hosts/shadow.py had a bug in the search pattern
using 'grep'. \s is supposed to mean "whitespace", but without
the -E flag, 'grep' treats \s as a literal backslash followed
by the letter s. Since grep can't find the line, the code fails
to replace the old value.

Signed-off-by: Akshay Sakure <asakure@redhat.com>
Suggested-by: Iker Pedrosa <ipedrosa@redhat.com>
This is Python transformation of the test located in
`tests/grouptools/groupadd/25_groupadd_no_gshadow/groupadd.test`
which checks that `groupadd` succeeds and creates group when
/etc/gshadow file is not present.

Signed-off-by: Akshay Sakure <asakure@redhat.com>
@asakure
asakure force-pushed the system_tests_groupadd_25_26_27 branch from 9522120 to ea2a272 Compare September 2, 2026 11:01
Comment thread tests/system/tests/test_groupadd.py
Comment thread tests/system/tests/test_groupadd.py Outdated
Comment thread tests/system/tests/test_groupadd.py Outdated
@asakure
asakure force-pushed the system_tests_groupadd_25_26_27 branch from ea2a272 to d480442 Compare September 3, 2026 08:43
This is Python transformation of the test located in
`tests/grouptools/groupadd/26_groupadd_-o_without_-g/groupadd.test`
which checks that `groupadd` fails to create group when -o option is
mentioned without -g option.

Signed-off-by: Akshay Sakure <asakure@redhat.com>
This is Python transformation of the test located in
`tests/grouptools/groupadd/27_groupadd_invalid_option/groupadd.test`
which checks that `groupadd` command fails when invalid option is
mentioned.

Signed-off-by: Akshay Sakure <asakure@redhat.com>
@asakure
asakure force-pushed the system_tests_groupadd_25_26_27 branch from d480442 to 8868b1f Compare September 3, 2026 08:49
@asakure
asakure requested a review from ikerexxe September 3, 2026 08:50

@ikerexxe ikerexxe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ikerexxe
ikerexxe merged commit 429f7b6 into shadow-maint:master Sep 3, 2026
16 checks passed
@ikerexxe

ikerexxe commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

I just discovered that FORCE_SHADOW isn't documented anywhere.

@asakure would you like to document it? If you are interested you'd need to do something similar to the changes in 203693c for man/login.defs.5.xml and man/login.defs.d/SUB_GID_STORE_BY_UID.xml

@asakure

asakure commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ikerexxe, I have raised #1730 to document FORCE_SHADOW option in man-page. Do I need to add it in CROSS REFERENCES section as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants