Add local image download

also images names and locations are added as soft parameters and
used in both tempest.init and tempest.glance

Change-Id: I1a3c7105f79f4abf7654f7211f65f35efbd6e673
diff --git a/metadata/service/tempest/init.yml b/metadata/service/tempest/init.yml
index 9546471..f5c6818 100644
--- a/metadata/service/tempest/init.yml
+++ b/metadata/service/tempest/init.yml
@@ -6,12 +6,19 @@
   - runtest
 parameters:
   _param:
+    glance_image_cirros_name: 'TestCirros-0.3.5'
+    glance_image_fedora_name: 'TestFedora-27-1.6'
+    glance_image_cirros_location: 'http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img'
+    glance_image_fedora_location: 'https://mirror.chpc.utah.edu/pub/fedora/linux/releases/27/CloudImages/x86_64/images/Fedora-Cloud-Base-27-1.6.x86_64.qcow2'
     runtest_heat_plugin_skip_scenario_test_list: 'SoftwareConfigIntegrationTest, VolumeBackupRestoreIntegrationTest, AodhAlarmTest'
     # VolumeBackupRestoreIntegrationTest : we don't use volume backup in our default configuration.
     # AodhAlarmTest : we don't have aodh endpoint because of have't telemetry on default configuration.
     runtest_heat_plugin_skip_functional_test_list: 'UpdateServerNetworksTest, StackTemplateValidateTest'
     # UpdateServerNetworksTest, StackTemplateValidateTest : These tests support in openstack Queens, but not in Pike.
     runtest_path_to_ca_file: '/etc/ssl/certs/ca-certificates.crt'
+    runtest_local_image_url: ${_param:glance_image_cirros_location}
+    runtest_local_img_dir: /tmp
+    runtest_local_img_file: ${_param:glance_image_cirros_name}.img
     tempest_test_target: cfg01*
   runtest:
     enabled: true
@@ -20,12 +27,13 @@
       enabled: true
       test_target: ${_param:tempest_test_target}
       keystone_profile_admin: admin_identity
+      local_image_url: ${_param:runtest_local_image_url}
       convert_to_uuid:
         compute:
-          image_ref: ${glance:client:identity:admin_identity:image:cirros:name}
+          image_ref: ${_param:glance_image_cirros_name}
           flavor_ref: 'm1.extra_tiny_test'
           flavor_ref_alt: 'm1.tiny_test'
-          image_ref_alt: ${glance:client:identity:admin_identity:image:cirros:name}
+          image_ref_alt: ${_param:glance_image_cirros_name}
       heat_plugin:
         skip_scenario_test_list: ${_param:runtest_heat_plugin_skip_scenario_test_list}
         skip_functional_test_list: ${_param:runtest_heat_plugin_skip_functional_test_list}
@@ -36,5 +44,8 @@
         user_domain_id: default
         disable_ssl_certificate_validation: False
         ca_file: ${_param:runtest_path_to_ca_file}
-        image_ref: ${glance:client:identity:admin_identity:image:fedora:name}
-        minimal_image_ref: ${glance:client:identity:admin_identity:image:cirros:name}
+        image_ref: ${_param:glance_image_fedora_name}
+        minimal_image_ref: ${_param:glance_image_cirros_name}
+      scenario:
+        img_file: ${_param:runtest_local_img_file}
+        img_dir: ${_param:runtest_local_img_dir}