]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for chef cookbook
authorGrant Slater <github@firefishy.com>
Tue, 28 Nov 2023 04:17:08 +0000 (04:17 +0000)
committerGrant Slater <github@firefishy.com>
Tue, 28 Nov 2023 10:15:48 +0000 (10:15 +0000)
.github/workflows/test-kitchen.yml
.kitchen.yml
test/integration/chef/inspec/chef_spec.rb [new file with mode: 0644]

index 1b8541af5fcac1167398c44001a367007d7d4cc8..12502a628de9f380232655dd59ec9ed10cd9253c 100644 (file)
@@ -25,6 +25,7 @@ jobs:
           - bind
           - blog
           - blogs
+          - chef
           - civicrm
           - clamav
           - community
index 8fdc7b7813184d3cd5f48a9ae3d90f76766119ba..cb1c2ffde050cb678aa9e1398e3041260ab53849 100644 (file)
@@ -86,6 +86,9 @@ suites:
   - name: blogs
     run_list:
       - recipe[blogs::default]
+  - name: chef
+    run_list:
+      - recipe[chef::default]
   - name: civicrm
     run_list:
       - recipe[civicrm::default]
diff --git a/test/integration/chef/inspec/chef_spec.rb b/test/integration/chef/inspec/chef_spec.rb
new file mode 100644 (file)
index 0000000..b1abdc0
--- /dev/null
@@ -0,0 +1,17 @@
+describe package("chef") do
+  it { should be_installed }
+end
+
+describe systemd_service("chef-client") do
+  it { should be_installed }
+end
+
+describe systemd_service("chef-client.timer") do
+  it { should be_installed }
+  it { should be_enabled }
+end
+
+describe command("chef-client --version") do
+  its("exit_status") { should eq 0 }
+  its("stdout") { should match /Chef Infra Client/ }
+end