saltstack-formulas / openssh-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
90 stars 297 forks source link

test(inspec): fix `config_spec` tests on *BSD (`wheel` not `root`) #171

Closed myii closed 4 years ago

myii commented 4 years ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

Before:

  ↺  openssh package: should be installed
     ↺  The `package` resource is not supported on your OS yet.
  ×  openssh configuration: should match desired lines (2 failed)
     ✔  File /etc/ssh/sshd_config is expected to be file
     ✔  File /etc/ssh/sshd_config is expected to be owned by "root"
     ×  File /etc/ssh/sshd_config is expected to be grouped into "root"
     expected `File /etc/ssh/sshd_config.grouped_into?("root")` to return true, got false
     ✔  File /etc/ssh/sshd_config mode is expected to cmp == "0644"
     ✔  File /etc/ssh/sshd_config content is expected to include "ChallengeResponseAuthentication no"
     ✔  File /etc/ssh/sshd_config content is expected to include "X11Forwarding yes"
     ✔  File /etc/ssh/sshd_config content is expected to include "PrintMotd no"
     ✔  File /etc/ssh/sshd_config content is expected to include "AcceptEnv LANG LC_*"
     ✔  File /etc/ssh/sshd_config content is expected to include "Subsystem sftp /usr/lib/openssh/sftp-server"
     ✔  File /etc/ssh/sshd_config content is expected to include "UsePAM yes"
     ✔  File /etc/ssh/ssh_config is expected to be file
     ✔  File /etc/ssh/ssh_config is expected to be owned by "root"
     ×  File /etc/ssh/ssh_config is expected to be grouped into "root"
     expected `File /etc/ssh/ssh_config.grouped_into?("root")` to return true, got false
     ✔  File /etc/ssh/ssh_config mode is expected to cmp == "0644"
     ✔  File /etc/ssh/ssh_config content is expected to include "Host *"
     ✔  File /etc/ssh/ssh_config content is expected to include "    GSSAPIAuthentication yes"
     ✔  File /etc/ssh/ssh_config content is expected to include "    HashKnownHosts yes"
     ✔  File /etc/ssh/ssh_config content is expected to include "    SendEnv LANG LC_*"
  ✔  openssh service: should be running and enabled
     ✔  Service sshd is expected to be enabled
     ✔  Service sshd is expected to be running

Profile Summary: 1 successful control, 1 control failure, 1 control skipped
Test Summary: 18 successful, 2 failures, 1 skipped

After:

  ↺  openssh package: should be installed
     ↺  The `package` resource is not supported on your OS yet.
  ✔  openssh configuration: should match desired lines
     ✔  File /etc/ssh/sshd_config is expected to be file
     ✔  File /etc/ssh/sshd_config is expected to be owned by "root"
     ✔  File /etc/ssh/sshd_config is expected to be grouped into "wheel"
     ✔  File /etc/ssh/sshd_config mode is expected to cmp == "0644"
     ✔  File /etc/ssh/sshd_config content is expected to include "ChallengeResponseAuthentication no"
     ✔  File /etc/ssh/sshd_config content is expected to include "X11Forwarding yes"
     ✔  File /etc/ssh/sshd_config content is expected to include "PrintMotd no"
     ✔  File /etc/ssh/sshd_config content is expected to include "AcceptEnv LANG LC_*"
     ✔  File /etc/ssh/sshd_config content is expected to include "Subsystem sftp /usr/lib/openssh/sftp-server"
     ✔  File /etc/ssh/sshd_config content is expected to include "UsePAM yes"
     ✔  File /etc/ssh/ssh_config is expected to be file
     ✔  File /etc/ssh/ssh_config is expected to be owned by "root"
     ✔  File /etc/ssh/ssh_config is expected to be grouped into "wheel"
     ✔  File /etc/ssh/ssh_config mode is expected to cmp == "0644"
     ✔  File /etc/ssh/ssh_config content is expected to include "Host *"
     ✔  File /etc/ssh/ssh_config content is expected to include "    GSSAPIAuthentication yes"
     ✔  File /etc/ssh/ssh_config content is expected to include "    HashKnownHosts yes"
     ✔  File /etc/ssh/ssh_config content is expected to include "    SendEnv LANG LC_*"
  ✔  openssh service: should be running and enabled
     ✔  Service sshd is expected to be enabled
     ✔  Service sshd is expected to be running

Profile Summary: 2 successful controls, 0 control failures, 1 control skipped
Test Summary: 20 successful, 0 failures, 1 skipped

Pillar / config required to test the proposed changes

Tested with the following kitchen.vagrant.yml:

# -*- coding: utf-8 -*-
# vim: ft=yaml
---
driver:
  name: vagrant

platforms:
  - name: freebsd-120-2019-2-py2
    driver:
      box: bento/freebsd-12.0
      cache_directory: false
      customize:
        usbxhci: 'off'
      gui: false
      linked_clone: true

provisioner:
  name: salt_solo
  salt_install: bootstrap
  salt_bootstrap_url: https://bootstrap.saltstack.com
  salt_version: latest

Debug log showing how the proposed changes work

Documentation checklist

Testing checklist

Additional context

saltstack-formulas-travis commented 4 years ago

:tada: This PR is included in version 0.42.3 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: