Imported Upstream version 20081130
[ltp-debian.git] / testcases / audit-test / Makefile
blobd4bf1595e2f49e6090190779211c32767ca03b0b
1 ###############################################################################
2 # Copyright (C) International Business Machines Corp., 2003
3 # (c) Copyright Hewlett-Packard Development Company, L.P., 2005
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of version 2 the GNU General Public License as
7 # published by the Free Software Foundation.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ###############################################################################
18 TOPDIR = .
20 include $(TOPDIR)/rules.mk
22 RUN_DIRS = syscalls \
23 network
25 ifeq ($(MODE), $(NATIVE))
26 RUN_DIRS += fail-safe \
27 filter \
28 audit-trail-protection \
29 audit-tools \
30 libpam \
31 trustedprograms
32 endif
34 SUB_DIRS = $(RUN_DIRS) \
35 utils
37 run:
38 @for l in run rollup; do \
39 echo "audit.$$l.log will be collected from subdirectories when the test completes" >audit.$$l.log; \
40 done
41 @$(check_set_PPROFILE); \
42 $(check_set_PASSWD); \
43 $(check_set_LBLNET_SVR_IPV4); \
44 $(check_set_LBLNET_SVR_IPV6); \
45 $(MAKE) all && \
46 for x in $(RUN_DIRS); do make -C $$x run; done
47 $(MAKE) report
49 .PHONY: dist
50 dist:
51 deps=$$($(MAKE) --no-print-directory showrpms | xargs) && \
52 rev=$$(svn info | awk '/^Revision:/{print $$2}' | grep .) && \
53 tmpdir=$$(mktemp -d) && \
54 into=$${PWD%/*} && \
55 sed -i "/^Version:/s/[0-9].*/$$rev/; \
56 s/^\(Requires:[ ]*\).*/\1$$deps/" \
57 audit-test.spec && \
58 mkdir "$$tmpdir/audit-test" && \
59 rsync -a --exclude=.svn . "$$tmpdir/audit-test" && \
60 $(MAKE) distclean -C "$$tmpdir/audit-test" && \
61 cd "$$tmpdir" && \
62 chmod -R a+rX audit-test && \
63 tar czf "$$into/audit-test-$$rev.tar.gz" audit-test && \
64 cd "$$into" && \
65 rm -rf "$$tmpdir" && \
66 echo && \
67 ls -l audit-test-$$rev.tar.gz
69 .PHONY: report
70 report:
71 @# tty output has color, generated logs don't, so collect them
72 @# instead of redirecting output of the above loop.
73 @for l in run rollup; do \
74 ( utils/run.bash --header; echo ) &> audit.$$l.log; \
75 for x in $(RUN_DIRS); do \
76 echo; \
77 echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"; \
78 printf "::: %-52s :::\n" "$$x"; \
79 echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"; \
80 echo; \
81 cat $$x/$$l.log; \
82 done &> audit.$$l.log; \
83 done
84 utils/tally-results.awk < audit.rollup.log \
85 | tee -a audit.run.log | tee -a audit.rollup.log
87 .PHONY: rpm
88 rpm: dist
89 rev=$$(svn info | awk '/^Revision:/{print $$2}' | grep .) && \
90 cd .. && \
91 rpmbuild -ta audit-test-$$rev.tar.gz && \
92 mv /usr/src/redhat/RPMS/noarch/audit-test-$$rev-1.* . && \
93 mv /usr/src/redhat/SRPMS/audit-test-$$rev-1.* . && \
94 echo && \
95 ls -l audit-test-$$rev-1.*
97 .PHONY: policy
98 policy:
99 cd utils/selinux-policy && \
100 $(MAKE) clean && \
101 $(MAKE) && \
102 $(MAKE) install && \
103 $(MAKE) relabel
105 .PHONY: netconfig
106 netconfig:
107 cd network/system && $(MAKE) install
108 cd utils/network-server && $(MAKE) install