Files
rustfs/crates/e2e_test/src/policy
Zhengchao An 22741603f5 test(e2e): finish the helper consolidation onto common.rs (#6766)
- common.rs gains an AdminTransport knob (Signed | Awscurl) with admin_execute_at plus three family wrappers: admin_create_user_via, admin_add_canned_policy_via, admin_attach_user_policy_via; the existing admin_create_user now delegates over the Signed transport.
- Deleted the four signed admin request clones in admin_mfa_test, admin_auth_test, reliant/tiering, and inline_fast_path_cluster_test; each keeps a thin local wrapper over common::admin_request so call sites keep their Option<&str> body shape.
- Deduped the notification_webhook signer onto common::signed_request and the webdav_core signer plus its three admin helpers onto the shared _via helpers.
- Consolidated the S3-client-with-credentials builders: admin_auth s3_client_with, existing_object_tag user_client/sts_session_client, bucket_policy_check create_user_client, and the create_user_s3_client copies in group_delete_test and replication_extension_test now delegate to create_s3_client_with_credentials / build_test_s3_config; replication_extension admin_add_canned_policy and admin_attach_policy_to_user route through the _via helpers on the Signed transport.
- The awscurl-gated suites (existing_object_tag_policy, bucket_policy_check, policy/policy_variables) keep going through the external awscurl binary via AdminTransport::Awscurl, preserving their wire behavior.

Part of rustfs/backlog#1846 (cluster 2).
2026-08-28 00:12:45 +00:00
..

RustFS Policy Variables Tests

This directory contains comprehensive end-to-end tests for AWS IAM policy variables in RustFS.

Test Overview

The tests cover the following AWS policy variable scenarios:

  1. Single-value variables - Basic variable resolution like ${aws:username}
  2. Multi-value variables - Variables that can have multiple values
  3. Variable concatenation - Combining variables with static text like prefix-${aws:username}-suffix
  4. Nested variables - Complex nested variable patterns like ${${aws:username}-test}
  5. Deny scenarios - Testing deny policies with variables
  6. STS credentials - Variable resolution inherited by temporary credentials

Prerequisites

  • awscurl utility for admin API calls
  • AWS SDK for Rust (included in the project)

Running Tests

Run All Policy Tests

# From the project root directory
cargo test -p e2e_test policy:: -- --nocapture

Each test starts an isolated RustFS server on a dynamically allocated local port and cleans it up afterward.