diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-05-24 13:50:05 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-05-24 13:50:05 -0700 |
commit | 040e7473b458d1c917291d9857c15848a647e126 (patch) | |
tree | 4f97d2561899e9ff854a66facb763658a36949e4 /kitchen-tests/cookbooks | |
parent | 37668e4b9a96b60c0a7ea5e7f9843c935163974a (diff) | |
download | chef-040e7473b458d1c917291d9857c15848a647e126.tar.gz |
convert kitchen tests to docker + other fixes
- use kitchen-dokken instead of kitchen-ec2
- add tests for gem metadata + chef-sugar
- convert to inspec and add some tests
this disables the webapp stuff completely and its testing for now, that
needs to be updated to more modern httpd/mysql cookbooks and have its
testing converted to inspec.
more O/S distros are also in the pipeline.
Diffstat (limited to 'kitchen-tests/cookbooks')
-rw-r--r-- | kitchen-tests/cookbooks/base/attributes/default.rb | 13 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/base/libraries/chef-sugar.rb | 4 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/base/metadata.rb | 4 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/base/recipes/default.rb | 6 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/base/recipes/packages.rb | 2 |
5 files changed, 22 insertions, 7 deletions
diff --git a/kitchen-tests/cookbooks/base/attributes/default.rb b/kitchen-tests/cookbooks/base/attributes/default.rb index d4e5d1ee5a..f3bcb4f21a 100644 --- a/kitchen-tests/cookbooks/base/attributes/default.rb +++ b/kitchen-tests/cookbooks/base/attributes/default.rb @@ -1,9 +1,12 @@ +puts "CHEF SUGAR THINKS WE ARE ON UBUNTU" if ubuntu? +puts "CHEF SUGAR THINKS WE ARE ON RHEL" if rhel? + # # ubuntu cookbook overrides # -default["ubuntu"]["archive_url"] = "mirror://mirrors.ubuntu.com/mirrors.txt" -default["ubuntu"]["security_url"] = "mirror://mirrors.ubuntu.com/mirrors.txt" +default["ubuntu"]["archive_url"] = "http://us-west-2.ec2.archive.ubuntu.com/ubuntu" +default["ubuntu"]["security_url"] = "http://us-west-2.ec2.archive.ubuntu.com/ubuntu" default["ubuntu"]["include_source_packages"] = true default["ubuntu"]["components"] = "main restricted universe multiverse" @@ -78,3 +81,9 @@ default["resolver"]["search"] = "chef.io" default["authorization"]["sudo"]["passwordless"] = true default["authorization"]["sudo"]["users"] = %w{vagrant centos ubuntu} + +# +# nscd cookbook overrides +# + +default["nscd"]["server_user"] = "nobody" diff --git a/kitchen-tests/cookbooks/base/libraries/chef-sugar.rb b/kitchen-tests/cookbooks/base/libraries/chef-sugar.rb new file mode 100644 index 0000000000..90d02a361f --- /dev/null +++ b/kitchen-tests/cookbooks/base/libraries/chef-sugar.rb @@ -0,0 +1,4 @@ +require "chef/sugar" + +# hack until this gets baked into chef-sugar so we can use chef-sugar in attributes files +Chef::Node.send(:include, Chef::Sugar::DSL) diff --git a/kitchen-tests/cookbooks/base/metadata.rb b/kitchen-tests/cookbooks/base/metadata.rb index 9e5e792f89..3811fe914d 100644 --- a/kitchen-tests/cookbooks/base/metadata.rb +++ b/kitchen-tests/cookbooks/base/metadata.rb @@ -6,10 +6,12 @@ description "Installs/Configures base" long_description "Installs/Configures base" version "0.1.0" +gem "chef-sugar" + depends "apt" depends "build-essential" depends "chef-client" -depends "fail2ban" +depends "chef_hostname" depends "logrotate" depends "multipackage" depends "nscd" diff --git a/kitchen-tests/cookbooks/base/recipes/default.rb b/kitchen-tests/cookbooks/base/recipes/default.rb index 4ddd7a7b04..be939b78e6 100644 --- a/kitchen-tests/cookbooks/base/recipes/default.rb +++ b/kitchen-tests/cookbooks/base/recipes/default.rb @@ -5,9 +5,11 @@ # Copyright (C) 2014 # +hostname "chef-travis-ci.chef.io" + if node[:platform_family] == "debian" - include_recipe "apt" include_recipe "ubuntu" + apt_update "packages" end if %w{rhel fedora}.include?(node[:platform_family]) @@ -33,8 +35,6 @@ include_recipe "chef-client" include_recipe "openssh" -include_recipe "fail2ban" - include_recipe "nscd" include_recipe "logrotate" diff --git a/kitchen-tests/cookbooks/base/recipes/packages.rb b/kitchen-tests/cookbooks/base/recipes/packages.rb index f242951a4c..c3a552b05c 100644 --- a/kitchen-tests/cookbooks/base/recipes/packages.rb +++ b/kitchen-tests/cookbooks/base/recipes/packages.rb @@ -1,6 +1,6 @@ -pkgs = %w{lsof tcpdump strace zsh dmidecode ltrace bc curl wget telnet subversion git traceroute htop iptraf tmux s3cmd sysbench } +pkgs = %w{lsof tcpdump strace zsh dmidecode ltrace bc curl wget telnet subversion git traceroute htop tmux s3cmd sysbench } # this deliberately calls the multipackage API N times in order to do one package installation in order to exercise the # multipackage cookbook. |