summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-sanity/chef-repo/cookbooks
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-os-chef/sdc-sanity/chef-repo/cookbooks')
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/attributes/default.rb1
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/recipes/setup_sanity.rb68
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/templates/default/BE-titan.properties.erb24
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/templates/default/sdc-sanity.yaml.erb82
4 files changed, 175 insertions, 0 deletions
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/attributes/default.rb b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/attributes/default.rb
new file mode 100644
index 0000000000..4287ca8617
--- /dev/null
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/attributes/default.rb
@@ -0,0 +1 @@
+# \ No newline at end of file
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/recipes/setup_sanity.rb b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/recipes/setup_sanity.rb
new file mode 100644
index 0000000000..7f0843d598
--- /dev/null
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/recipes/setup_sanity.rb
@@ -0,0 +1,68 @@
+tests_path = "/tmp/sdc-tests/"
+ci_test_suite = "sanity.xml"
+
+
+bash "extract asdc-tests" do
+ code <<-EOH
+ [ ! -d /tmp/sdc-tests/ ] && mkdir -p /tmp/sdc-tests
+ cd /tmp/sdc-tests
+ rm -rf *
+ /bin/tar -xf /root/chef-solo/cookbooks/sdc-sanity/files/default/asdc-tests.tar --strip-components=1 -C /tmp/sdc-tests
+ chmod -R 755 /tmp/sdc-tests
+ EOH
+end
+
+
+template "sdc-yaml-config" do
+ path "/tmp/sdc-tests/conf/sdc.yaml"
+ source "sdc-sanity.yaml.erb"
+ owner "root"
+ group "root"
+ mode "0755"
+ variables ({
+ :target_path => "#{tests_path}/target",
+ :catalogBE_ip => node['Nodes']['BE'],
+ :catalogBE_port => node['BE'][:http_port],
+ :webportal_ip => node['Nodes']['FE'],
+ :webportal_port => node['FE'][:http_port],
+ :titan_file => "/tmp/sdc-tests/conf/titan.properties",
+ :tests_path_ci => "#{tests_path}/CI/tests",
+ :components_path => "#{tests_path}/CI/components",
+ :importResourceConfigDir => "#{tests_path}/CI/importResource",
+ :importTypesDir => "#{tests_path}/CI/importTypesTest",
+ :importResourceTestsConfigDir => "#{tests_path}/CI/importResourceTests",
+ :ConfigurationFile => "#{tests_path}/conf/configuration.yaml",
+ :errorConfigurationFile => "#{tests_path}/conf/error-configuration.yaml",
+ :CASSANDRA_IP => node['Nodes']['CS'],
+ :CASSANDRA_PWD => node['cassandra'][:cassandra_password],
+ :CASSANDRA_USR => node['cassandra'][:cassandra_user]
+ })
+end
+
+
+replication_factor=1
+template "titan.properties" do
+ path "/tmp/sdc-tests/conf/titan.properties"
+ source "BE-titan.properties.erb"
+ owner "root"
+ group "root"
+ mode "0755"
+ variables({
+ :CASSANDRA_IP => node['Nodes']['CS'],
+ :CASSANDRA_PWD => node['cassandra'][:cassandra_password],
+ :CASSANDRA_USR => node['cassandra'][:cassandra_user],
+ :DC_NAME => "DC-"+node.chef_environment,
+ :rep_factor => replication_factor
+ })
+end
+
+
+bash "run asdc ci sanity tests" do
+ cwd "#{tests_path}"
+ code <<-EOH
+ jar_file=`ls asdc-tests-*-jar-with-dependencies.jar`
+ ./startTest.sh $jar_file #{ci_test_suite}
+ echo "return code from startTest.sh = [$?]"
+ EOH
+ timeout 72000
+end
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/templates/default/BE-titan.properties.erb b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/templates/default/BE-titan.properties.erb
new file mode 100644
index 0000000000..27386d47ef
--- /dev/null
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/templates/default/BE-titan.properties.erb
@@ -0,0 +1,24 @@
+storage.backend=cassandra
+storage.hostname=<%= @CASSANDRA_IP %>
+storage.port=9160
+storage.username=<%= @CASSANDRA_USR %>
+storage.password=<%= @CASSANDRA_PWD %>
+storage.connection-timeout=10000
+
+storage.cassandra.ssl.enabled=false
+storage.cassandra.ssl.truststore.location=/var/lib/jetty/config/.truststore
+storage.cassandra.ssl.truststore.password=Aa123456
+
+cache.db-cache = false
+cache.db-cache-clean-wait = 20
+cache.db-cache-time = 180000
+cache.db-cache-size = 0.5
+
+storage.cassandra.read-consistency-level=LOCAL_QUORUM
+storage.cassandra.write-consistency-level=LOCAL_QUORUM
+storage.cassandra.replication-strategy-class=org.apache.cassandra.locator.NetworkTopologyStrategy
+storage.cassandra.replication-strategy-options=<%= @DC_NAME %>,<%= @rep_factor %>
+storage.cassandra.astyanax.local-datacenter=<%= @DC_NAME %>
+
+storage.lock.retries=5
+storage.lock.wait-time=500
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/templates/default/sdc-sanity.yaml.erb b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/templates/default/sdc-sanity.yaml.erb
new file mode 100644
index 0000000000..91c09db818
--- /dev/null
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/templates/default/sdc-sanity.yaml.erb
@@ -0,0 +1,82 @@
+outputFolder: <%= @target_path %>
+reportName: index.html
+esHost: eshost
+disributionClientHost: disClient
+catalogFeHost: <%= @webportal_ip %>
+catalogFePort: <%= @webportal_port %>
+catalogBeHost: <%= @catalogBE_ip %>
+catalogBePort: <%= @catalogBE_port %>
+disributionClientPort: 8181
+esPort: 9200
+
+
+resourceConfigDir: <%= @tests_path_ci %>
+componentsConfigDir: <%= @components_path %>
+importResourceConfigDir: <%= @importResourceConfigDir %>
+importResourceTestsConfigDir: <%= @importResourceTestsConfigDir %>
+errorConfigurationFile: <%= @errorConfigurationFile %>
+configurationFile: <%= @ConfigurationFile %>
+importTypesConfigDir: <%= @importTypesDir %>
+titanPropertiesFile: <%= @titan_file %>
+
+cassandraHost: <%= @CASSANDRA_IP %>
+cassandraAuthenticate: true
+cassandraUsername: <%= @CASSANDRA_USR %>
+cassandraPassword: <%= @CASSANDRA_PWD %>
+cassandraSsl: false
+cassandraTruststorePath : /tmp/.truststore
+cassandraTruststorePassword : Aa123456
+cassandraAuditKeySpace: sdcAudit
+cassandraArtifactKeySpace: sdcArtifact
+
+stopOnClassFailure: false
+
+#List of non-abstract resources to keep during titan cleanup between tests
+#Only 1.0 version will be kept
+resourcesNotToDelete:
+ - Compute
+ - Database
+ - ObjectStorage
+ - BlockStorage
+ - LoadBalancer
+ - Port
+ - Network
+ - Root
+ - ContainerApplication
+ - ContainerRuntime
+ - DBMS
+ - SoftwareComponent
+ - WebApplication
+ - WebServer
+ - CinderVolume
+ - ContrailVirtualNetwork
+ - NeutronNet
+ - NeutronPort
+ - NovaServer
+ - AbstractSubstitute
+ - ContrailAbstractSubstitute
+ - ContrailCompute
+ - ContrailNetworkRules
+ - ContrailPort
+ - ContrailV2NetworkRules
+ - ContrailV2VirtualMachineInterface
+ - ContrailV2VirtualNetwork
+ - ContrailVirtualNetwork
+ - VL ELINE
+ - SecurityRules
+ - VL
+#Resource categories to keep (including all their subcategories)
+resourceCategoriesNotToDelete:
+ - Generic
+ - Network L2-3
+ - Network L4+
+ - Application L4+
+ - Network Connectivity
+ - DcaeComponent
+
+#Service categories to keep
+serviceCategoriesNotToDelete:
+ - Mobility
+ - Network L1-3
+ - Network L4+
+ - VoIP Call Control