From f7e71768fa6b6ea3c056a9da0e516e6833dbfbd4 Mon Sep 17 00:00:00 2001 From: Jiri Kortus Date: Fri, 25 Jan 2019 17:53:50 +0100 Subject: [PATCH] Make sure compose build tests run with SELinux in enforcing mode (cherry picked from commit 57be7313c42636b1ad3ca03061cd04713ea0e1ed) --- tests/cli/test_build_and_deploy_aws.sh | 1 + tests/cli/test_build_and_deploy_azure.sh | 1 + tests/cli/test_build_and_deploy_openstack.sh | 2 ++ tests/cli/test_build_and_deploy_vmware.sh | 1 + tests/cli/test_compose_ext4-filesystem.sh | 1 + tests/cli/test_compose_partitioned-disk.sh | 1 + 6 files changed, 7 insertions(+) diff --git a/tests/cli/test_build_and_deploy_aws.sh b/tests/cli/test_build_and_deploy_aws.sh index fc648ae1..c407b14d 100755 --- a/tests/cli/test_build_and_deploy_aws.sh +++ b/tests/cli/test_build_and_deploy_aws.sh @@ -71,6 +71,7 @@ __EOF__ rlPhaseEnd rlPhaseStartTest "compose start" + rlAssertEquals "SELinux operates in enforcing mode" "$(getenforce)" "Enforcing" UUID=`$CLI compose start example-http-server ami` rlAssertEquals "exit code should be zero" $? 0 diff --git a/tests/cli/test_build_and_deploy_azure.sh b/tests/cli/test_build_and_deploy_azure.sh index cbd88755..fe032dae 100755 --- a/tests/cli/test_build_and_deploy_azure.sh +++ b/tests/cli/test_build_and_deploy_azure.sh @@ -56,6 +56,7 @@ rlJournalStart rlPhaseEnd rlPhaseStartTest "compose start" + rlAssertEquals "SELinux operates in enforcing mode" "$(getenforce)" "Enforcing" UUID=`$CLI compose start example-http-server vhd` rlAssertEquals "exit code should be zero" $? 0 diff --git a/tests/cli/test_build_and_deploy_openstack.sh b/tests/cli/test_build_and_deploy_openstack.sh index 033a0b8b..8787c42e 100755 --- a/tests/cli/test_build_and_deploy_openstack.sh +++ b/tests/cli/test_build_and_deploy_openstack.sh @@ -44,6 +44,8 @@ rlJournalStart rlPhaseEnd rlPhaseStartTest "compose start" + rlAssertEquals "SELinux operates in enforcing mode" "$(getenforce)" "Enforcing" + # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1639326 cat > $TMP_DIR/http-with-rng.toml << __EOF__ name = "http-with-rng" diff --git a/tests/cli/test_build_and_deploy_vmware.sh b/tests/cli/test_build_and_deploy_vmware.sh index e5f47111..1668b463 100755 --- a/tests/cli/test_build_and_deploy_vmware.sh +++ b/tests/cli/test_build_and_deploy_vmware.sh @@ -64,6 +64,7 @@ rlJournalStart rlPhaseEnd rlPhaseStartTest "compose start" + rlAssertEquals "SELinux operates in enforcing mode" "$(getenforce)" "Enforcing" SSH_KEY_DIR=`mktemp -d /tmp/composer-ssh-keys.XXXXXX` rlRun -t -c "ssh-keygen -t rsa -N '' -f $SSH_KEY_DIR/id_rsa" PUB_KEY=`cat $SSH_KEY_DIR/id_rsa.pub` diff --git a/tests/cli/test_compose_ext4-filesystem.sh b/tests/cli/test_compose_ext4-filesystem.sh index a3fe08e9..c4bebf34 100755 --- a/tests/cli/test_compose_ext4-filesystem.sh +++ b/tests/cli/test_compose_ext4-filesystem.sh @@ -16,6 +16,7 @@ CLI="./src/bin/composer-cli" rlJournalStart rlPhaseStartTest "compose start" + rlAssertEquals "SELinux operates in enforcing mode" "$(getenforce)" "Enforcing" UUID=`$CLI compose start example-http-server ext4-filesystem` rlAssertEquals "exit code should be zero" $? 0 diff --git a/tests/cli/test_compose_partitioned-disk.sh b/tests/cli/test_compose_partitioned-disk.sh index ac6c315a..e411fb2d 100755 --- a/tests/cli/test_compose_partitioned-disk.sh +++ b/tests/cli/test_compose_partitioned-disk.sh @@ -16,6 +16,7 @@ CLI="./src/bin/composer-cli" rlJournalStart rlPhaseStartTest "compose start" + rlAssertEquals "SELinux operates in enforcing mode" "$(getenforce)" "Enforcing" UUID=`$CLI compose start example-http-server partitioned-disk` rlAssertEquals "exit code should be zero" $? 0