From df5b682fc685f06c850a092f235a1725638c2827 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Sat, 24 Dec 2016 10:19:00 -0500 Subject: [PATCH] Updated kitchen suite to use new testing methods and integration test --- .kitchen.yml | 30 +++++++++---------- test/fixtures/environments/test.json | 17 +++++++++++ .../serverspec/debian_spec.rb | 2 +- 3 files changed, 32 insertions(+), 17 deletions(-) create mode 100644 test/fixtures/environments/test.json rename test/integration/{debian => default}/serverspec/debian_spec.rb (85%) diff --git a/.kitchen.yml b/.kitchen.yml index 285e67a..51de9a0 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,28 +1,26 @@ --- driver: - name: vagrant + name: vagrant provisioner: - name: chef_zero - environments_path: test/environments - chef_client_path: /usr/bin/chef-client - client_rb: - environment: integration_test_env + name: chef_zero + nodes_path: test/fixtures/nodes + clients_path: test/fixtures/clients + environments_path: test/fixtures/environments + data_bags_path: test/fixtures/data_bags + chef_client_path: /usr/bin/chef-client + client_rb: + environment: test platforms: - - name: deb8 - driver: - box: lh-debian - box_url: http://repos.home.ld/vagrant/box/lh-debian.json - vm_hostname: integration.deb.test - vagrantfile_erb: test/Vagrantfile.erb - require_chef_omnibus: false + - name: debian-8.6 + driver_config: + vm_hostname: integration.deb.test + require_chef_omnibus: false suites: - - name: deb8 + - name: default run_list: - recipe[apt-zabbix::default] attributes: - includes: - - deb8 diff --git a/test/fixtures/environments/test.json b/test/fixtures/environments/test.json new file mode 100644 index 0000000..e065983 --- /dev/null +++ b/test/fixtures/environments/test.json @@ -0,0 +1,17 @@ +{ + "id": "test", + "name": "test", + "description": "placeholder for integration testing", + "cookbook_versions": { + + }, + "json_class": "Chef::Environment", + "chef_type": "environment", + "default_attributes": { + + }, + "override_attributes": { + + } +} + diff --git a/test/integration/debian/serverspec/debian_spec.rb b/test/integration/default/serverspec/debian_spec.rb similarity index 85% rename from test/integration/debian/serverspec/debian_spec.rb rename to test/integration/default/serverspec/debian_spec.rb index 958696a..242c390 100644 --- a/test/integration/debian/serverspec/debian_spec.rb +++ b/test/integration/default/serverspec/debian_spec.rb @@ -16,7 +16,7 @@ describe 'apt-zabbix::default' do it { should be_mode 644 } it { should be_owned_by 'root' } it { should be_grouped_into 'root' } - its(:content) { shoult match('deb ... jessie contrib non-free main') } + its(:content) { should match('deb "http://repo.zabbix.com/zabbix/3.0/debian" jessie main') } end end end