Merge "Fix typo in gating job"
diff --git a/lab-pipeline.groovy b/lab-pipeline.groovy
index b9ff840..55a021fd 100644
--- a/lab-pipeline.groovy
+++ b/lab-pipeline.groovy
@@ -33,6 +33,8 @@
  *   K8S_API_SERVER             Kubernetes API address
  *   K8S_CONFORMANCE_IMAGE      Path to docker image with conformance e2e tests
  *
+ *   TEMPEST_IMAGE_LINK         Tempest image link
+ *
  */
 
 git = new com.mirantis.mk.Git()
@@ -152,9 +154,10 @@
                         salt.runSaltProcessStep(saltMaster, '* and not kvm*', 'saltutil.sync_all', [], null, true)
 
                         // workaround - install apt-transport-https
-                        salt.runSaltProcessStep(saltMaster, '* and not kvm*', 'cmd.run', ['apt-get update -y && apt-get install -y apt-transport-https'], null, true)
-                        salt.runSaltProcessStep(saltMaster, '* and not kvm*', 'pkg.install', ['apt-transport-https', 'refresh=True'], null, true)
-                        salt.enforceState(saltMaster, 'I@linux:system', ['linux', 'openssh', 'salt.minion', 'ntp'], true)
+                        //salt.runSaltProcessStep(saltMaster, '* and not kvm*', 'cmd.run', ['apt-get update -y && apt-get install -y apt-transport-https'], null, true)
+                        //salt.runSaltProcessStep(saltMaster, '* and not kvm*', 'pkg.install', ['apt-transport-https', 'refresh=True'], null, true)
+                        salt.enforceState(saltMaster, 'I@linux:system', ['linux', 'salt.minion'], true)
+                        salt.enforceState(saltMaster, 'I@linux:system', ['openssh', 'salt.minion', 'ntp'], true)
                     }
 
                     //orchestrate.validateFoundationInfra(saltMaster)
@@ -334,13 +337,8 @@
 
                     // Install neutron service
                     //runSaltProcessStep(saltMaster, 'I@neutron:server', 'state.sls', ['neutron'], 1)
-                    if (INSTALL.toLowerCase().contains('kvm')) {
-                        salt.enforceState(saltMaster, 'ntw01*', 'neutron', true)
-                    } else {
-                        salt.enforceState(saltMaster, 'ctl01*', 'neutron', true)
-                    }
 
-                    salt.enforceState(saltMaster, 'I@neutron:server', 'neutron', true)
+                    salt.enforceState(saltMaster, '*01* and I@neutron:server', 'neutron', true)
                     salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; neutron agent-list'], null, true)
 
                     // Install heat service
@@ -527,6 +525,16 @@
                 }
             }
 
+            if (TEST.toLowerCase().contains('openstack')) {
+                stage('Run OpenStack tests') {
+                    test.runTempestTests(saltMaster, TEMPEST_IMAGE_LINK)
+                }
+
+                stage('Copy Tempest results to config node') {
+                    test.copyTempestResults(saltMaster)
+                }
+            }
+
 
         } catch (Throwable e) {
             currentBuild.result = 'FAILURE'
diff --git a/mk-lab-pipeline.groovy b/mk-lab-pipeline.groovy
index a5f2eb4..9e9a28d 100644
--- a/mk-lab-pipeline.groovy
+++ b/mk-lab-pipeline.groovy
@@ -26,6 +26,8 @@
  *   K8S_API_SERVER             Kubernetes API address
  *   K8S_CONFORMANCE_IMAGE      Path to docker image with conformance e2e tests
  *
+ *   TEMPEST_IMAGE_LINK         Tempest image link
+ *
  *   INSTALL                    What should be installed (k8s, openstack, ...)
  *   TESTS                      Run tests (bool)
  */
@@ -141,11 +143,15 @@
             orchestrate.installOpenstackMkCompute(saltMaster)
         }
 
-        //if (TESTS.toLowerCase().contains('openstack')) {
-        //    stage('Run OpenStack tests') {
-        //        orchestrate...
-        //    }
-        //}
+        if (TESTS.toLowerCase().contains('openstack')) {
+            stage('Run OpenStack tests') {
+                test.runTempestTests(saltMaster, TEMPEST_IMAGE_LINK)
+            }
+
+            stage('Copy Tempest results to config node') {
+                test.copyTempestResults(saltMaster)
+            }
+        }
     }
 
     //