selinux-policy/tools/buildtest.sh

47 lines
1.1 KiB
Bash
Raw Normal View History

2005-10-19 21:20:07 +00:00
#!/bin/bash
2005-12-07 16:42:33 +00:00
DISTROS="redhat gentoo debian suse"
2005-10-19 21:20:07 +00:00
TYPES="strict strict-mls strict-mcs targeted targeted-mls targeted-mcs"
POLVER="`checkpolicy -V |cut -f 1 -d ' '`"
SETFILES="/usr/sbin/setfiles"
SE_LINK="/usr/bin/semodule_link"
do_test() {
2005-10-19 21:20:07 +00:00
local OPTS=""
for i in $TYPES; do
# Monolithic tests
2005-10-19 21:20:07 +00:00
OPTS="TYPE=$i QUIET=@ DIRECT_INITRC=y"
[ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1"
echo "**** Options: $OPTS ****"
2005-12-07 16:42:33 +00:00
echo -ne "\33]0;mon $i $1\007"
2005-10-19 21:20:07 +00:00
make $OPTS conf || exit 1
make $OPTS || exit 1
make $OPTS file_contexts || exit 1
$SETFILES -q -c policy.$POLVER file_contexts || exit 1
make $OPTS bare || exit 1
# Loadable module tests
2005-10-19 21:20:07 +00:00
OPTS="TYPE=$i MONOLITHIC=n QUIET=@ DIRECT_INITRC=y"
[ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1"
echo "**** Options: $OPTS ****"
2005-12-07 16:42:33 +00:00
echo -ne "\33]0;mod $i $1\007"
2005-10-19 21:20:07 +00:00
make $OPTS conf || exit 1
make $OPTS all || exit 1
2005-10-19 21:20:07 +00:00
mv base.pp tmp
2005-12-07 16:42:33 +00:00
# $SE_LINK tmp/base.pp *.pp || exit 1
2005-10-19 21:20:07 +00:00
make $OPTS bare || exit 1
done
}
make bare || exit 1
make MONOLITHIC=n bare || exit 1
2005-10-19 21:20:07 +00:00
do_test
2005-10-19 21:20:07 +00:00
for i in $DISTROS; do
do_test $i
2005-10-19 21:20:07 +00:00
done
echo "Completed successfully."