Update tempest config for runtestmanager

Change-Id: Ia3253be7b6c545f4b8acb628a9cc438dc272bf46
diff --git a/tcp_tests/managers/runtestmanager.py b/tcp_tests/managers/runtestmanager.py
index 9ed4a9c..229a3ff 100644
--- a/tcp_tests/managers/runtestmanager.py
+++ b/tcp_tests/managers/runtestmanager.py
@@ -12,15 +12,14 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import os
 import json
+import os
 
 from devops.helpers import helpers
 
 from tcp_tests import logger
 from tcp_tests import settings
 
-
 LOG = logger.logger
 
 TEMPEST_CFG_DIR = '/tmp/test'
@@ -79,28 +78,14 @@
                     '${_param:runtest_tempest_public_net}'
                 },
                 'share': {
-                    'backend_names': 'lvm',
-                    'capability_create_share_from_snapshot_support': True,
                     'capability_snapshot_support': True,
-                    'default_share_type_name': 'default',
-                    'enable_ip_rules_for_protocols': 'nfs',
-                    'enable_user_rules_for_protocols': 'cifs',
-                    'max_api_microversion': 2.4,
-                    'min_api_microversion': 2.0,
                     'run_driver_assisted_migration_tests': False,
-                    'run_host_assisted_migration_tests': True,
                     'run_manage_unmanage_snapshot_tests': False,
                     'run_manage_unmanage_tests': False,
                     'run_migration_with_preserve_snapshots_tests': False,
-                    'run_mount_snapshot_tests': True,
                     'run_quota_tests': True,
                     'run_replication_tests': False,
-                    'run_revert_to_snapshot_tests': True,
-                    'run_share_group_tests': False,
-                    'run_shrink_tests': False,
                     'run_snapshot_tests': True,
-                    'share_creation_retry_number': 2,
-                    'suppress_errors_in_cleanup': True
                 }}}}}
 
 
@@ -155,14 +140,21 @@
     def generate_config(self):
         return self.salt_api.enforce_state(self.master_tgt, 'runtest')
 
-    def fetch_arficats(self, username=None):
+    def fetch_arficats(self, username=None, file_format='xml'):
         target_name = next(node_name for node_name
                            in self.underlay.node_names() if
                            self.target in node_name)
         with self.underlay.remote(node_name=target_name, username=None) as tgt:
+            result = tgt.execute('find {} -name "report_*.{}"'.format(
+                TEMPEST_CFG_DIR, file_format))
+            LOG.debug("Find result {0}".format(result))
+            assert len(result['stdout']) > 0, ('No report found, please check'
+                                               ' if test run was successful.')
+            report = result['stdout'][0].rstrip()
+            LOG.debug("Found files {0}".format(report))
             tgt.download(
-                destination="{cfg_dir}/report_*.xml".format(cfg_dir=TEMPEST_CFG_DIR),  # noqa
-                target="{}".format(os.environ.get("PWD")))
+                destination=report,  # noqa
+                target=os.getcwd())
 
     def store_runtest_model(self, config=CONFIG):
         master_name = next(node_name for node_name
@@ -196,12 +188,12 @@
                     path=settings.LOGS_DIR, target=self.target), 'w') as f:
                 LOG.info("Save tempest console log")
                 container_log = logs
-                f.write(container_log)
+                f.write(container_log.encode('ascii', 'ignore'))
 
         if inspect:
-            with open("{path}/{target}_tempest_container_info.json".format(
+            with open("{path}/{target}_tempest_container_info.json.log".format(
                     path=settings.LOGS_DIR, target=self.target), 'w') as f:
-                LOG.info("Save tempest containes inspect data")
+                LOG.info("Save tempest container inspect data")
 
                 container_inspect = json.dumps(inspect,
                                                indent=4, sort_keys=True)
@@ -226,7 +218,7 @@
         tgt = "{}*".format(self.target)
         params = {
             "name": self.container_name,
-            "image": self.image_name,
+            "image": "{}:{}".format(self.image_name, self.image_version),
             "environment": {
                 "ARGS": "-r {tempest_pattern} -w "
                         "{tempest_threads} "
@@ -245,7 +237,8 @@
             "cmd": self.run_cmd
         }
 
-        res = self.salt_api.local(tgt, 'dockerng.pull', self.image_name)
+        res = self.salt_api.local(tgt, 'dockerng.pull', "{}:{}".format(
+            self.image_name, self.image_version))
         LOG.info("Tempest image has beed pulled- \n{}".format(
             json.dumps(res, indent=4)))
 
@@ -291,7 +284,8 @@
                                        self.container_name)
         logs = logs_res['return'][0]
         logs = next(logs.iteritems())[1]
-        LOG.info("Tempest result - \n{}".format(logs))
+        LOG.info("Tempest result - \n{}".format(
+            logs.encode('ascii', 'ignore')))
 
         res = self.salt_api.local(tgt, 'dockerng.rm', self.container_name)
         LOG.info("Tempest container was removed".format(
diff --git a/tcp_tests/settings.py b/tcp_tests/settings.py
index 57c217f..169d089 100644
--- a/tcp_tests/settings.py
+++ b/tcp_tests/settings.py
@@ -73,6 +73,6 @@
 TEMPEST_IMAGE = os.environ.get(
     'TEMPEST_IMAGE',
     'docker-prod-virtual.docker.mirantis.net/mirantis/cicd/ci-tempest')  # noqa
-TEMPEST_IMAGE_VERSION = os.environ.get('TEMPEST_IMAGE_VERSION', 'latest')
+TEMPEST_IMAGE_VERSION = os.environ.get('TEMPEST_IMAGE_VERSION', 'pike')
 TEMPEST_PATTERN = os.environ.get('TEMPEST_PATTERN', 'tempest')
-TEMPEST_TIMEOUT = int(os.environ.get('TEMPEST_TIMEOUT', 18000))
+TEMPEST_TIMEOUT = int(os.environ.get('TEMPEST_TIMEOUT', 60 * 60 * 5))
diff --git a/tcp_tests/templates/shared-salt.yaml b/tcp_tests/templates/shared-salt.yaml
index f779d06..adfe43f 100644
--- a/tcp_tests/templates/shared-salt.yaml
+++ b/tcp_tests/templates/shared-salt.yaml
@@ -1237,7 +1237,7 @@
 
 - description: Run tempest from new docker image
   cmd: |
-    docker run -e ARGS="-r {{TEMPEST_PATTERN }} -w 2 {{ EXCLUDE_TEST_ARGS }}" -v /root/test/tempest.conf:/etc/tempest/tempest.conf -v /tmp/:/tmp/ -v /root/test:/root/tempest -v /etc/ssl/certs/:/etc/ssl/certs/ --rm docker-prod-virtual.docker.mirantis.net/mirantis/cicd/ci-tempest /bin/bash -c "run-tempest"
+    docker run -e ARGS="-r {{TEMPEST_PATTERN }} -w 2 {{ EXCLUDE_TEST_ARGS }}" -v /root/test/tempest.conf:/etc/tempest/tempest.conf -v /tmp/:/tmp/ -v /root/test:/root/tempest -v /etc/ssl/certs/:/etc/ssl/certs/ --rm docker-prod-virtual.docker.mirantis.net/mirantis/cicd/ci-tempest:pike /bin/bash -c "run-tempest"
   node_name: {{ HOSTNAME_GTW01 }}
   retry: {count: 1, delay: 30}
   skip_fail: true