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
This commit is contained in:
Colleen Murphy 2015-10-14 21:08:54 -07:00
parent fc3c6089f9
commit 379d5890d6
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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