From b51f2f3db792b4160ec90b09a2ddc3f8129314e7 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Wed, 17 Aug 2005 15:12:43 +0000 Subject: [PATCH] add regression tester --- tools/regression.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 tools/regression.sh diff --git a/tools/regression.sh b/tools/regression.sh new file mode 100755 index 000000000..85864f837 --- /dev/null +++ b/tools/regression.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +DISTROS="redhat gentoo debian suse" +STRICT_TYPES="strict strict-mls" +TARG_TYPES="targeted targeted-mls" +POLVER="`checkpolicy -V |cut -f 1 -d ' '`" +SETFILES="/usr/sbin/setfiles" + +do_test() { + local OPTS="" + + for i in $STRICT_TYPES; do + OPTS="TYPE=$i QUIET=@" + [ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1" + make bare || exit 1 + echo "**** Options: $OPTS ****" + 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 + + # need a specific config for targeted policy + for i in $TARG_TYPES; do + OPTS="TYPE=$i QUIET=@" + [ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1" + make bare || exit 1 + echo "**** Options: $OPTS ****" + cp policy/modules.conf.targeted_example policy/modules.conf + 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."