]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for snmpd cookbook
authorTom Hughes <tom@compton.nu>
Tue, 25 Feb 2020 18:48:56 +0000 (18:48 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 25 Feb 2020 18:48:56 +0000 (18:48 +0000)
.github/workflows/test-kitchen.yml
.kitchen.yml
cookbooks/snmpd/attributes/default.rb
test/data_bags/snmpd/communities.json [new file with mode: 0644]
test/integration/snmpd/serverspec/snmpd_spec.rb [new file with mode: 0644]

index 7cb3e874a33c6d64e4e91d66144e09c8b77c036a..58735a202a5a34348700958c18ec8da92f549d60 100644 (file)
@@ -69,6 +69,7 @@ jobs:
           - python
           - rsyncd
           - serverinfo
+          - snmpd
           - spamassassin
           - squid
           - stateofthemap
index c21b1a1773395ee67bb082d222098bd2cbe15d27..8b7c6b2a8e67cc052a1f43b50d86461595bafb74 100644 (file)
@@ -250,6 +250,9 @@ suites:
   - name: serverinfo
     run_list:
       - recipe[serverinfo::default]
+  - name: snmpd
+    run_list:
+      - recipe[snmpd::default]
   - name: spamassassin
     run_list:
       - recipe[spamassassin::default]
index 0cba387e1899db761de28619d10a93a1c854b613..3e7c1d1c42db9e38a14180e1aae10a953c2cc2a2 100644 (file)
@@ -1 +1 @@
-default[:rsyncd][:modules] = []
+default[:snmpd][:clients] = []
diff --git a/test/data_bags/snmpd/communities.json b/test/data_bags/snmpd/communities.json
new file mode 100644 (file)
index 0000000..3532754
--- /dev/null
@@ -0,0 +1,3 @@
+{
+  "id": "communities"
+}
diff --git a/test/integration/snmpd/serverspec/snmpd_spec.rb b/test/integration/snmpd/serverspec/snmpd_spec.rb
new file mode 100644 (file)
index 0000000..baed87b
--- /dev/null
@@ -0,0 +1,17 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("snmpd") do
+  it { should be_installed }
+end
+
+describe service("snmpd") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(161) do
+  it { should be_listening.with("udp") }
+end