Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude sedismod and sedispol execution if not available #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions linux-tools/checkpolicy/checkpolicy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,20 @@ REQUIRED="grep expect"
function tc_local_setup()
{
tc_exec_or_break $REQUIRED
tc_check_package checkpolicy
tc_check_package checkpolicy
tc_fail_if_bad $? "checkpolicy not installed properly"
tc_executes sedismod sedispol
if [ $? -ne 0 ]; then
TST_TOTAL=3
fi
}

function tc_local_cleanup()
{
rm -f policy.mod
}

function run_test()
function run_test01()
{
pushd $CHECKPOLICY_DIR >$stdout 2>$stderr
tc_register "Checkmodule: Compiling the policy file"
Expand All @@ -66,6 +70,10 @@ function run_test()
checkpolicy -b policy.mod >$stdout 2>$stderr
tc_pass_or_fail $? "Binary policy file not loaded"

}

function run_test02()
{
tc_register "sedismod"
./sedismod.exp >$stdout 2>$stderr
tc_pass_or_fail $? "sedismod failed"
Expand All @@ -82,4 +90,5 @@ function run_test()

TST_TOTAL=5
tc_setup
run_test
run_test01
[ $TST_TOTAL -eq 5 ] && run_test02