#!/usr/bin/env bash
# Mock `groupadd` for the ROOT-mode suite (first_time_setup_test.sh), where
# linux.sh's `first-time-setup` runs privileged commands DIRECTLY (as root,
# under pkexec or sudo) instead of through `sudo`. Logs the argv to
# $SONOMOS_TEST_ROOT_LOG and changes nothing. Only that suite puts this
# directory on PATH (ahead of mock-bin/, whose groupadd is a tripwire).
[ -n "${SONOMOS_TEST_ROOT_LOG:-}" ] && printf 'groupadd %s\n' "$*" >> "$SONOMOS_TEST_ROOT_LOG"
exit "${SONOMOS_TEST_GROUPADD_EXIT:-0}"
