From 379d5890d6b0d2747d1fc35385abc6f39c41878e Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Wed, 14 Oct 2015 21:08:54 -0700 Subject: [PATCH] Fix selinux tests If things are working correctly, then there may only be one port number for a given port type, so it may not be part of a comma-separated list. This patch relaxes the tests to allow a single port number instead of strictly a comma-separated list in the output of `semanage port -l`. Change-Id: Iaa9c8cda7a2eae904eb8f25cfa33be249b2b4cab --- spec/acceptance/basic_spec.rb | 6 +++--- spec/acceptance/behind_proxy_spec.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb index 1b867d6..2121c31 100644 --- a/spec/acceptance/basic_spec.rb +++ b/spec/acceptance/basic_spec.rb @@ -197,12 +197,12 @@ describe 'puppet-cgit module', :if => ['fedora', 'redhat'].include?(os[:family]) end describe command("semanage port -l | grep '^http_port_t'") do - its (:stdout) { should match(/^http_port_t.*\b80,/) } - its (:stdout) { should match(/^http_port_t.*\b443,/) } + its (:stdout) { should match(/^http_port_t.*\b80/) } + its (:stdout) { should match(/^http_port_t.*\b443/) } end describe command("semanage port -l | grep '^git_port_t'") do - its(:stdout) { should match(/^git_port_t.*\b9418,/) } + its(:stdout) { should match(/^git_port_t.*\b9418/) } end end end diff --git a/spec/acceptance/behind_proxy_spec.rb b/spec/acceptance/behind_proxy_spec.rb index 498b2a2..afb2ddf 100644 --- a/spec/acceptance/behind_proxy_spec.rb +++ b/spec/acceptance/behind_proxy_spec.rb @@ -194,12 +194,12 @@ describe 'puppet-cgit module begind proxy', :if => ['fedora', 'redhat'].include? describe 'selinux' do describe command("semanage port -l | grep '^http_port_t'") do - its(:stdout) { should match(/^http_port_t.*\b8080,/) } - its(:stdout) { should match(/^http_port_t.*\b4443,/) } + its(:stdout) { should match(/^http_port_t.*\b8080/) } + its(:stdout) { should match(/^http_port_t.*\b4443/) } end describe command("semanage port -l | grep '^git_port_t'") do - its(:stdout) { should match(/^git_port_t.*\b29418,/) } + its(:stdout) { should match(/^git_port_t.*\b29418/) } end end end