# -*- coding: utf-8 -*-
 #
+# Copyright 2017 OPNFV
+#
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
 # not use this file except in compliance with the License. You may obtain
 # a copy of the License at
 APEX_USER = 'root'
 APEX_USER_STACK = 'stack'
 APEX_PKEY = '/root/.ssh/id_rsa'
+TEST_VM_IMAGE = 'cirros-0.4.0-x86_64-disk.img'
+TEST_VM_IMAGE_PATH = '/home/opnfv/functest/images/' + TEST_VM_IMAGE
 
 
 class Node(object):
                     '| sed -e "s/#.*$//" | sed -e "s/=/:/"'
                     )
                 stdout = node.run_cmd(readcmd)
-                agent_conf = {"server": yaml.load(stdout)}
+                agent_conf = {"server": yaml.safe_load(stdout)}
 
                 pingcmd = (
                     'ping -n -c1 ' + agent_conf["server"]["amqp_host"] +
         self.__logger.debug('Create command is executed in {}' .format(
             (controller_node.get_dict()['name'])))
 
-        image_filename = 'cirros-0.4.0-x86_64-disk.img'
-        controller_node.run_cmd(
-            'curl -sO '
-            'http://download.cirros-cloud.net/0.4.0/'
-            + image_filename)
-
         node.put_file(constants.ENV_FILE, 'overcloudrc.v3')
+        node.put_file(TEST_VM_IMAGE_PATH, TEST_VM_IMAGE)
         image = controller_node.run_cmd(
             'source overcloudrc.v3;'
             'openstack image create -f value -c id'
             ' --disk-format qcow2 --file {0} {1}'
-            .format(image_filename, test_name))
+            .format(TEST_VM_IMAGE, test_name))
         flavor = controller_node.run_cmd(
             'source overcloudrc.v3;'
             'openstack flavor create -f value -c id {}'
 
 # -*- coding: utf-8 -*-
-
+#
+# Copyright 2018 OPNFV
+#
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
 # not use this file except in compliance with the License. You may obtain
 # a copy of the License at
 
 logger = None
 
+TEMP_DIR = '/root'
+
 
 class LocalAgentClient(object):
     """Client to request LocalAgent"""
 
         if agent_server_running:
             test_name = 'barotest'
-            tmpfile = '/tmp/' + test_name + '.conf'
+            tmpfile = TEMP_DIR + '/' + test_name + '.conf'
 
             agent_config = conf.get_localagent_config(compute_node)
             listen_ip = compute_node.get_ip()