Test Suite Example for Installing on SELinux

Test Suite Example for Installing on SELinux.

The following test suite can be used as an example of how to test the completed installation of OpenText™ Analytics Database on a SELinux server in enforcing mode.


function test_run() {
        # run tests here, returning 1 if anything fails
    }

    while test_run; do
        ssh ${hosts[1]} sudo audit2allow --lastreload -a -o /tmp/selinux/vertica.te
        if ssh ${hosts[1]} git commit -am "automatic update of policy"; then
            echo "no changes on initiator, try running `sudo audit2allow --lastreload -a -o /tmp/selinux/vertica.te` on other nodes to check for changes there"
            exit 1
        fi
        for h in $hosts; do
            scp ${hosts[1]}:/tmp/selinux/vertica.te $h:/tmp/selinux/
            if ssh $h cd /tmp/selinux && rm -f vertica.pp && make vertica.pp && rm -fr tmp; then
                echo "failed to recompile policy, check errors"
                exit 1
            fi
            if ssh sudo semodule -i vertica.pp; then
                echo "failed to reload policy, check errors"
                exit 1
            fi
        done
    done
    echo "success!"