Blame tools/regression.sh
|
Chris PeBenito |
b51f2f |
#!/bin/bash
|
|
Chris PeBenito |
b51f2f |
|
|
Chris PeBenito |
b51f2f |
DISTROS="redhat gentoo debian suse"
|
|
Chris PeBenito |
142e9f |
TYPES="strict strict-mls strict-mcs targeted targeted-mls targeted-mcs"
|
|
Chris PeBenito |
b51f2f |
POLVER="`checkpolicy -V |cut -f 1 -d ' '`"
|
|
Chris PeBenito |
b51f2f |
SETFILES="/usr/sbin/setfiles"
|
|
Chris PeBenito |
b51f2f |
|
|
Chris PeBenito |
b51f2f |
do_test() {
|
|
Chris PeBenito |
b51f2f |
local OPTS=""
|
|
Chris PeBenito |
b51f2f |
|
|
Chris PeBenito |
142e9f |
for i in $TYPES; do
|
|
Chris PeBenito |
142e9f |
OPTS="TYPE=$i QUIET=@ DIRECT_INITRC=y"
|
|
Chris PeBenito |
b51f2f |
[ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1"
|
|
Chris PeBenito |
b51f2f |
make bare || exit 1
|
|
Chris PeBenito |
b51f2f |
echo "**** Options: $OPTS ****"
|
|
Chris PeBenito |
b51f2f |
make $OPTS conf || exit 1
|
|
Chris PeBenito |
b51f2f |
make $OPTS || exit 1
|
|
Chris PeBenito |
b51f2f |
make $OPTS file_contexts || exit 1
|
|
Chris PeBenito |
b51f2f |
$SETFILES -q -c policy.$POLVER file_contexts || exit 1
|
|
Chris PeBenito |
b51f2f |
done
|
|
Chris PeBenito |
b51f2f |
}
|
|
Chris PeBenito |
b51f2f |
|
|
Chris PeBenito |
b51f2f |
# first to generic test
|
|
Chris PeBenito |
b51f2f |
do_test
|
|
Chris PeBenito |
b51f2f |
|
|
Chris PeBenito |
b51f2f |
# now distro-specitic test
|
|
Chris PeBenito |
b51f2f |
for i in $DISTROS; do
|
|
Chris PeBenito |
b51f2f |
do_test $i
|
|
Chris PeBenito |
b51f2f |
done
|
|
Chris PeBenito |
b51f2f |
|
|
Chris PeBenito |
b51f2f |
# clean up
|
|
Chris PeBenito |
b51f2f |
make bare
|
|
Chris PeBenito |
b51f2f |
echo "Completed successfully."
|