]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for openssh cookbook
authorTom Hughes <tom@compton.nu>
Fri, 14 Feb 2020 16:33:49 +0000 (16:33 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 14 Feb 2020 16:33:49 +0000 (16:33 +0000)
.kitchen.yml
.travis.yml
test/integration/openssh/serverspec/openssh_spec.rb [new file with mode: 0644]

index d3ad97d43a34532775002863d59497d5471057ae..0e994e71c8dd8d3caf2d262a271b07f7ffb963bb 100644 (file)
@@ -113,6 +113,9 @@ suites:
   - name: ntp
     run_list:
       - recipe[ntp::default]
+  - name: openssh
+    run_list:
+      - recipe[openssh::default]
   - name: otrs
     run_list:
       - recipe[accounts::default]
index bb4e4b49c4c8d798af48e3ea90a752660e1d558f..86655a944760940464d024bbfa76fb3501553a87 100644 (file)
@@ -65,6 +65,9 @@ jobs:
     - name: "Test Kitchen (ntp)"
       script:
         - bundle exec kitchen test ntp-ubuntu-1804
+    - name: "Test Kitchen (openssh)"
+      script:
+        - bundle exec kitchen test openssh-ubuntu-1804
     - name: "Test Kitchen (otrs)"
       script:
         - bundle exec kitchen test otrs-ubuntu-1804
diff --git a/test/integration/openssh/serverspec/openssh_spec.rb b/test/integration/openssh/serverspec/openssh_spec.rb
new file mode 100644 (file)
index 0000000..49cfac3
--- /dev/null
@@ -0,0 +1,21 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("openssh-client") do
+  it { should be_installed }
+end
+
+describe package("openssh-server") do
+  it { should be_installed }
+end
+
+describe service("ssh") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(22) do
+  it { should be_listening.with("tcp") }
+end