|
Chris PeBenito |
fdef43 |
#!/bin/bash
|
|
Chris PeBenito |
fdef43 |
|
|
Chris PeBenito |
dd6f82 |
DISTROS="rhel4 gentoo debian"
|
|
Chris PeBenito |
dd6f82 |
TYPES="strict targeted strict-mcs targeted-mcs strict-mls targeted-mls"
|
|
Chris PeBenito |
fdef43 |
POLVER="`checkpolicy -V |cut -f 1 -d ' '`"
|
|
Chris PeBenito |
fdef43 |
SETFILES="/usr/sbin/setfiles"
|
|
Chris PeBenito |
fdef43 |
SE_LINK="/usr/bin/semodule_link"
|
|
Chris PeBenito |
fdef43 |
|
|
Chris PeBenito |
dd6f82 |
die() {
|
|
Chris PeBenito |
dd6f82 |
if [ "$1" -eq "1" ]; then
|
|
Chris PeBenito |
dd6f82 |
echo "failed with options: $2"
|
|
Chris PeBenito |
dd6f82 |
fi
|
|
Chris PeBenito |
dd6f82 |
|
|
Chris PeBenito |
dd6f82 |
exit 1
|
|
Chris PeBenito |
dd6f82 |
}
|
|
Chris PeBenito |
dd6f82 |
|
|
Chris PeBenito |
dd6f82 |
cleanup() {
|
|
Chris PeBenito |
dd6f82 |
make bare
|
|
Chris PeBenito |
dd6f82 |
make MONOLITHIC=n bare
|
|
Chris PeBenito |
dd6f82 |
}
|
|
Chris PeBenito |
dd6f82 |
|
|
Chris PeBenito |
959fca |
do_test() {
|
|
Chris PeBenito |
fdef43 |
local OPTS=""
|
|
Chris PeBenito |
fdef43 |
|
|
Chris PeBenito |
dd6f82 |
trap cleanup SIGINT SIGQUIT
|
|
Chris PeBenito |
dd6f82 |
|
|
Chris PeBenito |
fdef43 |
for i in $TYPES; do
|
|
Chris PeBenito |
959fca |
# Monolithic tests
|
|
Chris PeBenito |
dd6f82 |
OPTS="TYPE=$i MONOLITHIC=y QUIET=y DIRECT_INITRC=y"
|
|
Chris PeBenito |
fdef43 |
[ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1"
|
|
Chris PeBenito |
fdef43 |
echo "**** Options: $OPTS ****"
|
|
Chris PeBenito |
686f13 |
echo -ne "\33]0;mon $i $1\007"
|
|
Chris PeBenito |
dd6f82 |
make $OPTS conf || die "$?" "$OPTS"
|
|
Chris PeBenito |
dd6f82 |
make $OPTS || die "$?" "$OPTS"
|
|
Chris PeBenito |
dd6f82 |
make $OPTS file_contexts || die "$?" "$OPTS"
|
|
Chris PeBenito |
dd6f82 |
$SETFILES -q -c policy.$POLVER file_contexts || die "$?" "$OPTS"
|
|
Chris PeBenito |
dd6f82 |
make $OPTS bare || die "$?" "$OPTS"
|
|
Chris PeBenito |
fdef43 |
|
|
Chris PeBenito |
959fca |
# Loadable module tests
|
|
Chris PeBenito |
dd6f82 |
OPTS="TYPE=$i MONOLITHIC=n QUIET=y DIRECT_INITRC=y"
|
|
Chris PeBenito |
fdef43 |
[ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1"
|
|
Chris PeBenito |
fdef43 |
echo "**** Options: $OPTS ****"
|
|
Chris PeBenito |
686f13 |
echo -ne "\33]0;mod $i $1\007"
|
|
Chris PeBenito |
dd6f82 |
make $OPTS conf || die "$?" "$OPTS"
|
|
Chris PeBenito |
dd6f82 |
make $OPTS base || die "$?" "$OPTS"
|
|
Chris PeBenito |
dd6f82 |
make $OPTS -j2 modules || die "$?" "$OPTS"
|
|
Chris PeBenito |
fdef43 |
mv base.pp tmp
|
|
Chris PeBenito |
dd6f82 |
############# FIXME
|
|
Chris PeBenito |
dd6f82 |
rm dmesg.pp
|
|
Chris PeBenito |
dd6f82 |
$SE_LINK tmp/base.pp *.pp || die "$?" "$OPTS"
|
|
Chris PeBenito |
dd6f82 |
make $OPTS bare || die "$?" "$OPTS"
|
|
Chris PeBenito |
fdef43 |
done
|
|
Chris PeBenito |
fdef43 |
}
|
|
Chris PeBenito |
fdef43 |
|
|
Chris PeBenito |
dd6f82 |
cleanup
|
|
Chris PeBenito |
959fca |
do_test
|
|
Chris PeBenito |
fdef43 |
|
|
Chris PeBenito |
fdef43 |
echo "Completed successfully."
|