#!/bin/bash
set -ex

. tests/lib

prep_tmp
prep_cuser
prep_config_t_env games /etc/userv

: '---------- test service invocation ----------'

really -u $cuser \
userv games userv-t-env >"$tmp"/env

check_expected_env "$tmp"/env

: '---------- test rejection (wrong calling user) ----------'

expect_output 255 '' \
really -u daemon \
userv games userv-t-env


echo ok.
