inspec 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +40 -2
- data/Gemfile +1 -0
- data/README.md +21 -2
- data/Rakefile +1 -1
- data/bin/inspec +25 -3
- data/bin/os +23 -0
- data/docs/dsl_resource.rst +90 -0
- data/docs/profiles.rst +167 -0
- data/docs/resources.rst +79 -0
- data/examples/README.md +1 -0
- data/examples/kitchen-ansible/.kitchen/logs/default-centos-71.log +0 -0
- data/examples/kitchen-ansible/.kitchen/logs/default-ubuntu-1204.log +0 -0
- data/examples/kitchen-ansible/.kitchen/logs/default-ubuntu-1404.log +432 -0
- data/examples/kitchen-ansible/.kitchen/logs/kitchen.log +10 -0
- data/examples/kitchen-ansible/Gemfile.lock +154 -0
- data/examples/kitchen-chef/.kitchen/default-centos-71.yml +6 -0
- data/examples/kitchen-chef/.kitchen/default-ubuntu-1204.yml +6 -0
- data/examples/kitchen-chef/.kitchen/default-ubuntu-1404.yml +6 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/id +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/Vagrantfile +9 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/id +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/Vagrantfile +9 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/Vagrantfile +9 -0
- data/examples/kitchen-chef/.kitchen/logs/default-centos-71.log +4 -0
- data/examples/kitchen-chef/.kitchen/logs/default-ubuntu-1204.log +4 -0
- data/examples/kitchen-chef/.kitchen/logs/default-ubuntu-1404.log +4 -0
- data/examples/kitchen-chef/.kitchen/logs/kitchen.log +8 -0
- data/examples/kitchen-chef/Berksfile.lock +11 -0
- data/examples/kitchen-chef/Gemfile.lock +223 -0
- data/examples/kitchen-puppet/.bundle/config +2 -0
- data/examples/kitchen-puppet/.kitchen/logs/default-centos-71.log +0 -0
- data/examples/kitchen-puppet/.kitchen/logs/default-ubuntu-1204.log +0 -0
- data/examples/kitchen-puppet/.kitchen/logs/default-ubuntu-1404.log +306 -0
- data/examples/kitchen-puppet/.kitchen/logs/kitchen.log +10 -0
- data/examples/kitchen-puppet/.librarian/puppet/config +2 -0
- data/examples/kitchen-puppet/Gemfile.lock +174 -0
- data/examples/kitchen-puppet/Puppetfile.lock +2 -0
- data/examples/profile/README.md +30 -0
- data/examples/profile/controls/example.rb +14 -0
- data/examples/profile/controls/gordon.rb +20 -0
- data/examples/profile/inspec.yml +10 -0
- data/examples/profile/libraries/.DS_Store +0 -0
- data/examples/profile/libraries/gordon_config.rb +17 -0
- data/examples/test-kitchen/.kitchen/logs/default-centos-71.log +5 -0
- data/examples/test-kitchen/.kitchen/logs/default-ubuntu-1204.log +5 -0
- data/examples/test-kitchen/.kitchen/logs/default-ubuntu-1404.log +5 -0
- data/examples/test-kitchen/.kitchen/logs/kitchen.log +5 -0
- data/examples/test-kitchen/Berksfile.lock +11 -0
- data/examples/test-kitchen/Gemfile.lock +233 -0
- data/inspec.gemspec +1 -1
- data/lib/.DS_Store +0 -0
- data/lib/inspec/archive/tar.rb +29 -0
- data/lib/inspec/archive/zip.rb +19 -0
- data/lib/inspec/metadata.rb +110 -15
- data/lib/inspec/profile.rb +88 -19
- data/lib/inspec/profile_context.rb +10 -4
- data/lib/inspec/resource.rb +1 -0
- data/lib/inspec/runner.rb +21 -4
- data/lib/inspec/targets.rb +2 -1
- data/lib/inspec/targets/archive.rb +39 -0
- data/lib/inspec/targets/core.rb +2 -2
- data/lib/inspec/targets/dir.rb +18 -2
- data/lib/inspec/targets/file.rb +4 -0
- data/lib/inspec/targets/folder.rb +21 -11
- data/lib/inspec/targets/tar.rb +36 -5
- data/lib/inspec/targets/url.rb +45 -13
- data/lib/inspec/targets/zip.rb +22 -15
- data/lib/inspec/version.rb +1 -1
- data/lib/matchers/matchers.rb +30 -0
- data/lib/resources/certificate.rb +0 -0
- data/lib/resources/etc_group.rb +1 -1
- data/lib/resources/file.rb +28 -3
- data/lib/resources/mount.rb +57 -0
- data/lib/resources/passwd.rb +1 -1
- data/lib/resources/private_key.rb +0 -0
- data/lib/resources/user.rb +3 -2
- data/lib/utils/hash.rb +29 -1
- data/lib/utils/parser.rb +34 -1
- data/lib/utils/simpleconfig.rb +1 -1
- data/test/chefdk/.gitignore +16 -0
- data/test/chefdk/.kitchen.yml +27 -0
- data/test/chefdk/Policyfile.rb +16 -0
- data/test/chefdk/README.md +4 -0
- data/test/chefdk/chefignore +100 -0
- data/test/chefdk/metadata.rb +7 -0
- data/test/chefdk/recipes/default.rb +5 -0
- data/test/chefdk/spec/spec_helper.rb +2 -0
- data/test/chefdk/spec/unit/recipes/default_spec.rb +20 -0
- data/test/chefdk/test/integration/default/serverspec/default_spec.rb +9 -0
- data/test/chefdk/test/integration/helpers/serverspec/spec_helper.rb +8 -0
- data/test/helper.rb +3 -1
- data/test/integration/.DS_Store +0 -0
- data/test/integration/.kitchen.ec2.yml +67 -0
- data/test/integration/.kitchen.local.yml +68 -0
- data/test/integration/.kitchen/default-aws-linux.yml +4 -0
- data/test/integration/.kitchen/default-centos-511.yml +6 -0
- data/test/integration/.kitchen/default-centos-67.yml +6 -0
- data/test/integration/.kitchen/default-centos-7.yml +4 -0
- data/test/integration/.kitchen/default-centos-71.yml +6 -0
- data/test/integration/.kitchen/default-debian-6010.yml +6 -0
- data/test/integration/.kitchen/default-debian-78.yml +6 -0
- data/test/integration/.kitchen/default-debian-8.yml +4 -0
- data/test/integration/.kitchen/default-debian-81.yml +6 -0
- data/test/integration/.kitchen/default-fedora-21.yml +6 -0
- data/test/integration/.kitchen/default-fedora-22.yml +4 -0
- data/test/integration/.kitchen/default-freebsd-102.yml +6 -0
- data/test/integration/.kitchen/default-freebsd-93.yml +6 -0
- data/test/integration/.kitchen/default-opensuse-132-x86-64.yml +6 -0
- data/test/integration/.kitchen/default-redhat-65.yml +4 -0
- data/test/integration/.kitchen/default-redhat-71.yml +4 -0
- data/test/integration/.kitchen/default-suse-11sp3.yml +4 -0
- data/test/integration/.kitchen/default-suse-12.yml +4 -0
- data/test/integration/.kitchen/default-ubuntu-1004.yml +6 -0
- data/test/integration/.kitchen/default-ubuntu-1204.yml +4 -0
- data/test/integration/.kitchen/default-ubuntu-1404.yml +4 -0
- data/test/integration/.kitchen/default-ubuntu-1510.yml +4 -0
- data/test/integration/.kitchen/default-windows-2012.yml +5 -0
- data/test/integration/.kitchen/default-windows-2012r2.yml +6 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67-i386/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/Vagrantfile +9 -0
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-new-ubuntu-1404/Vagrantfile +9 -0
- data/test/integration/.kitchen/logs/default-aws-linux.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-511-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-511.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-67-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-67.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-7.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-71.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-6010-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-6010.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-78-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-78.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-8.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-81-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-81.log +0 -0
- data/test/integration/.kitchen/logs/default-fedora-21-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-fedora-21.log +0 -0
- data/test/integration/.kitchen/logs/default-fedora-22.log +0 -0
- data/test/integration/.kitchen/logs/default-freebsd-102.log +0 -0
- data/test/integration/.kitchen/logs/default-freebsd-93.log +0 -0
- data/test/integration/.kitchen/logs/default-mint-172-cinnamon.log +0 -0
- data/test/integration/.kitchen/logs/default-opensuse-132-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-opensuse-132-x86-64.log +0 -0
- data/test/integration/.kitchen/logs/default-redhat-65.log +0 -0
- data/test/integration/.kitchen/logs/default-redhat-71.log +0 -0
- data/test/integration/.kitchen/logs/default-suse-11sp3.log +0 -0
- data/test/integration/.kitchen/logs/default-suse-12.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1004-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1004.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1204-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1204.log +23 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1404-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1404.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1510.log +0 -0
- data/test/integration/.kitchen/logs/default-windows-2012.log +0 -0
- data/test/integration/.kitchen/logs/default-windows-2012r2.log +0 -0
- data/test/integration/.kitchen/logs/kitchen.log +3 -0
- data/test/integration/.kitchen/logs/new-centos-511-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-centos-511.log +0 -0
- data/test/integration/.kitchen/logs/new-centos-67-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-centos-67.log +0 -0
- data/test/integration/.kitchen/logs/new-centos-71.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-6010-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-6010.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-78-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-78.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-81-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-81.log +0 -0
- data/test/integration/.kitchen/logs/new-fedora-21-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-fedora-21.log +0 -0
- data/test/integration/.kitchen/logs/new-fedora-22.log +0 -0
- data/test/integration/.kitchen/logs/new-freebsd-102.log +0 -0
- data/test/integration/.kitchen/logs/new-freebsd-93.log +0 -0
- data/test/integration/.kitchen/logs/new-opensuse-132-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-opensuse-132-x86-64.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1004-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1004.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1204-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1204.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1404-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1404.log +3 -0
- data/test/integration/.kitchen/logs/test-centos-511-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-centos-511.log +0 -0
- data/test/integration/.kitchen/logs/test-centos-67-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-centos-67.log +0 -0
- data/test/integration/.kitchen/logs/test-centos-71.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-6010-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-6010.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-78-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-78.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-81-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-81.log +0 -0
- data/test/integration/.kitchen/logs/test-fedora-21-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-fedora-21.log +0 -0
- data/test/integration/.kitchen/logs/test-fedora-22.log +0 -0
- data/test/integration/.kitchen/logs/test-freebsd-102.log +0 -0
- data/test/integration/.kitchen/logs/test-freebsd-93.log +0 -0
- data/test/integration/.kitchen/logs/test-opensuse-132-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-opensuse-132-x86-64.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1004-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1004.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1204-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1204.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1404-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1404.log +0 -0
- data/test/integration/.kitchen/new-ubuntu-1404.yml +1 -0
- data/test/integration/Berksfile.lock +11 -0
- data/test/integration/TODO.md +15 -0
- data/test/integration/cookbooks/os_prepare/recipes/default.rb +1 -0
- data/test/integration/cookbooks/os_prepare/recipes/json_yaml_csv_ini.rb +13 -6
- data/test/integration/cookbooks/os_prepare/recipes/mount.rb +29 -0
- data/test/integration/test/.DS_Store +0 -0
- data/test/integration/test/integration/.DS_Store +0 -0
- data/test/integration/test/integration/default/.DS_Store +0 -0
- data/test/integration/test/integration/default/certificate_spec.rb +7 -0
- data/test/integration/test/integration/default/csv_spec.rb +7 -1
- data/test/integration/test/integration/default/file_spec.rb +29 -0
- data/test/integration/test/integration/default/ini_spec.rb +7 -1
- data/test/integration/test/integration/default/json_spec.rb +7 -1
- data/test/integration/test/integration/default/mount_spec.rb +10 -0
- data/test/integration/test/integration/default/yaml_spec.rb +7 -1
- data/test/serverspec/.kitchen.yml +18 -0
- data/test/serverspec/.kitchen/default-ubuntu-1404.yml +6 -0
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +1 -0
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -0
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -0
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +27 -0
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +1 -0
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/Vagrantfile +9 -0
- data/test/serverspec/.kitchen/logs/default-ubuntu-1404.log +2 -0
- data/test/serverspec/.kitchen/logs/kitchen.log +3 -0
- data/test/serverspec/Berksfile +3 -0
- data/test/serverspec/Berksfile.lock +5 -0
- data/test/serverspec/TODO.md +2 -0
- data/test/serverspec/test/integration/default/serverspec/os_spec.rb +25 -0
- data/test/serverspec/test/integration/default/serverspec/spec_helper.rb +48 -0
- data/test/serverspec/test/integration/default/serverspec/sysctl_spec.rb +37 -0
- data/test/unit/metadata_test.rb +69 -0
- data/test/unit/mock/cmd/mount +1 -0
- data/test/unit/mock/cmd/mount-multiple +2 -0
- data/test/unit/mock/profiles/complete-meta/metadata.rb +7 -0
- data/test/unit/mock/profiles/complete-meta/test/.gitkeep +0 -0
- data/test/unit/mock/profiles/complete-profile/controls/filesystem_spec.rb +16 -0
- data/test/unit/mock/profiles/complete-profile/inspec.yml +10 -0
- data/test/unit/profile_context_test.rb +2 -2
- data/test/unit/profile_test.rb +63 -6
- data/test/unit/resources/file_test.rb +4 -0
- data/test/unit/resources/mount_test.rb +26 -0
- data/test/unit/utils/{content_parser_test.rb → passwd_parser_test.rb} +2 -2
- metadata +588 -5
@@ -0,0 +1,57 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# author: Christoph Hartmann
|
3
|
+
# author: Dominik Richter
|
4
|
+
|
5
|
+
require 'utils/simpleconfig'
|
6
|
+
|
7
|
+
class Mount < Inspec.resource(1)
|
8
|
+
name 'mount'
|
9
|
+
desc 'Use the mount InSpec audit resource to test if mount points.'
|
10
|
+
example "
|
11
|
+
describe mount('/') do
|
12
|
+
it { should be_mounted }
|
13
|
+
its(:count) { should eq 1 }
|
14
|
+
its('device') { should eq '/dev/mapper/VolGroup-lv_root' }
|
15
|
+
its('type') { should eq 'ext4' }
|
16
|
+
its('options') { should eq ['rw', 'mode=620'] }
|
17
|
+
end
|
18
|
+
"
|
19
|
+
include MountParser
|
20
|
+
|
21
|
+
attr_reader :file
|
22
|
+
|
23
|
+
def initialize(path)
|
24
|
+
@path = path
|
25
|
+
return skip_resource 'The `mount` resource is not supported on your OS yet.' if !inspec.os.linux?
|
26
|
+
@file = inspec.backend.file(@path)
|
27
|
+
end
|
28
|
+
|
29
|
+
def mounted?
|
30
|
+
file.mounted?
|
31
|
+
end
|
32
|
+
|
33
|
+
def count
|
34
|
+
mounted = file.mounted
|
35
|
+
return nil if mounted.nil? || mounted.stdout.nil?
|
36
|
+
mounted.stdout.lines.count
|
37
|
+
end
|
38
|
+
|
39
|
+
def method_missing(name)
|
40
|
+
return nil if !file.mounted?
|
41
|
+
|
42
|
+
mounted = file.mounted
|
43
|
+
return nil if mounted.nil? || mounted.stdout.nil?
|
44
|
+
|
45
|
+
line = mounted.stdout
|
46
|
+
# if we got multiple lines, only use the last entry
|
47
|
+
line = mounted.stdout.lines.to_a.last if mounted.stdout.lines.count > 1
|
48
|
+
|
49
|
+
# parse content if we are on linux
|
50
|
+
@mount_options ||= parse_mount_options(line)
|
51
|
+
@mount_options[name]
|
52
|
+
end
|
53
|
+
|
54
|
+
def to_s
|
55
|
+
"Mount #{@path}"
|
56
|
+
end
|
57
|
+
end
|
data/lib/resources/passwd.rb
CHANGED
File without changes
|
data/lib/resources/user.rb
CHANGED
@@ -230,7 +230,8 @@ class UnixUser < UserInfo
|
|
230
230
|
end
|
231
231
|
|
232
232
|
class LinuxUser < UnixUser
|
233
|
-
include
|
233
|
+
include PasswdParser
|
234
|
+
include CommentParser
|
234
235
|
|
235
236
|
def meta_info(username)
|
236
237
|
cmd = inspec.command("getent passwd #{username}")
|
@@ -295,7 +296,7 @@ end
|
|
295
296
|
# - chpass(1) A flexible tool for changing user database information.
|
296
297
|
# - passwd(1) The command-line tool to change user passwords.
|
297
298
|
class FreeBSDUser < UnixUser
|
298
|
-
include
|
299
|
+
include PasswdParser
|
299
300
|
|
300
301
|
def meta_info(username)
|
301
302
|
cmd = inspec.command("pw usershow #{username} -7")
|
data/lib/utils/hash.rb
CHANGED
@@ -1,13 +1,41 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Inspired by: http://stackoverflow.com/a/9381776
|
3
2
|
# author: Dominik Richter
|
4
3
|
# author: Christoph Hartmann
|
5
4
|
|
6
5
|
class ::Hash
|
6
|
+
# Inspired by: http://stackoverflow.com/a/9381776
|
7
7
|
def deep_merge(second)
|
8
8
|
merger = proc { |_key, v1, v2|
|
9
9
|
v1.is_a?(Hash) && v2.is_a?(Hash) ? v1.merge(v2, &merger) : v2
|
10
10
|
}
|
11
11
|
merge(second, &merger)
|
12
12
|
end
|
13
|
+
|
14
|
+
# converts a deep hash into a flat hash
|
15
|
+
# hash = {
|
16
|
+
# 'a' => 1,
|
17
|
+
# 'b' => {'c' => 2},
|
18
|
+
# }
|
19
|
+
# hash.smash # => {"a"=>1, "b-c"=>2}
|
20
|
+
def smash(prefix = nil)
|
21
|
+
inject({}) do |acc, (key, value)|
|
22
|
+
index = prefix.to_s + key.to_s
|
23
|
+
if value.is_a?(Hash)
|
24
|
+
acc.merge(value.smash(index + '-'))
|
25
|
+
else
|
26
|
+
acc.merge(index => value)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# deep check if all values are contained
|
32
|
+
def contains(contains)
|
33
|
+
hash = smash
|
34
|
+
contains = contains.smash
|
35
|
+
|
36
|
+
contains.each do |key, val|
|
37
|
+
return false if hash[key] != val
|
38
|
+
end
|
39
|
+
true
|
40
|
+
end
|
13
41
|
end
|
data/lib/utils/parser.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# author: Christoph Hartmann
|
3
3
|
# author: Dominik Richter
|
4
4
|
|
5
|
-
module
|
5
|
+
module PasswdParser
|
6
6
|
# Parse /etc/passwd files.
|
7
7
|
#
|
8
8
|
# @param [String] content the raw content of /etc/passwd
|
@@ -29,7 +29,9 @@ module ContentParser
|
|
29
29
|
'shell' => x.at(6),
|
30
30
|
}
|
31
31
|
end
|
32
|
+
end
|
32
33
|
|
34
|
+
module CommentParser
|
33
35
|
# Parse a line with a command. For example: `a = b # comment`.
|
34
36
|
# Retrieves the actual content.
|
35
37
|
#
|
@@ -59,3 +61,34 @@ module ContentParser
|
|
59
61
|
[line, idx_nl]
|
60
62
|
end
|
61
63
|
end
|
64
|
+
|
65
|
+
module MountParser
|
66
|
+
# this parses the output of mount command (only tested on linux)
|
67
|
+
# this method expects only one line of the mount output
|
68
|
+
def parse_mount_options(mount_line, compatibility = false)
|
69
|
+
mount = mount_line.scan(/\S+/)
|
70
|
+
|
71
|
+
# parse device and type
|
72
|
+
mount_options = { device: mount[0], type: mount[4] }
|
73
|
+
|
74
|
+
if compatibility == false
|
75
|
+
# parse options as array
|
76
|
+
mount_options[:options] = mount[5].gsub(/\(|\)/, '').split(',')
|
77
|
+
else
|
78
|
+
# parse options as serverspec uses it, tbis is deprecated
|
79
|
+
mount_options[:options] = {}
|
80
|
+
mount[5].gsub(/\(|\)/, '').split(',').each do |option|
|
81
|
+
name, val = option.split('=')
|
82
|
+
if val.nil?
|
83
|
+
val = true
|
84
|
+
else
|
85
|
+
# parse numbers
|
86
|
+
val = val.to_i if val.match(/^\d+$/)
|
87
|
+
end
|
88
|
+
mount_options[:options][name.to_sym] = val
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
mount_options
|
93
|
+
end
|
94
|
+
end
|
data/lib/utils/simpleconfig.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
driver:
|
3
|
+
name: vagrant
|
4
|
+
|
5
|
+
## The forwarded_port port feature lets you connect to ports on the VM guest via
|
6
|
+
## localhost on the host.
|
7
|
+
## see also: https://docs.vagrantup.com/v2/networking/forwarded_ports.html
|
8
|
+
|
9
|
+
# network:
|
10
|
+
# - ["forwarded_port", {guest: 80, host: 8080}]
|
11
|
+
|
12
|
+
provisioner:
|
13
|
+
name: policyfile_zero
|
14
|
+
|
15
|
+
## require_chef_omnibus specifies a specific chef version to install. You can
|
16
|
+
## also set this to `true` to always use the latest version.
|
17
|
+
## see also: https://docs.chef.io/config_yml_kitchen.html
|
18
|
+
|
19
|
+
# require_chef_omnibus: 12.5.0
|
20
|
+
|
21
|
+
platforms:
|
22
|
+
- name: ubuntu-14.04
|
23
|
+
- name: centos-7.1
|
24
|
+
|
25
|
+
suites:
|
26
|
+
- name: default
|
27
|
+
attributes:
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Policyfile.rb - Describe how you want Chef to build your system.
|
2
|
+
#
|
3
|
+
# For more information on the Policyfile feature, visit
|
4
|
+
# https://github.com/opscode/chef-dk/blob/master/POLICYFILE_README.md
|
5
|
+
|
6
|
+
# A name that describes what the system you're building with Chef does.
|
7
|
+
name "chefdk"
|
8
|
+
|
9
|
+
# Where to find external cookbooks:
|
10
|
+
default_source :supermarket
|
11
|
+
|
12
|
+
# run_list: chef-client will run these recipes in the order specified.
|
13
|
+
run_list "chefdk::default"
|
14
|
+
|
15
|
+
# Specify a custom source for a single cookbook:
|
16
|
+
cookbook "chefdk", path: "."
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# Put files/directories that should be ignored in this file when uploading
|
2
|
+
# or sharing to the community site.
|
3
|
+
# Lines that start with '# ' are comments.
|
4
|
+
|
5
|
+
# OS generated files #
|
6
|
+
######################
|
7
|
+
.DS_Store
|
8
|
+
Icon?
|
9
|
+
nohup.out
|
10
|
+
ehthumbs.db
|
11
|
+
Thumbs.db
|
12
|
+
|
13
|
+
# SASS #
|
14
|
+
########
|
15
|
+
.sass-cache
|
16
|
+
|
17
|
+
# EDITORS #
|
18
|
+
###########
|
19
|
+
\#*
|
20
|
+
.#*
|
21
|
+
*~
|
22
|
+
*.sw[a-z]
|
23
|
+
*.bak
|
24
|
+
REVISION
|
25
|
+
TAGS*
|
26
|
+
tmtags
|
27
|
+
*_flymake.*
|
28
|
+
*_flymake
|
29
|
+
*.tmproj
|
30
|
+
.project
|
31
|
+
.settings
|
32
|
+
mkmf.log
|
33
|
+
|
34
|
+
## COMPILED ##
|
35
|
+
##############
|
36
|
+
a.out
|
37
|
+
*.o
|
38
|
+
*.pyc
|
39
|
+
*.so
|
40
|
+
*.com
|
41
|
+
*.class
|
42
|
+
*.dll
|
43
|
+
*.exe
|
44
|
+
*/rdoc/
|
45
|
+
|
46
|
+
# Testing #
|
47
|
+
###########
|
48
|
+
.watchr
|
49
|
+
.rspec
|
50
|
+
spec/*
|
51
|
+
spec/fixtures/*
|
52
|
+
test/*
|
53
|
+
features/*
|
54
|
+
examples/*
|
55
|
+
Guardfile
|
56
|
+
Procfile
|
57
|
+
.kitchen*
|
58
|
+
.rubocop.yml
|
59
|
+
|
60
|
+
# SCM #
|
61
|
+
#######
|
62
|
+
.git
|
63
|
+
*/.git
|
64
|
+
.gitignore
|
65
|
+
.gitmodules
|
66
|
+
.gitconfig
|
67
|
+
.gitattributes
|
68
|
+
.svn
|
69
|
+
*/.bzr/*
|
70
|
+
*/.hg/*
|
71
|
+
*/.svn/*
|
72
|
+
|
73
|
+
# Berkshelf #
|
74
|
+
#############
|
75
|
+
Berksfile
|
76
|
+
Berksfile.lock
|
77
|
+
cookbooks/*
|
78
|
+
tmp
|
79
|
+
|
80
|
+
# Cookbooks #
|
81
|
+
#############
|
82
|
+
CONTRIBUTING*
|
83
|
+
CHANGELOG*
|
84
|
+
TESTING*
|
85
|
+
|
86
|
+
# Strainer #
|
87
|
+
############
|
88
|
+
Colanderfile
|
89
|
+
Strainerfile
|
90
|
+
.colander
|
91
|
+
.strainer
|
92
|
+
|
93
|
+
# Vagrant #
|
94
|
+
###########
|
95
|
+
.vagrant
|
96
|
+
Vagrantfile
|
97
|
+
|
98
|
+
# Travis #
|
99
|
+
##########
|
100
|
+
.travis.yml
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: chefdk
|
3
|
+
# Spec:: default
|
4
|
+
#
|
5
|
+
# Copyright (c) 2015 The Authors, All Rights Reserved.
|
6
|
+
|
7
|
+
require 'spec_helper'
|
8
|
+
|
9
|
+
describe 'chefdk::default' do
|
10
|
+
context 'When all attributes are default, on an unspecified platform' do
|
11
|
+
let(:chef_run) do
|
12
|
+
runner = ChefSpec::ServerRunner.new
|
13
|
+
runner.converge(described_recipe)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'converges successfully' do
|
17
|
+
expect { chef_run }.to_not raise_error
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/test/helper.rb
CHANGED
@@ -196,7 +196,9 @@ class MockLoader
|
|
196
196
|
# apache_conf
|
197
197
|
'find /etc/apache2/ports.conf -maxdepth 1 -type f' => cmd.call('find-apache2-ports-conf'),
|
198
198
|
'find /etc/apache2/conf-enabled/*.conf -maxdepth 1 -type f' => cmd.call('find-apache2-conf-enabled'),
|
199
|
-
|
199
|
+
# mount
|
200
|
+
"mount | grep -- ' on /'" => cmd.call("mount"),
|
201
|
+
"mount | grep -- ' on /mnt/iso-disk'" => cmd.call("mount-multiple"),
|
200
202
|
}
|
201
203
|
|
202
204
|
@backend
|
Binary file
|
@@ -0,0 +1,67 @@
|
|
1
|
+
driver:
|
2
|
+
name: ec2
|
3
|
+
region: eu-central-1
|
4
|
+
instance_type: m3.large
|
5
|
+
associate_public_ip: true
|
6
|
+
interface: dns
|
7
|
+
|
8
|
+
transport:
|
9
|
+
ssh_key: /path/to/aws.pem
|
10
|
+
username: ec2-user
|
11
|
+
|
12
|
+
platforms:
|
13
|
+
- name: windows-2012
|
14
|
+
driver:
|
15
|
+
image_id: ami-58f7fb45
|
16
|
+
transport:
|
17
|
+
username: administrator
|
18
|
+
- name: windows-2012r2
|
19
|
+
driver:
|
20
|
+
image_id: ami-f2f5f9ef
|
21
|
+
transport:
|
22
|
+
username: administrator
|
23
|
+
- name: suse-11sp3
|
24
|
+
driver:
|
25
|
+
image_id: ami-fc0033e1
|
26
|
+
- name: suse-12
|
27
|
+
driver:
|
28
|
+
image_id: ami-a22610bf
|
29
|
+
- name: redhat-65
|
30
|
+
driver:
|
31
|
+
image_id: ami-008ebf1d
|
32
|
+
- name: redhat-71
|
33
|
+
driver:
|
34
|
+
image_id: ami-dafdcfc7
|
35
|
+
- name: ubuntu-1204
|
36
|
+
driver:
|
37
|
+
image_id: ami-24232f39
|
38
|
+
transport:
|
39
|
+
username: ubuntu
|
40
|
+
- name: ubuntu-1404
|
41
|
+
driver:
|
42
|
+
image_id: ami-48272b55
|
43
|
+
transport:
|
44
|
+
username: ubuntu
|
45
|
+
- name: ubuntu-1510
|
46
|
+
driver:
|
47
|
+
image_id: ami-1b4a5977
|
48
|
+
transport:
|
49
|
+
username: ubuntu
|
50
|
+
- name: fedora-22
|
51
|
+
driver:
|
52
|
+
image_id: ami-a88eb0b5
|
53
|
+
transport:
|
54
|
+
username: fedora
|
55
|
+
- name: debian-8
|
56
|
+
driver:
|
57
|
+
image_id: ami-b092aaad
|
58
|
+
transport:
|
59
|
+
username: admin
|
60
|
+
- name: centos-7
|
61
|
+
driver:
|
62
|
+
image_id: ami-e68f82fb
|
63
|
+
transport:
|
64
|
+
username: centos
|
65
|
+
- name: aws-linux
|
66
|
+
driver:
|
67
|
+
image_id: ami-daaeaec7
|