introduce test-kitchen
Change-Id: I4e230f4a564ead75829a9016eafd0b7ca0825086
Implements: blueprint service-level-testing
diff --git a/tests/integration/control-cluster/inspec/control-cluster_spec.rb b/tests/integration/control-cluster/inspec/control-cluster_spec.rb
new file mode 100644
index 0000000..e6d422e
--- /dev/null
+++ b/tests/integration/control-cluster/inspec/control-cluster_spec.rb
@@ -0,0 +1,35 @@
+
+neutron = {
+ user: 'root',
+ group: 'neutron',
+}
+
+
+# TODO, load from control-single
+control 'neutron control' do
+ describe file('/etc/neutron/neutron.conf') do
+ it { should exist }
+ it { should be_owned_by neutron[:user] }
+ it { should be_grouped_into neutron[:group] }
+ end
+
+ describe file('/var/log/neutron') do
+ it { should be_directory }
+ end
+
+ describe file('/var/lib/neutron') do
+ it { should be_directory }
+ end
+end
+
+
+# FIXME, there is no opencontrail plugin installed nor configured
+# is the metadata dependency missing?
+#control 'neutron control cluster' do
+ #describe file('/etc/neutron/neutron.conf') do
+ #its ('content') { should match('^core_plugin.*opencontrail.*')}
+ #end
+ #describe file('/etc/neutron/plugins/opencontrail') do
+ #it { should be_directory }
+ #end
+#end
diff --git a/tests/integration/control-single/inspec/control_spec.rb b/tests/integration/control-single/inspec/control_spec.rb
new file mode 100644
index 0000000..f32f926
--- /dev/null
+++ b/tests/integration/control-single/inspec/control_spec.rb
@@ -0,0 +1,50 @@
+
+# TODO, enable helper files once resolved - https://github.com/chef/kitchen-inspec/issues/93
+#require 'neutron_spec'
+#require 'spec_helper'
+
+neutron = {
+ user: 'root',
+ group: 'neutron',
+}
+
+# TODO, pay attention/fix the cfg file ownership
+# -rw-r--r-- 1 root neutron 1017 Jun 18 2015 api-paste.ini
+# -rw-r--r-- 1 root neutron 109 Jun 18 2015 fwaas_driver.ini
+# -rw-r--r-- 1 root neutron 3109 Jun 18 2015 l3_agent.ini
+# -rw-r--r-- 1 root root 1400 Jun 18 2015 lbaas_agent.ini
+# -rw-r--r-- 1 root neutron 17867 Mar 9 18:42 neutron.conf
+# drwxr-xr-x 3 root neutron 4096 Jul 8 06:37 plugins/
+# -rw-r--r-- 1 root neutron 5858 Jun 18 2015 policy.json
+# -rw-r--r-- 1 root root 1216 Jun 18 2015 rootwrap.conf
+# drwxr-xr-x 2 root root 4096 Jul 8 06:38 rootwrap.d/
+# -rw-r--r-- 1 root neutron 526 Jun 18 2015 vpn_agent.ini
+
+# TODO, replace with shared controls
+control 'neutron control' do
+ describe file('/etc/neutron/neutron.conf') do
+ it { should exist }
+ it { should be_owned_by neutron[:user] }
+ it { should be_grouped_into neutron[:group] }
+ end
+
+ describe file('/var/log/neutron') do
+ it { should be_directory }
+ end
+
+ describe file('/var/lib/neutron') do
+ it { should be_directory }
+ end
+end
+
+control 'neutron control single' do
+ describe file('/etc/neutron/neutron.conf') do
+ its ('content') { should match('^core_plugin = neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCore')}
+ its ('content') { should match('^vif_types = vrouter')}
+ end
+
+ describe file('/etc/neutron/plugins/ml2') do
+ it { should be_directory }
+ end
+end
+
diff --git a/tests/integration/default/inspec/smoke_spec.rb b/tests/integration/default/inspec/smoke_spec.rb
new file mode 100644
index 0000000..d30f4f6
--- /dev/null
+++ b/tests/integration/default/inspec/smoke_spec.rb
@@ -0,0 +1,7 @@
+
+control "Check run_test.sh" do
+ describe file('/tmp/kitchen/tests/run_tests.sh') do
+ it {should be_file}
+ it {should be_executable}
+ end
+end
diff --git a/tests/pillar/control_cluster.sls b/tests/pillar/control_cluster.sls
index 910265b..99f1048 100644
--- a/tests/pillar/control_cluster.sls
+++ b/tests/pillar/control_cluster.sls
@@ -7,6 +7,12 @@
version: liberty
backend:
engine: contrail
+ host: contrail_discovery_host
+ port: 8082
+ user: admin
+ password: password
+ tenant: admin
+ token: token
bind:
address: 127.0.0.1
port: 9696
@@ -39,4 +45,4 @@
region: RegionOne
user: nova
password: password
- tenant: service
\ No newline at end of file
+ tenant: service
diff --git a/tests/pillar/control_single.sls b/tests/pillar/control_single.sls
index 15f7a8c..0ae2325 100644
--- a/tests/pillar/control_single.sls
+++ b/tests/pillar/control_single.sls
@@ -3,6 +3,12 @@
enabled: true
backend:
engine: contrail
+ host: contrail_discovery_host
+ port: 8082
+ user: admin
+ password: password
+ tenant: admin
+ token: token
fwaas: false
dns_domain: novalocal
tunnel_type: vxlan
@@ -37,4 +43,4 @@
region: RegionOne
user: nova
password: password
- tenant: service
\ No newline at end of file
+ tenant: service