update test scripts

This commit is contained in:
Chris PeBenito 2006-04-18 15:30:53 +00:00
parent e3e37e853a
commit dd6f828844
3 changed files with 89 additions and 54 deletions

View File

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

57
tools/quicktest.sh Executable file
View File

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

View File

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