From ef1acc0141ff9daca5a5f4fd951a2472c4739cfb Mon Sep 17 00:00:00 2001 From: Fabian Arrotin Date: Apr 26 2018 13:55:48 +0000 Subject: Added python check for selinux policy mismatch --- diff --git a/tests/p_selinux/0_install_tools.sh b/tests/p_selinux/0_install_tools.sh new file mode 100755 index 0000000..814f096 --- /dev/null +++ b/tests/p_selinux/0_install_tools.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Author: Fabian Arrotin + +t_Log "Running $0 - install package selinux policycoreutils tools" +if [ "$centos_ver" = "6" ] ; then + t_InstallPackage policycoreutils-python +else + t_InstallPackage libselinux-python +fi diff --git a/tests/p_selinux/selinux_policy_mismatch.py b/tests/p_selinux/selinux_policy_mismatch.py new file mode 100755 index 0000000..11d7186 --- /dev/null +++ b/tests/p_selinux/selinux_policy_mismatch.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +import sys +import selinux.audit2why as audit2why + +print "Testing audit2why for policy mismatch ..." + +try: + audit2why.init() +except: + sys.exit(1) + +sys.exit(0) +