diff --git a/test/integration/jenkins_proxy_config/controls/jenkins_proxy_config.rb b/test/integration/jenkins_proxy_config/controls/jenkins_proxy_config.rb new file mode 100644 index 0000000000..610e662752 --- /dev/null +++ b/test/integration/jenkins_proxy_config/controls/jenkins_proxy_config.rb @@ -0,0 +1,25 @@ +# encoding: utf-8 +# copyright: 2018, The Authors + +title 'Jenkins Proxy' + +control 'jenkins_proxy_config-1.0' do + impact 0.7 + title 'Jenkins Proxy is configured' + + describe jenkins_proxy('1.2.3.4:5678') do + it { should exist } + its('name') { should_not eq '1.2.3.4' } + its('port') { should_not eq 5678 } + its('noproxy') { should_not eq 'localhost' } + its('noproxy') { should_not eq '127.0.0.1' } + end + + describe jenkins_proxy('5.6.7.8:9012') do + it { should exist } + its('name') { should eq '5.6.7.8' } + its('port') { should eq 9012 } + its('noproxy') { should include 'nohost' } + its('noproxy') { should include '*.nodomain' } + end +end diff --git a/test/integration/jenkins_proxy_config/inspec.yml b/test/integration/jenkins_proxy_config/inspec.yml new file mode 100644 index 0000000000..139d76aa8f --- /dev/null +++ b/test/integration/jenkins_proxy_config/inspec.yml @@ -0,0 +1,11 @@ +name: jenkins_proxy_config +title: InSpec Profile +maintainer: The Authors +copyright: The Authors +copyright_email: you@example.com +license: Apache-2.0 +summary: An InSpec Compliance Profile +version: 0.1.0 +depends: + - name: jenkins_inspec + path: test/integration/helpers/jenkins_inspec \ No newline at end of file diff --git a/test/integration/jenkins_proxy_config/serverspec/assert_created_spec.rb b/test/integration/jenkins_proxy_config/serverspec/assert_created_spec.rb deleted file mode 100644 index a2dc40301b..0000000000 --- a/test/integration/jenkins_proxy_config/serverspec/assert_created_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'spec_helper' - -describe jenkins_proxy('1.2.3.4:5678') do - it { should be_a_jenkins_proxy } - it { should_not have_name('1.2.3.4') } - it { should_not have_port(5678) } - it { should_not have_noproxy('localhost') } - it { should_not have_noproxy('127.0.0.1') } -end - -describe jenkins_proxy('5.6.7.8:9012') do - it { should be_a_jenkins_proxy } - it { should have_name('5.6.7.8') } - it { should have_port(9012) } - it { should have_noproxy('nohost') } - it { should have_noproxy('*.nodomain') } -end