diff --git a/tcp_tests/managers/k8smanager.py b/tcp_tests/managers/k8smanager.py
index 79974d3..3ae1a1b 100644
--- a/tcp_tests/managers/k8smanager.py
+++ b/tcp_tests/managers/k8smanager.py
@@ -41,6 +41,7 @@
         self._api = None
         self.kubectl = K8SKubectlCli(self)
         self.virtlet = K8SVirtlet(self)
+        self.conformance_node = None
         super(K8SManager, self).__init__(config=config, underlay=underlay)
 
     def install(self, commands):
@@ -299,6 +300,61 @@
             timeout_msg="Timeout for CNCF reached."
         )
 
+    def start_conformance_inside_pod(self, cnf_type='k8s', timeout=60 * 60):
+        """
+        Create conformance pod and wait for results
+        :param cnf_type: k8s or virtlet. choose what conformance you want
+        :param timeout:
+        :return:
+        """
+        if cnf_type == 'k8s':
+            pod_mark = 'conformance'
+        elif cnf_type == 'virtlet':
+            pod_mark = 'virtlet-conformance'
+        else:
+            LOG.error("Unknown conformance type or it even not set")
+            raise RuntimeError("Unknown conformance type")
+        conformance_cmd = "kubectl apply -f /srv/kubernetes/{}.yml" \
+                          "".format(pod_mark)
+        self.controller_check_call(conformance_cmd, timeout=900)
+
+        cnf_pod = self.api.pods.get(pod_mark, pod_mark)
+        cnf_pod.wait_running()
+
+        pod = cnf_pod.read()
+        target = "{}.".format(pod.spec.node_name)
+        self.conformance_node = self.__underlay.get_target_node_names(
+            target)[0]
+
+        def cnf_status():
+            pod = cnf_pod.read()
+            status = pod.status.phase
+            LOG.info("Conformance status: {}".format(status))
+            return status
+
+        LOG.info("Waiting for Conformance to complete")
+        helpers.wait(
+            lambda: cnf_status() == ('Succeeded' or 'Failed'),
+            interval=120, timeout=timeout,
+            timeout_msg="Timeout for Conformance reached."
+        )
+
+        pod = cnf_pod.read()
+        status = pod.status.phase
+        if status is 'Failed':
+            describe = "kubectl describe po {0} -n {0}".format(pod_mark)
+            LOG.info(self.controller_check_call(describe, timeout=30))
+            raise RuntimeError("Conformance failed")
+
+    def move_file_to_root_folder(self, filepath):
+        cmd = "mv {0} /root/".format(filepath)
+        if self.conformance_node:
+            self.__underlay.check_call(
+                cmd=cmd, node_name=self.conformance_node,
+                raise_on_err=False)
+        else:
+            LOG.info("Node is not properly set")
+
     def extract_file_to_node(self, system='docker',
                              container='virtlet',
                              file_path='report.xml',
@@ -343,11 +399,16 @@
         :param files:
         :return:
         """
+        if self.conformance_node:
+            node = self.conformance_node
+        else:
+            node = self.controller_name
+        LOG.info("Trying to get logs at {}".format(node))
         master_host = self.__config.salt.salt_master_host
         with self.__underlay.remote(host=master_host) as r:
             for log_file in files:
                 cmd = "rsync -r \"{0}:/root/{1}\" /root/".format(
-                    self.controller_name, log_file)
+                    node, log_file)
                 r.check_call(cmd, raise_on_err=False)
                 LOG.info("Downloading the artifact {0}".format(log_file))
                 r.download(destination=log_file, target=os.getcwd())
@@ -362,7 +423,12 @@
         :param output: Path to xml file where output will stored
         :return:
         """
-        with self.__underlay.remote(node_name=self.controller_name) as r:
+        if self.conformance_node:
+            node = self.conformance_node
+        else:
+            node = self.controller_name
+        LOG.info("Trying to combine xunit at {}".format(node))
+        with self.__underlay.remote(node_name=node) as r:
             cmd = ("apt-get install python-setuptools -y; "
                    "pip install "
                    "https://github.com/mogaika/xunitmerge/archive/master.zip")
