From 7fe3fd48a5c9b1a082cb5d3a4da4469fd5666382 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Mon, 17 Dec 2018 18:11:06 +0000 Subject: [PATCH] audit(4) tests: require /etc/rc.d/auditd These tests should be skipped if /etc/rc.d/auditd is missing, which could be the case if world was built with WITHOUT_AUDIT set. Also, one test case requires /etc/rc.d/accounting. Submitted by: ngie MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd/pull/240 --- tests/sys/audit/Makefile | 1 + tests/sys/audit/administrative.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/sys/audit/Makefile b/tests/sys/audit/Makefile index c1259167b972..6f70121da14f 100644 --- a/tests/sys/audit/Makefile +++ b/tests/sys/audit/Makefile @@ -49,6 +49,7 @@ SRCS.miscellaneous+= utils.c TEST_METADATA+= timeout="30" TEST_METADATA+= required_user="root" TEST_METADATA+= is_exclusive="true" +TEST_METADATA+= required_files="/etc/rc.d/auditd" WARNS?= 6 diff --git a/tests/sys/audit/administrative.c b/tests/sys/audit/administrative.c index 8e16ee96bd1c..4ec73f4710e0 100644 --- a/tests/sys/audit/administrative.c +++ b/tests/sys/audit/administrative.c @@ -377,6 +377,8 @@ ATF_TC_HEAD(acct_success, tc) { atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " "acct(2) call"); + atf_tc_set_md_var(tc, "require.files", + "/etc/rc.d/accounting /etc/rc.d/auditd"); } ATF_TC_BODY(acct_success, tc)