Updated the settings for Tempest configuration

See the ticket [1] as the reason of the changes.

List of the main changes:

* Ability to set the CUSTOM_PUBLIC_NET_NAME - floating network
  in the offline and online methods of execution.
* The cvp.* flavors and images are not passed in tempest config.
* tempest_custom.yaml.clean file has reduced number of options
  (the old and irrelevant are removed).

[1] https://mirantis.jira.com/browse/PRODX-39383

Related-PROD: PROD-37187
Change-Id: I31e8c8e4b3d8eda706cbba46b4435d31f8f8eb4e
(cherry picked from commit ff980e1006dcfabc9622d0db7a6a0098f6ca03e4)
(cherry picked from commit 6b252d70db64ef5b981c18bc706fce712f1ce748)
diff --git a/scripts/prepare.sh b/scripts/prepare.sh
index 78341b2..2a34583 100644
--- a/scripts/prepare.sh
+++ b/scripts/prepare.sh
@@ -296,9 +296,25 @@
     process_cmds
 
     # get external network name
-    external=$(openstack network list --external -c Name -f value | head -n1)
-    echo router set ${router} --external-gateway ${external} >>${cmds}
-    process_cmds
+    if [ -n "${CUSTOM_PUBLIC_NET_NAME:-}" ]; then
+      # if CUSTOM_PUBLIC_NET_NAME is set to some specific net, check it is present on the cloud and use it
+      echo "# Checking that the external network ${CUSTOM_PUBLIC_NET_NAME} is present on the cloud"
+      network_exists=$(openstack network show "$CUSTOM_PUBLIC_NET_NAME" -c id -f value 2>/dev/null)
+      if [ -n "$network_exists" ]; then
+        echo router set ${router} --external-gateway ${CUSTOM_PUBLIC_NET_NAME} >>${cmds}
+        process_cmds
+      else
+        echo "# The network ${CUSTOM_PUBLIC_NET_NAME} does not exist"
+        CUSTOM_PUBLIC_NET_NAME=""
+      fi
+    fi
+    if [ -z "${CUSTOM_PUBLIC_NET_NAME:-}" ]; then
+      echo "# Selecting a random external network as an external gateway for the router"
+      # if the custom network is not set or is empty, select the first external network
+      external=$(openstack network list --external -c Name -f value | head -n1)
+      echo router set ${router} --external-gateway ${external} >>${cmds}
+      process_cmds
+    fi
 }
 
 function _get_image() {