From fdef437d0c1ed109ae45a9da21689581ed80cbf0 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Wed, 19 Oct 2005 21:20:07 +0000 Subject: [PATCH] complete build tools --- tools/buildtest.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 tools/buildtest.sh diff --git a/tools/buildtest.sh b/tools/buildtest.sh new file mode 100755 index 00000000..87054038 --- /dev/null +++ b/tools/buildtest.sh @@ -0,0 +1,58 @@ +#!/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" +SE_LINK="/usr/bin/semodule_link" + +do_monolithic_test() { + local OPTS="" + + for i in $TYPES; do + OPTS="TYPE=$i QUIET=@ DIRECT_INITRC=y" + [ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1" + make $OPTS 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 + make $OPTS bare || exit 1 + done +} + +do_modular_test() { + local OPTS="" + + for i in $TYPES; do + OPTS="TYPE=$i MONOLITHIC=n QUIET=@ DIRECT_INITRC=y" + [ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1" + make $OPTS bare || exit 1 + echo "**** Options: $OPTS ****" + make $OPTS conf || exit 1 + make $OPTS || exit 1 + make $OPTS base modules || exit 1 + mv base.pp tmp + $SE_LINK tmp/base.pp *.pp || exit 1 + make $OPTS bare || exit 1 + done +} + +# Monolithic tests + +do_monolithic_test + +for i in $DISTROS; do + do_monolithic_test $i +done + +# Loadable module tests + +do_modular_test + +for i in $DISTROS; do + do_modular_test $i +done + +echo "Completed successfully."