dirless-test-data v0.1.0

Load-test driver and test-user fixtures for Dirless

dirless-test-data

Load-testing and test-fixture tooling for the Dirless platform.

File Purpose
gen_test_users.cr Generate a synthetic set of test users → test-users.toml.
test-users.toml ~1000 generated test users used as load-test input.
provision_test_users.cr Push the test users into a customer backend.
load_test.cr NSS load-test driver — builds the load-test binary.

Build

shards install
crystal build load_test.cr --release --static -o load-test

dirless-infra builds the load-test binary from this repo via just build-load-test (mounts this repo into the builder container), and ansible/load-test.yml reads test-users.toml from here.

Usage

1. Generate test fixtures

Creates a test-users.toml with synthetic users, groups, and memberships. The bundled test-users.toml was generated with defaults (1000 users, 75 groups).

# Default: 1000 users, 75 groups, ~10 members per group
crystal run gen_test_users.cr

# Custom scale
crystal run gen_test_users.cr -- --users 5000 --groups 200 --avg-per-group 15

# Reproducible output (fixed seed)
crystal run gen_test_users.cr -- --seed 42 --output my-users.toml

2. Provision test users into AWS IAM Identity Center

Reads the TOML and creates the users/groups/memberships in Identity Center. Idempotent — safe to re-run after a partial failure.

export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export IDENTITY_STORE_ID=d-1234567890

# Dry run first to see what would be created
crystal run provision_test_users.cr -- --dry-run test-users.toml

# Actually provision
crystal run provision_test_users.cr -- test-users.toml

# Different region, throttled to 2 calls/s
crystal run provision_test_users.cr -- --region us-west-2 --rate 2 test-users.toml

3. Run the NSS load test

Hammers the local NSS stack (getent/id) on an enrolled host. Run this on the test node after the dirless-agent is installed and synced.

# 60s run with defaults (nproc workers, 10% miss rate, 5% enumerations)
./load-test test-users.toml

# Longer run with more workers
./load-test --duration 120 --workers 8 test-users.toml

# Tune miss rate and enumeration percentage
./load-test --duration 60 --miss-rate 20 --enum-pct 10 test-users.toml

Output is a per-category latency table (p50/p95/p99/max in ms) printed to stderr:

Running 4 workers for 60s  (miss-rate=10%  enum-pct=5%)
────────────────────────────────────────────────────────────
   10s    4823 req     0 failures  482.3 req/s
   ...
════════════════════════════════════════════════════════════
RESULTS  28941 requests in 60.0s  (482.4 req/s)
Failures: 0 (0.00%)

  type                    count    p50ms    p95ms    p99ms    maxms
  ----------------------------------------------------------
  getpwnam (hit)           8230      1.2      3.1      5.4     22.1
  getpwnam (miss)          2890      0.9      2.4      4.1     18.3
  getgrnam (hit)           8198      1.1      2.9      5.1     19.7
  ...

Via Ansible (runs the test remotely on the test node):

ansible-playbook -i ansible/inventory/aws_ec2.yml ansible/load-test.yml
ansible-playbook -i ansible/inventory/aws_ec2.yml ansible/load-test.yml \
  -e duration=120 -e workers=4
Repository

dirless-test-data

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 1
  • about 3 hours ago
  • June 14, 2026
License

Other

Links
Synced at

Sun, 14 Jun 2026 17:07:07 GMT

Languages