update test scripts
This commit is contained in:
parent
e3e37e853a
commit
dd6f828844
@ -1,46 +1,58 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DISTROS="redhat gentoo debian suse"
|
DISTROS="rhel4 gentoo debian"
|
||||||
TYPES="strict strict-mls strict-mcs targeted targeted-mls targeted-mcs"
|
TYPES="strict targeted strict-mcs targeted-mcs strict-mls targeted-mls"
|
||||||
POLVER="`checkpolicy -V |cut -f 1 -d ' '`"
|
POLVER="`checkpolicy -V |cut -f 1 -d ' '`"
|
||||||
SETFILES="/usr/sbin/setfiles"
|
SETFILES="/usr/sbin/setfiles"
|
||||||
SE_LINK="/usr/bin/semodule_link"
|
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() {
|
do_test() {
|
||||||
local OPTS=""
|
local OPTS=""
|
||||||
|
|
||||||
|
trap cleanup SIGINT SIGQUIT
|
||||||
|
|
||||||
for i in $TYPES; do
|
for i in $TYPES; do
|
||||||
# Monolithic tests
|
# 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"
|
[ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1"
|
||||||
echo "**** Options: $OPTS ****"
|
echo "**** Options: $OPTS ****"
|
||||||
echo -ne "\33]0;mon $i $1\007"
|
echo -ne "\33]0;mon $i $1\007"
|
||||||
make $OPTS conf || exit 1
|
make $OPTS conf || die "$?" "$OPTS"
|
||||||
make $OPTS || exit 1
|
make $OPTS || die "$?" "$OPTS"
|
||||||
make $OPTS file_contexts || exit 1
|
make $OPTS file_contexts || die "$?" "$OPTS"
|
||||||
$SETFILES -q -c policy.$POLVER file_contexts || exit 1
|
$SETFILES -q -c policy.$POLVER file_contexts || die "$?" "$OPTS"
|
||||||
make $OPTS bare || exit 1
|
make $OPTS bare || die "$?" "$OPTS"
|
||||||
|
|
||||||
# Loadable module tests
|
# 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"
|
[ ! -z "$1" ] && OPTS="$OPTS DISTRO=$1"
|
||||||
echo "**** Options: $OPTS ****"
|
echo "**** Options: $OPTS ****"
|
||||||
echo -ne "\33]0;mod $i $1\007"
|
echo -ne "\33]0;mod $i $1\007"
|
||||||
make $OPTS conf || exit 1
|
make $OPTS conf || die "$?" "$OPTS"
|
||||||
make $OPTS all || exit 1
|
make $OPTS base || die "$?" "$OPTS"
|
||||||
|
make $OPTS -j2 modules || die "$?" "$OPTS"
|
||||||
mv base.pp tmp
|
mv base.pp tmp
|
||||||
# $SE_LINK tmp/base.pp *.pp || exit 1
|
############# FIXME
|
||||||
make $OPTS bare || exit 1
|
rm dmesg.pp
|
||||||
|
$SE_LINK tmp/base.pp *.pp || die "$?" "$OPTS"
|
||||||
|
make $OPTS bare || die "$?" "$OPTS"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
make bare || exit 1
|
cleanup
|
||||||
make MONOLITHIC=n bare || exit 1
|
|
||||||
|
|
||||||
do_test
|
do_test
|
||||||
|
|
||||||
for i in $DISTROS; do
|
|
||||||
do_test $i
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Completed successfully."
|
echo "Completed successfully."
|
||||||
|
57
tools/quicktest.sh
Executable file
57
tools/quicktest.sh
Executable 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."
|
@ -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."
|
|
Loading…
Reference in New Issue
Block a user