From b64a58991b78c90e8fe8b3453f18a561b3a073dd Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 23 Sep 2019 01:29:43 +0100 Subject: [PATCH 1/7] fix(osfamilymap): add support for `Arch` --- vault/osfamilymap.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vault/osfamilymap.yaml b/vault/osfamilymap.yaml index c75535c..54aca4c 100644 --- a/vault/osfamilymap.yaml +++ b/vault/osfamilymap.yaml @@ -8,5 +8,8 @@ Suse: gpg_pkg: gpg2 setcap_pkg: libcap-progs +Arch: + gpg_pkg: gnupg + MacOS: platform: darwin_amd64 From bd8649c6a71419f0da58329d0002088b1fb53cab Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 23 Sep 2019 01:33:00 +0100 Subject: [PATCH 2/7] test(inspec): move tests to standard `controls` sub-directory --- test/integration/dev_server/{ => controls}/vault_spec.rb | 0 test/integration/install_binary/{ => controls}/vault_spec.rb | 0 test/integration/prod_server/{ => controls}/vault_spec.rb | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename test/integration/dev_server/{ => controls}/vault_spec.rb (100%) rename test/integration/install_binary/{ => controls}/vault_spec.rb (100%) rename test/integration/prod_server/{ => controls}/vault_spec.rb (100%) diff --git a/test/integration/dev_server/vault_spec.rb b/test/integration/dev_server/controls/vault_spec.rb similarity index 100% rename from test/integration/dev_server/vault_spec.rb rename to test/integration/dev_server/controls/vault_spec.rb diff --git a/test/integration/install_binary/vault_spec.rb b/test/integration/install_binary/controls/vault_spec.rb similarity index 100% rename from test/integration/install_binary/vault_spec.rb rename to test/integration/install_binary/controls/vault_spec.rb diff --git a/test/integration/prod_server/vault_spec.rb b/test/integration/prod_server/controls/vault_spec.rb similarity index 100% rename from test/integration/prod_server/vault_spec.rb rename to test/integration/prod_server/controls/vault_spec.rb From 9d823edaf06e483a7077c4c0d3735067098116a5 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 23 Sep 2019 01:39:00 +0100 Subject: [PATCH 3/7] fix(inspec): fix Ruby lint warnings --- test/integration/dev_server/controls/vault_spec.rb | 4 ++-- test/integration/prod_server/controls/vault_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/dev_server/controls/vault_spec.rb b/test/integration/dev_server/controls/vault_spec.rb index 8ad9c2b..b54aa9c 100644 --- a/test/integration/dev_server/controls/vault_spec.rb +++ b/test/integration/dev_server/controls/vault_spec.rb @@ -7,7 +7,7 @@ describe.one do describe file('/etc/systemd/system/vault.service') do it { should be_a_file } - its(:content) { should_not match /syslog/ } + its(:content) { should_not match(/syslog/) } end describe file('/etc/init/vault.conf') do @@ -28,7 +28,7 @@ describe command('journalctl -u vault') do its(:exit_status) { should eq 0 } its(:stderr) { should be_empty } - its(:stdout) { should match /WARNING! dev mode is enabled!/ } + its(:stdout) { should match(/WARNING! dev mode is enabled!/) } end describe file('/var/log/vault.log') do diff --git a/test/integration/prod_server/controls/vault_spec.rb b/test/integration/prod_server/controls/vault_spec.rb index 1eb2989..8221db6 100644 --- a/test/integration/prod_server/controls/vault_spec.rb +++ b/test/integration/prod_server/controls/vault_spec.rb @@ -25,7 +25,7 @@ describe.one do describe file('/etc/systemd/system/vault.service') do it { should be_a_file } - its(:content) { should_not match /syslog/ } + its(:content) { should_not match(/syslog/) } end describe file('/etc/init/vault.conf') do @@ -42,7 +42,7 @@ describe command('journalctl -u vault') do its(:exit_status) { should eq 0 } its(:stderr) { should be_empty } - its(:stdout) { should match /Vault server started/ } + its(:stdout) { should match(/Vault server started/) } end describe file('/var/log/vault.log') do From 6dd656fc668640c212c07fbffef5d38c2e7c4b52 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 23 Sep 2019 01:47:35 +0100 Subject: [PATCH 4/7] ci(platform): add `arch-base-latest` * Automated using https://github.com/myii/ssf-formula/pull/40 --- .travis.yml | 12 ++++++++---- kitchen.yml | 19 +++++++++++++++++++ test/integration/dev_server/inspec.yml | 1 + test/integration/install_binary/inspec.yml | 1 + test/integration/prod_server/inspec.yml | 1 + 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index fa92d5a..95869f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,24 +25,28 @@ env: # - INSTANCE: fedora-30-develop-py3 # - INSTANCE: opensuse-leap-15-develop-py3 # - INSTANCE: amazonlinux-2-develop-py2 + # - INSTANCE: arch-base-latest-develop-py2 # - INSTANCE: debian-9-2019-2-py3 - INSTANCE: ubuntu-1804-2019-2-py3 # - INSTANCE: centos-7-2019-2-py3 - # - INSTANCE: fedora-30-2019-2-py3 + - INSTANCE: fedora-30-2019-2-py3 # - INSTANCE: opensuse-leap-15-2019-2-py3 - INSTANCE: amazonlinux-2-2019-2-py2 + # - INSTANCE: arch-base-latest-2019-2-py2 # - INSTANCE: debian-9-2018-3-py2 # - INSTANCE: ubuntu-1604-2018-3-py2 - # - INSTANCE: centos-7-2018-3-py2 - - INSTANCE: fedora-29-2018-3-py2 + - INSTANCE: centos-7-2018-3-py2 + # - INSTANCE: fedora-29-2018-3-py2 - INSTANCE: opensuse-leap-15-2018-3-py2 # - INSTANCE: amazonlinux-2-2018-3-py2 + # - INSTANCE: arch-base-latest-2018-3-py2 # - INSTANCE: debian-8-2017-7-py2 # - INSTANCE: ubuntu-1604-2017-7-py2 - - INSTANCE: centos-6-2017-7-py2 + # - INSTANCE: centos-6-2017-7-py2 # - INSTANCE: fedora-29-2017-7-py2 # - INSTANCE: opensuse-leap-15-2017-7-py2 # - INSTANCE: amazonlinux-2-2017-7-py2 + - INSTANCE: arch-base-latest-2017-7-py2 script: - bin/kitchen verify ${INSTANCE} diff --git a/kitchen.yml b/kitchen.yml index a9cffff..9575352 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -62,6 +62,13 @@ platforms: provision_command: - curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com - sh bootstrap-salt.sh -XdPbfrq -x python2 git develop + - name: arch-base-latest-develop-py2 + driver: + image: netmanagers/salt-develop-py2:arch-base-latest + provision_command: + - curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com + - sh bootstrap-salt.sh -XdPbfrq -x python2 git develop + run_command: /usr/lib/systemd/systemd ## SALT `2019.2` - name: debian-9-2019-2-py3 @@ -87,6 +94,10 @@ platforms: - name: amazonlinux-2-2019-2-py2 driver: image: netmanagers/salt-2019.2-py2:amazonlinux-2 + - name: arch-base-latest-2019-2-py2 + driver: + image: netmanagers/salt-2019.2-py2:arch-base-latest + run_command: /usr/lib/systemd/systemd ## SALT `2018.3` - name: debian-9-2018-3-py2 @@ -112,6 +123,10 @@ platforms: - name: amazonlinux-2-2018-3-py2 driver: image: netmanagers/salt-2018.3-py2:amazonlinux-2 + - name: arch-base-latest-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:arch-base-latest + run_command: /usr/lib/systemd/systemd ## SALT `2017.7` - name: debian-8-2017-7-py2 @@ -138,6 +153,10 @@ platforms: - name: amazonlinux-2-2017-7-py2 driver: image: netmanagers/salt-2017.7-py2:amazonlinux-2 + - name: arch-base-latest-2017-7-py2 + driver: + image: netmanagers/salt-2017.7-py2:arch-base-latest + run_command: /usr/lib/systemd/systemd provisioner: name: salt_solo diff --git a/test/integration/dev_server/inspec.yml b/test/integration/dev_server/inspec.yml index c855429..bb8d77e 100644 --- a/test/integration/dev_server/inspec.yml +++ b/test/integration/dev_server/inspec.yml @@ -15,3 +15,4 @@ supports: - platform-name: suse - platform-name: freebsd - platform-name: amazon + - platform-name: arch diff --git a/test/integration/install_binary/inspec.yml b/test/integration/install_binary/inspec.yml index b923123..230e723 100644 --- a/test/integration/install_binary/inspec.yml +++ b/test/integration/install_binary/inspec.yml @@ -15,3 +15,4 @@ supports: - platform-name: suse - platform-name: freebsd - platform-name: amazon + - platform-name: arch diff --git a/test/integration/prod_server/inspec.yml b/test/integration/prod_server/inspec.yml index d0dd008..e1dce25 100644 --- a/test/integration/prod_server/inspec.yml +++ b/test/integration/prod_server/inspec.yml @@ -15,3 +15,4 @@ supports: - platform-name: suse - platform-name: freebsd - platform-name: amazon + - platform-name: arch From bfdba0c3829337b4c1aef4e06dd80ab9c4dcab92 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 27 Sep 2019 03:42:55 +0100 Subject: [PATCH 5/7] ci(travis): split suites across instances * Automated using https://github.com/myii/ssf-formula/pull/45 --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95869f4..de6d5c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,17 +27,17 @@ env: # - INSTANCE: amazonlinux-2-develop-py2 # - INSTANCE: arch-base-latest-develop-py2 # - INSTANCE: debian-9-2019-2-py3 - - INSTANCE: ubuntu-1804-2019-2-py3 + - INSTANCE: prod-server-ubuntu-1804-2019-2-py3 # - INSTANCE: centos-7-2019-2-py3 - - INSTANCE: fedora-30-2019-2-py3 + - INSTANCE: dev-server-fedora-30-2019-2-py3 # - INSTANCE: opensuse-leap-15-2019-2-py3 - - INSTANCE: amazonlinux-2-2019-2-py2 + - INSTANCE: install-binary-amazonlinux-2-2019-2-py2 # - INSTANCE: arch-base-latest-2019-2-py2 # - INSTANCE: debian-9-2018-3-py2 # - INSTANCE: ubuntu-1604-2018-3-py2 - - INSTANCE: centos-7-2018-3-py2 + - INSTANCE: prod-server-centos-7-2018-3-py2 # - INSTANCE: fedora-29-2018-3-py2 - - INSTANCE: opensuse-leap-15-2018-3-py2 + - INSTANCE: dev-server-opensuse-leap-15-2018-3-py2 # - INSTANCE: amazonlinux-2-2018-3-py2 # - INSTANCE: arch-base-latest-2018-3-py2 # - INSTANCE: debian-8-2017-7-py2 @@ -46,7 +46,7 @@ env: # - INSTANCE: fedora-29-2017-7-py2 # - INSTANCE: opensuse-leap-15-2017-7-py2 # - INSTANCE: amazonlinux-2-2017-7-py2 - - INSTANCE: arch-base-latest-2017-7-py2 + - INSTANCE: install-binary-arch-base-latest-2017-7-py2 script: - bin/kitchen verify ${INSTANCE} From c82034aacef43c2751e1fdbed4f5e9eaacd4cf65 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 27 Sep 2019 04:48:13 +0100 Subject: [PATCH 6/7] fix(gemfile): restrict `inspec` version to `~> 4.16.0` * Automated using https://github.com/myii/ssf-formula/pull/45 * Current tests are resulting in `undefined method` errors with `4.17.7`: - https://travis-ci.com/saltstack-formulas/vault-formula/jobs/239671364#L2219-L2220 - https://travis-ci.com/saltstack-formulas/vault-formula/jobs/239671365#L1925-L1926 - https://travis-ci.com/saltstack-formulas/vault-formula/jobs/239671366#L1515-L1520 --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 3b36de3..2c33118 100644 --- a/Gemfile +++ b/Gemfile @@ -3,4 +3,5 @@ source "https://rubygems.org" gem 'kitchen-docker', '>= 2.9' gem 'kitchen-salt', '>= 0.6.0' gem 'kitchen-inspec', '>= 1.1' +gem 'inspec', '~> 4.16.0' From 800d842d74f27cad0201e3b50bb3636b4346480b Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 30 Sep 2019 19:27:02 +0100 Subject: [PATCH 7/7] ci(travis): apply suggestions from code review Co-Authored-By: Dafydd Jones --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index de6d5c5..16f9923 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,15 +29,15 @@ env: # - INSTANCE: debian-9-2019-2-py3 - INSTANCE: prod-server-ubuntu-1804-2019-2-py3 # - INSTANCE: centos-7-2019-2-py3 - - INSTANCE: dev-server-fedora-30-2019-2-py3 + - INSTANCE: prod-server-fedora-30-2019-2-py3 # - INSTANCE: opensuse-leap-15-2019-2-py3 - - INSTANCE: install-binary-amazonlinux-2-2019-2-py2 + - INSTANCE: prod-server-amazonlinux-2-2019-2-py2 # - INSTANCE: arch-base-latest-2019-2-py2 # - INSTANCE: debian-9-2018-3-py2 # - INSTANCE: ubuntu-1604-2018-3-py2 - INSTANCE: prod-server-centos-7-2018-3-py2 # - INSTANCE: fedora-29-2018-3-py2 - - INSTANCE: dev-server-opensuse-leap-15-2018-3-py2 + - INSTANCE: prod-server-opensuse-leap-15-2018-3-py2 # - INSTANCE: amazonlinux-2-2018-3-py2 # - INSTANCE: arch-base-latest-2018-3-py2 # - INSTANCE: debian-8-2017-7-py2 @@ -46,7 +46,7 @@ env: # - INSTANCE: fedora-29-2017-7-py2 # - INSTANCE: opensuse-leap-15-2017-7-py2 # - INSTANCE: amazonlinux-2-2017-7-py2 - - INSTANCE: install-binary-arch-base-latest-2017-7-py2 + - INSTANCE: prod-server-arch-base-latest-2017-7-py2 script: - bin/kitchen verify ${INSTANCE}