saltstack-formulas / openssh-formula

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

ci(config_spec): deal with IP address after minion.id #210

Open alxwr opened 7 months ago

alxwr commented 7 months 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

The tests did not match minion.id,alias.of.minion.id,103.253.215.19 ssh-.... Now they do.

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

-----> Starting Test Kitchen (v3.3.1)
-----> Verifying <default-debian-11-master-py3>...
       Loaded default 

Profile:   openssh formula (default)
Version:   (not specified)
Target:    ssh://kitchen@localhost:32771
Target ID: b1a7d006-07df-52d0-bebb-8a4cc5ad15a1

  ✔  openssh._mapdata: `map.jinja` should match the reference file
     ✔  File content should match profile map data exactly
  ✔  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 "root"
     ✔  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"
     ✔  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_*"
     ✔  File /etc/ssh/ssh_known_hosts is expected to be file
     ✔  File /etc/ssh/ssh_known_hosts is expected to be owned by "root"
     ✔  File /etc/ssh/ssh_known_hosts is expected to be grouped into "root"
     ✔  File /etc/ssh/ssh_known_hosts mode is expected to cmp == "0644"
     ✔  File /etc/ssh/ssh_known_hosts content is expected to include "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGm[...]"
     ✔  File /etc/ssh/ssh_known_hosts content is expected to match /gitlab.com[0-9a-f.:,]* ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABA/
     ✔  File /etc/ssh/ssh_known_hosts content is expected to match /minion\.id,alias\.of\.minion.id[0-9a-f.:,]* ssh-rsa .+/
     ✔  File /etc/ssh/ssh_known_hosts content is expected to match /minion\.id,alias\.of\.minion\.id[0-9a-f.:,]* ssh-ed25519 .+/
  ✔  openssh package: should be installed
     ✔  System Package openssh-server is expected to be installed
  ✔  openssh service: should be running and enabled
     ✔  Service ssh is expected to be enabled
     ✔  Service ssh is expected to be running

Profile:   InSpec shared resources (share)
Version:   (not specified)
Target:    ssh://kitchen@localhost:32771
Target ID: b1a7d006-07df-52d0-bebb-8a4cc5ad15a1

     No tests executed.

Profile Summary: 4 successful controls, 0 control failures, 0 controls skipped
Test Summary: 30 successful, 0 failures, 0 skipped
       Finished verifying <default-debian-11-master-py3> (0m4.16s).
-----> Test Kitchen is finished. (0m4.99s)

Documentation checklist

Testing checklist

Additional context