Formulas testing revision 2019/10

Related: PROD-32744
Related: PROD-33698

Change-Id: I3b48c4070558ec1128a35292a55afe5f410a208c
diff --git a/.kitchen.yml b/.kitchen.yml
index c39dae4..e460dd4 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -23,6 +23,10 @@
       repo: git
       source: https://gerrit.mcp.mirantis.com/salt-formulas/apache
       branch: <%=ENV['GERRIT_BRANCH'] || 'master' %>
+    - name: oslo_templates
+      repo: git
+      source: https://gerrit.mcp.mirantis.com/salt-formulas/oslo-templates
+      branch: <%=ENV['GERRIT_BRANCH'] || 'master' %>
   state_top:
     base:
       "*":
@@ -43,8 +47,7 @@
   sudo: true
 
 docker_images:
-  - &xenial-20177 <%=ENV['IMAGE_XENIAL_20177'] || 'docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-2017.7/salt:2018_11_19'%>
-  - &xenial-stable <%=ENV['IMAGE_XENIAL_STABLE'] || 'docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-stable/salt:2018_11_19'%>
+  - &xenial-20177 <%=ENV['IMAGE_XENIAL_20177'] || 'docker-dev-local.docker.mirantis.net/mirantis/drivetrain/salt-formulas-ci/salt-formulas-ci-xenial-2017.7:latest'%>
 
 platforms:
   - name: xenial-2017.7
@@ -52,73 +55,71 @@
       image: *xenial-20177
       platform: ubuntu
 
-  - name: xenial-stable
-    driver_config:
-      image: *xenial-stable
-      platform: ubuntu
-
 suites:
-  - name: server_cluster_pike_40_file
+<% versions = { "pike" => "4.0", "queens" => "4.2" } %>
+<% versions.each do |os_version, gnocchi_version| %>
+  - name: server_cluster_<%=os_version%>_<%=gnocchi_version%>_file
     provisioner:
       pillars-from-files:
         gnocchi.sls: tests/pillar/server_cluster.sls
-        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_pike.sls
+        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_<%=os_version%>.sls
       pillars:
         release.sls:
           gnocchi:
             common:
-              version: '4.0'
+              version: '<%=gnocchi_version%>'
         storage.sls:
           gnocchi:
             common:
               storage:
                 driver: file
 
-  - name: server_single_pike_40_file
+  - name: server_single_<%=os_version%>_<%=gnocchi_version%>_file
     provisioner:
       pillars-from-files:
         gnocchi.sls: tests/pillar/server_single.sls
-        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_pike.sls
+        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_<%=os_version%>.sls
       pillars:
         release.sls:
           gnocchi:
             common:
-              version: '4.0'
+              version: '<%=gnocchi_version%>'
         storage.sls:
           gnocchi:
             common:
               storage:
                 driver: file
 
-  - name: server_cluster_pike_40_redis
+  - name: server_cluster_<%=os_version%>_<%=gnocchi_version%>_redis
     provisioner:
       pillars-from-files:
         gnocchi.sls: tests/pillar/server_cluster.sls
-        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_pike.sls
+        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_<%=os_version%>.sls
       pillars:
         release.sls:
           gnocchi:
             common:
-              version: '4.0'
+              version: '<%=gnocchi_version%>'
         storage.sls:
           gnocchi:
             common:
               storage:
                 driver: redis
 
-  - name: server_single_pike_40_redis
+  - name: server_single_<%=os_version%>_<%=gnocchi_version%>_redis
     provisioner:
       pillars-from-files:
         gnocchi.sls: tests/pillar/server_single.sls
-        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_pike.sls
+        linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_<%=os_version%>.sls
       pillars:
         release.sls:
           gnocchi:
             common:
-              version: '4.0'
+              version: '<%=gnocchi_version%>'
         storage.sls:
           gnocchi:
             common:
               storage:
                 driver: redis
+<% end %>
 # vim: ft=yaml sw=2 ts=2 sts=2 tw=125
diff --git a/gnocchi/files/4.2/gnocchi.conf b/gnocchi/files/4.2/gnocchi.conf
index 676fe4b..0ad6b09 100644
--- a/gnocchi/files/4.2/gnocchi.conf
+++ b/gnocchi/files/4.2/gnocchi.conf
@@ -124,7 +124,7 @@
 #operation_timeout = 10
 {%- if server.get('api', {}).refresh_timeout is defined %}
 operation_timeout = {{ server.api.refresh_timeout }}
-{%- elif server.api.operation_timeout is defined %}
+{%- elif server.get('api', {}).operation_timeout is defined %}
 operation_timeout = {{ server.api.operation_timeout }}
 {%- endif %}
 
diff --git a/gnocchi/files/4.3/gnocchi.conf b/gnocchi/files/4.3/gnocchi.conf
index 59868f4..f24765b 100644
--- a/gnocchi/files/4.3/gnocchi.conf
+++ b/gnocchi/files/4.3/gnocchi.conf
@@ -124,7 +124,7 @@
 #operation_timeout = 10
 {%- if server.get('api', {}).refresh_timeout is defined %}
 operation_timeout = {{ server.api.refresh_timeout }}
-{%- elif server.api.operation_timeout is defined %}
+{%- elif server.get('api', {}).operation_timeout is defined %}
 operation_timeout = {{ server.api.operation_timeout }}
 {%- endif %}
 
diff --git a/tests/pillar/repo_mcp_openstack_pike.sls b/tests/pillar/repo_mcp_openstack_pike.sls
index 789b907..8905a98 100644
--- a/tests/pillar/repo_mcp_openstack_pike.sls
+++ b/tests/pillar/repo_mcp_openstack_pike.sls
@@ -3,10 +3,10 @@
     enabled: true
     repo:
       mirantis_openstack_repo:
-        source: "deb http://mirror.fuel-infra.org/mcp-repos/pike/{{ grains.get('oscodename') }} pike main"
+        source: "deb http://mirror.mirantis.com/nightly/openstack-pike/{{ grains.get('oscodename') }} {{ grains.get('oscodename') }} main"
         architectures: amd64
-        key_url: "http://mirror.fuel-infra.org/mcp-repos/pike/{{ grains.get('oscodename') }}/archive-mcppike.key"
+        key_url: "http://mirror.mirantis.com/nightly/openstack-pike/{{ grains.get('oscodename') }}/archive-pike.key"
         pin:
-        - pin: 'release a=pike'
+        - pin: 'release l=pike'
           priority: 1050
           package: '*'
\ No newline at end of file
diff --git a/tests/pillar/repo_mcp_openstack_queens.sls b/tests/pillar/repo_mcp_openstack_queens.sls
new file mode 100644
index 0000000..a8c7e77
--- /dev/null
+++ b/tests/pillar/repo_mcp_openstack_queens.sls
@@ -0,0 +1,12 @@
+linux:
+  system:
+    enabled: true
+    repo:
+      mirantis_openstack_repo:
+        source: "deb http://mirror.mirantis.com/nightly/openstack-queens/{{ grains.get('oscodename') }} {{ grains.get('oscodename') }} main"
+        architectures: amd64
+        key_url: "http://mirror.mirantis.com/nightly/openstack-queens/{{ grains.get('oscodename') }}/archive-queens.key"
+        pin:
+        - pin: 'release l=queens'
+          priority: 1050
+          package: '*'
\ No newline at end of file