From c32334186d3bbad313db26d475c186c756db67ca Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 26 Dec 2021 00:47:44 +0000 Subject: [PATCH] autopkgtests: Test user rc file Signed-off-by: Ian Jackson --- debian/tests/control | 5 +++++ tests/t-userconfig | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 tests/t-userconfig diff --git a/debian/tests/control b/debian/tests/control index e5bae1e..e779eba 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -7,3 +7,8 @@ Tests: t-config Depends: @, bash, chiark-really Tests-Directory: tests Restrictions: isolation-container, allow-stderr, needs-root, breaks-testbed + +Tests: t-userconfig +Depends: @, bash, chiark-really +Tests-Directory: tests +Restrictions: isolation-container, allow-stderr, needs-root, breaks-testbed diff --git a/tests/t-userconfig b/tests/t-userconfig new file mode 100755 index 0000000..4487aa2 --- /dev/null +++ b/tests/t-userconfig @@ -0,0 +1,30 @@ +#!/bin/bash +set -ex + +. tests/lib + +prep_tmp +prep_cuser + +mkdir ~root/.userv +cat >~root/.userv/rc <"$tmp"/env + +check_expected_env "$tmp"/env + +: '---------- test rejection (wrong calling user) ----------' + +expect_output 255 '' \ +really -u daemon \ +userv root userv-t-env + + +echo ok. -- 2.30.2