Skip to content

[quality] Add bats tests for ublue-privileged-setup #562

Description

@clubanderson

Finding

system_files/shared/usr/bin/ublue-privileged-setup has zero test coverage despite handling privileged hook execution. It shares the exact same get_config + hooks-directory pattern as ublue-system-setup and ublue-user-setup, both of which already have bats tests in tests/test_setup_scripts.bats.

The script reads config, resolves a hooks directory, and executes all scripts within it — any regression here affects privileged system operations.

Recommendation

Add a new section to tests/test_setup_scripts.bats (or a dedicated test_privileged_setup.bats) covering:

  1. get_config returns fallback when config file is missing
  2. get_config reads the privileged-hooks-directory value from JSON
  3. Hooks in the directory are executed
  4. Exits cleanly when hooks directory is missing
  5. HOOKS_VERBOSE=true enables set -x (verify via stderr output)

This mirrors the existing test patterns for ublue-system-setup and ublue-user-setup.

Priority

  • Impact: high — untested privileged execution path
  • Effort: low — existing test patterns can be directly reused

Filed by quality agent (hold-gated mode)

Common · issue pipeline

  ▶  triage     needs kind/ + area/ then /approve
  ·  discussing —
  ·  queued     —
  ·  claimed    —
  ·  done       —

area: —   priority:
maintainer: set kind/ + area/ labels, then comment /approve
reporter: answer questions; add repro steps if a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    1-triageNew work awaiting human triage.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions