Skip to content

RANGER-4897: Extended the test coverage for XUserRest & RoleRest apis endpoints - #1140

Merged
pradeepagrawal8184 merged 3 commits into
apache:masterfrom
krishnamuttevi:ugmanagement
Aug 6, 2026
Merged

RANGER-4897: Extended the test coverage for XUserRest & RoleRest apis endpoints#1140
pradeepagrawal8184 merged 3 commits into
apache:masterfrom
krishnamuttevi:ugmanagement

Conversation

@krishnamuttevi

Copy link
Copy Markdown
Contributor

Extends the Ranger functional test framework with a generic, suite-driven run-tests.sh runner and adds Pytest coverage for XUserREST and RoleREST Admin APIs.

Refactored run-tests.sh into a reusable orchestration script that any functional test suite can plug into:

Suite registry — ALL_TEST_SUITES lists available Pytest folders; new suites are added by dropping a directory and updating the array

Suite classification — separates test-only suites (rolerest, xuserrest, servicerest) from Docker-backed suites (hdfs, kms) so archives and compose files are started only when needed

Interactive and CLI modes — prompts for DB type and suites, or accepts

./run-tests.sh [db-type] [suite...]

Conditional Docker setup — builds Ranger, brings up the base Admin stack (admin, DB, ZK, Solr, usersync, tagsync, KMS), and optionally adds HDFS/Hadoop compose when requested

Environment controls — CLEAN_CONTAINERS=1 for full clean build; RUN_TESTS=0 for infrastructure-only runs

Generic test execution — loops over requested suites, runs pytest on each existing directory, and generates report_<suite>.html per suite

Pytest suite for Ranger Admin XUserRest APIs:

test_user.py — user CRUD, role assignments, external users
test_secure_user.py — secure user CRUD and RBAC
test_groups.py — group and group-user management
test_permission.py — module permissions
test_ugsync.py — user/group sync (LDAP, UNIX, FILE)
test_utility_fun.py — lookup, auth sessions, userstore download
Includes shared conftest.py, utility/utils.py, and readme.md.

Pytest suite for Ranger Admin RoleRest APIs:

test_role_management.py — role CRUD, lookup, service-admin access paths
test_role_utility_fun.py — export/import, secure download, membership, grant/revoke
Includes role-specific utilities, fixtures, and readme.md.

Other changes

pytest.ini — adds xuserrest, rolerest, and HTTP method markers
functional-tests/readme.md — documents suites, env vars, usage, and reports

@krishnamuttevi
krishnamuttevi marked this pull request as ready for review August 6, 2026 07:19
@pradeepagrawal8184
pradeepagrawal8184 self-requested a review August 6, 2026 11:56
@pradeepagrawal8184
pradeepagrawal8184 merged commit a03fc5c into apache:master Aug 6, 2026
4 checks passed
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.

3 participants