Skip to content

Instantly share code, notes, and snippets.

@tas50
Created October 5, 2015 23:55
Show Gist options
  • Save tas50/161be1cc87924904911f to your computer and use it in GitHub Desktop.
Save tas50/161be1cc87924904911f to your computer and use it in GitHub Desktop.
serverspec
MBP_tsmith:~/dev/chef-cookbooks/cron kitchen test default-freebsd-102
-----> Starting Kitchen (v1.4.2)
-----> Cleaning up any prior instances of <default-freebsd-102>
-----> Destroying <default-freebsd-102>...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
Vagrant instance <default-freebsd-102> destroyed.
Finished destroying <default-freebsd-102> (0m3.55s).
-----> Testing <default-freebsd-102>
-----> Creating <default-freebsd-102>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'opscode-freebsd-10.2'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: kitchen-cron-default-freebsd-102_default_1444088966317_84412
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2200 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.30
default: VirtualBox Version: 5.0
==> default: Setting hostname...
==> default: Machine not provisioned because `--no-provision` is specified.
[SSH] Established
Vagrant instance <default-freebsd-102> created.
Finished creating <default-freebsd-102> (0m47.83s).
-----> Converging <default-freebsd-102>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 3.3.0...
Removing non-cookbook files before transfer
Preparing validation.pem
Preparing client.rb
-----> Installing Chef Omnibus (install only if missing)
Downloading https://www.chef.io/chef/install.sh to file /tmp/install.sh
Trying curl...
Download complete.
Downloading Chef for freebsd...
downloading https://www.chef.io/chef/metadata?v=&prerelease=false&nightlies=false&p=freebsd&pv=10&m=amd64
to file /tmp/install.sh.871/metadata.txt
trying curl...
url https://opscode-omnibus-packages.s3.amazonaws.com/freebsd/10/amd64/chef-12.4.3_1.amd64.sh
md5 2a0e541a7005ac1a91985d030d42af2b
sha256 6195c6443d34e5c79cc5f4a850c5806830e35f59ec43cc478f4ed5a2115c7c13
downloaded metadata file looks valid...
downloading https://opscode-omnibus-packages.s3.amazonaws.com/freebsd/10/amd64/chef-12.4.3_1.amd64.sh
to file /tmp/install.sh.871/chef-12.4.3_1.amd64.sh
trying curl...
Comparing checksum with shasum...
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
You are installing an omnibus package without a version pin. If you are installing
on production servers via an automated process this is DANGEROUS and you will
be upgraded without warning on new releases, even to new major releases.
Letting the version float is only appropriate in desktop, test, development or
CI/CD environments.
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
Installing Chef
installing with sh...
Verifying archive integrity... All good.
Uncompressing The full stack of chef.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Thank you for installing Chef!
Transferring files to <default-freebsd-102>
Starting Chef Client, version 12.4.3
Creating a new client identity for default-freebsd-102 using the validator key.
[2015-10-05T23:50:22+00:00] WARN: Child with name 'dna.json' found in multiple directories: /tmp/kitchen/dna.json and /tmp/kitchen/dna.json
[2015-10-05T23:50:22+00:00] WARN: Child with name 'dna.json' found in multiple directories: /tmp/kitchen/dna.json and /tmp/kitchen/dna.json
resolving cookbooks for run list: ["cron_test::default"]
[2015-10-05T23:50:22+00:00] WARN: Child with name 'dna.json' found in multiple directories: /tmp/kitchen/dna.json and /tmp/kitchen/dna.json
Synchronizing Cookbooks:
- cron_test
- cron
Compiling Cookbooks...
Converging 11 resources
Recipe: cron::default
* service[cron] action enable
- enable service service[cron]
* service[cron] action start (up to date)
* directory[/etc/cron.d] action create
- create new directory /etc/cron.d
- change mode from '' to '0755'
- change owner from '' to 'root'
- change group from '' to 'wheel'
* remote_file[/etc/crontab.os_source] action create_if_missing
- create new file /etc/crontab.os_source
- update content in file /etc/crontab.os_source from none to 15a2fe
--- /etc/crontab.os_source 2015-10-05 23:50:23.561092775 +0000
+++ /etc/.crontab.os_source20151005-997-177kgfk 2015-10-05 23:50:23.561092775 +0000
@@ -1 +1,26 @@
+# /etc/crontab - root's crontab for FreeBSD
+#
+# $FreeBSD: releng/10.2/etc/crontab 194170 2009-06-14 06:37:19Z brian $
+#
+SHELL=/bin/sh
+PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
+#
+#minute hour mday month wday who command
+#
+*/5 * * * * root /usr/libexec/atrun
+#
+# Save some entropy so that /dev/random can re-seed on boot.
+*/11 * * * * operator /usr/libexec/save-entropy
+#
+# Rotate log files every hour, if necessary.
+0 * * * * root newsyslog
+#
+# Perform daily/weekly/monthly maintenance.
+1 3 * * * root periodic daily
+15 4 * * 6 root periodic weekly
+30 5 1 * * root periodic monthly
+#
+# Adjust the time zone if the CMOS clock keeps local time, as opposed to
+# UTC time. See adjkerntz(8) for details.
+1,31 0-5 * * * root adjkerntz -a
- change mode from '' to '0444'
- change owner from '' to 'root'
- change group from '' to 'wheel'
* template[/etc/crontab] action create
- update content in file /etc/crontab from 15a2fe to 8faa1f
--- /etc/crontab 2015-08-12 15:27:49.000000000 +0000
+++ /tmp/chef-rendered-template20151005-997-1hxz5ux 2015-10-05 23:50:23.578150771 +0000
@@ -1,3 +1,8 @@
+# Crontab for managed by Chef. Changes will be overwritten.
+# If you really need to change the original portions of this file, edit /etc/crontab.os_source, then re-run chef
+
+#
+# Begin OS original portion
# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD: releng/10.2/etc/crontab 194170 2009-06-14 06:37:19Z brian $
@@ -23,4 +28,9 @@
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time. See adjkerntz(8) for details.
1,31 0-5 * * * root adjkerntz -a
+
+# End OS original portion
+#
+
+
Recipe: cron_test::default
* cron_d[bizarrely-scheduled-usage-report] action create (up to date)
* template[/etc/cron.d/bizarrely-scheduled-usage-report] action create
- create new file /etc/cron.d/bizarrely-scheduled-usage-report
- update content in file /etc/cron.d/bizarrely-scheduled-usage-report from none to ee7588
--- /etc/cron.d/bizarrely-scheduled-usage-report 2015-10-05 23:50:23.594047656 +0000
+++ /tmp/chef-rendered-template20151005-997-17zzxx7 2015-10-05 23:50:23.594047656 +0000
@@ -1 +1,4 @@
+# Crontab for bizarrely-scheduled-usage-report managed by Chef. Changes will be overwritten.
+
+*/5 1,23 2-5 * * appuser /srv/app/scripts/generate_report
- change mode from '' to '0644'
* cron_d[test-month-usage-report] action create (up to date)
* template[/etc/cron.d/test-month-usage-report] action create
- create new file /etc/cron.d/test-month-usage-report
- update content in file /etc/cron.d/test-month-usage-report from none to b92fd6
--- /etc/cron.d/test-month-usage-report 2015-10-05 23:50:23.606256901 +0000
+++ /tmp/chef-rendered-template20151005-997-vnm08z 2015-10-05 23:50:23.606256901 +0000
@@ -1 +1,4 @@
+# Crontab for test-month-usage-report managed by Chef. Changes will be overwritten.
+
+0 6 * 1 * appuser /srv/app/scripts/generate_report
- change mode from '' to '0644'
* cron_d[test-weekday-usage-report] action create (up to date)
* template[/etc/cron.d/test-weekday-usage-report] action create
- create new file /etc/cron.d/test-weekday-usage-report
- update content in file /etc/cron.d/test-weekday-usage-report from none to 6e4674
--- /etc/cron.d/test-weekday-usage-report 2015-10-05 23:50:23.618132353 +0000
+++ /tmp/chef-rendered-template20151005-997-1a1ho3k 2015-10-05 23:50:23.618132353 +0000
@@ -1 +1,4 @@
+# Crontab for test-weekday-usage-report managed by Chef. Changes will be overwritten.
+
+45 13 * * 7 appuser /srv/app/scripts/generate_report
- change mode from '' to '0644'
* cron_d[fixnum-job] action create (up to date)
* template[/etc/cron.d/fixnum-job] action create
- create new file /etc/cron.d/fixnum-job
- update content in file /etc/cron.d/fixnum-job from none to 647fc5
--- /etc/cron.d/fixnum-job 2015-10-05 23:50:23.631385961 +0000
+++ /tmp/chef-rendered-template20151005-997-rjpsst 2015-10-05 23:50:23.631385961 +0000
@@ -1 +1,4 @@
+# Crontab for fixnum-job managed by Chef. Changes will be overwritten.
+
+0 1 2 * * appuser /bin/true
- change mode from '' to '0644'
* cron_d[predefined_value_check] action create (up to date)
* template[/etc/cron.d/predefined_value_check] action create
- create new file /etc/cron.d/predefined_value_check
- update content in file /etc/cron.d/predefined_value_check from none to db7bb9
--- /etc/cron.d/predefined_value_check 2015-10-05 23:50:23.642253006 +0000
+++ /tmp/chef-rendered-template20151005-997-ilbvsf 2015-10-05 23:50:23.642253006 +0000
@@ -1 +1,4 @@
+# Crontab for predefined_value_check managed by Chef. Changes will be overwritten.
+
+@midnight appuser /bin/true
- change mode from '' to '0644'
* cron_d[nil_value_check] action create (up to date)
* template[/etc/cron.d/nil_value_check] action create
- create new file /etc/cron.d/nil_value_check
- update content in file /etc/cron.d/nil_value_check from none to 07ec98
--- /etc/cron.d/nil_value_check 2015-10-05 23:50:23.653218722 +0000
+++ /tmp/chef-rendered-template20151005-997-g1hxhm 2015-10-05 23:50:23.653218722 +0000
@@ -1 +1,4 @@
+# Crontab for nil_value_check managed by Chef. Changes will be overwritten.
+
+* * * * * appuser /bin/true
- change mode from '' to '0644'
* cron_d[no_value_check] action create (up to date)
* template[/etc/cron.d/no_value_check] action create
- create new file /etc/cron.d/no_value_check
- update content in file /etc/cron.d/no_value_check from none to 2ef535
--- /etc/cron.d/no_value_check 2015-10-05 23:50:23.664394227 +0000
+++ /tmp/chef-rendered-template20151005-997-x3hpr4 2015-10-05 23:50:23.664394227 +0000
@@ -1 +1,4 @@
+# Crontab for no_value_check managed by Chef. Changes will be overwritten.
+
+* * * * * appuser /bin/true
- change mode from '' to '0644'
Recipe: cron::default
* template[/etc/crontab] action create
- update content in file /etc/crontab from 8faa1f to 5bfb48
--- /etc/crontab 2015-10-05 23:50:23.578150000 +0000
+++ /tmp/chef-rendered-template20151005-997-1tsyzjh 2015-10-05 23:50:23.672940867 +0000
@@ -33,4 +33,74 @@
#
+#
+# Begin contents of /etc/cron.d/no_value_check
+# Crontab for no_value_check managed by Chef. Changes will be overwritten.
+
+* * * * * appuser /bin/true
+
+# End contents of /etc/cron.d/no_value_check
+#
+
+
+#
+# Begin contents of /etc/cron.d/predefined_value_check
+# Crontab for predefined_value_check managed by Chef. Changes will be overwritten.
+
+@midnight appuser /bin/true
+
+# End contents of /etc/cron.d/predefined_value_check
+#
+
+
+#
+# Begin contents of /etc/cron.d/test-weekday-usage-report
+# Crontab for test-weekday-usage-report managed by Chef. Changes will be overwritten.
+
+45 13 * * 7 appuser /srv/app/scripts/generate_report
+
+# End contents of /etc/cron.d/test-weekday-usage-report
+#
+
+
+#
+# Begin contents of /etc/cron.d/nil_value_check
+# Crontab for nil_value_check managed by Chef. Changes will be overwritten.
+
+* * * * * appuser /bin/true
+
+# End contents of /etc/cron.d/nil_value_check
+#
+
+
+#
+# Begin contents of /etc/cron.d/test-month-usage-report
+# Crontab for test-month-usage-report managed by Chef. Changes will be overwritten.
+
+0 6 * 1 * appuser /srv/app/scripts/generate_report
+
+# End contents of /etc/cron.d/test-month-usage-report
+#
+
+
+#
+# Begin contents of /etc/cron.d/bizarrely-scheduled-usage-report
+# Crontab for bizarrely-scheduled-usage-report managed by Chef. Changes will be overwritten.
+
+*/5 1,23 2-5 * * appuser /srv/app/scripts/generate_report
+
+# End contents of /etc/cron.d/bizarrely-scheduled-usage-report
+#
+
+
+#
+# Begin contents of /etc/cron.d/fixnum-job
+# Crontab for fixnum-job managed by Chef. Changes will be overwritten.
+
+0 1 2 * * appuser /bin/true
+
+# End contents of /etc/cron.d/fixnum-job
+#
+
+
Running handlers:
Running handlers complete
Chef Client finished, 12/20 resources updated in 2.292043472 seconds
Finished converging <default-freebsd-102> (0m22.95s).
-----> Setting up <default-freebsd-102>...
Finished setting up <default-freebsd-102> (0m0.00s).
-----> Verifying <default-freebsd-102>...
Preparing files for transfer
-----> Installing Busser (busser)
Fetching: thor-0.19.0.gem (100%)
Successfully installed thor-0.19.0
Fetching: busser-0.7.1.gem (100%)
Successfully installed busser-0.7.1
2 gems installed
-----> Setting up Busser
Creating BUSSER_ROOT in /tmp/verifier
Creating busser binstub
Installing Busser plugins: busser-serverspec
Plugin serverspec installed (version 0.5.7)
-----> Running postinstall for serverspec plugin
Suite path directory /tmp/verifier/suites does not exist, skipping.
Transferring files to <default-freebsd-102>
-----> Running serverspec test suite
-----> Installing Serverspec..
Fetching: sfl-2.2.gem (100%)
Fetching: net-telnet-0.1.1.gem (100%)
Fetching: net-ssh-2.9.2.gem (100%)
Fetching: net-scp-1.2.1.gem (100%)
Fetching: specinfra-2.43.11.gem (100%)
Fetching: multi_json-1.11.2.gem (100%)
Fetching: diff-lcs-1.2.5.gem (100%)
Fetching: rspec-support-3.3.0.gem (100%)
Fetching: rspec-expectations-3.3.1.gem (100%)
Fetching: rspec-core-3.3.2.gem (100%)
Fetching: rspec-its-1.2.0.gem (100%)
Fetching: rspec-mocks-3.3.2.gem (100%)
Fetching: rspec-3.3.0.gem (100%)
Fetching: serverspec-2.24.1.gem (100%)
-----> serverspec installed (version 2.24.1)
/opt/chef/embedded/bin/ruby -I/tmp/verifier/suites/serverspec -I/tmp/verifier/gems/gems/rspec-support-3.3.0/lib:/tmp/verifier/gems/gems/rspec-core-3.3.2/lib /opt/chef/embedded/bin/rspec --pattern /tmp/verifier/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/verifier/suites/serverspec
File "/etc/crontab"
content
should match /\* \* \* \* \* appuser \/bin\/true/
Finished in 0.02077 seconds (files took 0.67621 seconds to load)
1 example, 0 failures
Finished verifying <default-freebsd-102> (0m16.87s).
-----> Destroying <default-freebsd-102>...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
Vagrant instance <default-freebsd-102> destroyed.
Finished destroying <default-freebsd-102> (0m3.91s).
Finished testing <default-freebsd-102> (1m35.13s).
-----> Kitchen is finished. (1m35.61s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment