Skip to content

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

Open
asakure wants to merge 2 commits into
shadow-maint:masterfrom
asakure:system_tests_groupadd_12_13
Open

Tests: Add system tests for groupadd in test_groupadd.py#1669
asakure wants to merge 2 commits into
shadow-maint:masterfrom
asakure:system_tests_groupadd_12_13

Conversation

@asakure

@asakure asakure commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Add system tests for groupadd in test_groupadd.py for
existing bash tests with numbering 12, 13.

@asakure
asakure force-pushed the system_tests_groupadd_12_13 branch 3 times, most recently from f8a7f20 to ffe99ca Compare July 9, 2026 08:43
@asakure
asakure marked this pull request as draft July 9, 2026 08:45
@asakure
asakure force-pushed the system_tests_groupadd_12_13 branch 2 times, most recently from c1d5b6b to b40e14e Compare July 20, 2026 10:05
@asakure
asakure marked this pull request as ready for review July 21, 2026 08:29

@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.

Just some minor thing to improve

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_12_13 branch from b40e14e to b363680 Compare July 21, 2026 12:25
@asakure
asakure requested a review from ikerexxe July 21, 2026 12:26
@asakure
asakure force-pushed the system_tests_groupadd_12_13 branch 2 times, most recently from 8a771b1 to e80a7b5 Compare July 30, 2026 14:08

@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.

I just noticed that test 11 and 12 check the GID, while test 13 checks the group name. I'd prefer to keep those separated. Sorry for the confusion.



@pytest.mark.topology(KnownTopology.Shadow)
def test_groupadd__invalid_gid(shadow: Shadow):

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.

I'd keep the original name

Comment thread tests/system/tests/test_groupadd.py Outdated
Comment on lines +242 to +243
pytest.param("-g 1001x tgroup", "tgroup", id="invalid_gid"),
pytest.param("-g -1001 tgroup", "tgroup", id="negative_gid"),

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.

For the first argument you should only parametrize the GID (i.e. 1001x, -1001). You don't need to parametrize the second argument, it's always tgroup. The third argument is fine

asakure added 2 commits July 30, 2026 22:40
This is Python transformation of the test located in
`tests/grouptools/groupadd/12_groupadd_negative_GID/groupadd.test`
which checks that `groupadd` fails to create group with invalid GID
using -g flag. It also converts Bash tests 11 and 12 into a single
parametrized Python test.

Signed-off-by: Akshay Sakure <asakure@redhat.com>
This is Python transformation of the test located in
`tests/grouptools/groupadd/13_groupadd_invalid_name/groupadd.test`
which checks that `groupadd` fails to create group when invalid
name is specified.

Signed-off-by: Akshay Sakure <asakure@redhat.com>
@asakure
asakure force-pushed the system_tests_groupadd_12_13 branch from e80a7b5 to aa350e2 Compare July 30, 2026 17:20
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