Remove external server references on Rally scenarios 43/15443/3
authorJuha Kosonen <juha.kosonen@nokia.com>
Mon, 13 Jun 2016 10:35:49 +0000 (10:35 +0000)
committerJuha Kosonen <juha.kosonen@nokia.com>
Mon, 13 Jun 2016 11:20:06 +0000 (11:20 +0000)
Use url derived from OS_AUTH_URL on a scenario making http request and
checking the response. This way successful test execution does not
require internet connection nor rely on external servers functionality.

JIRA: FUNCTEST-201

Change-Id: Ic11f8f5c32d015624bdec1db07d8bb49f7b77bc8
Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
testcases/OpenStack/rally/run_rally-cert.py
testcases/OpenStack/rally/scenario/opnfv-requests.yaml

index 6bb29b8..a8628bc 100755 (executable)
@@ -196,6 +196,12 @@ def build_task_args(test_file_name):
     task_args['netid'] = str(net_id)
     task_args['live_migration'] = live_migration_supported()
 
+    auth_url = os.getenv('OS_AUTH_URL')
+    if auth_url is not None:
+        task_args['request_url'] = auth_url.rsplit(":", 1)[0]
+    else:
+        task_args['request_url'] = ''
+
     return task_args
 
 
index 6affcc6..1613697 100644 (file)
@@ -1,27 +1,10 @@
-  HttpRequests.check_random_request:
-    -
-      args:
-        requests:
-          -
-            url: "http://www.example.com"
-            method: "GET"
-            status_code: 200
-          -
-            url: "http://www.openstack.org"
-            method: "GET"
-        status_code: 200
-      runner:
-        {{ constant_runner(concurrency=concurrency, times=iterations, is_smoke=smoke) }}
-      sla:
-        {{ no_failures_sla() }}
-
   HttpRequests.check_request:
     -
       args:
-        url: "http://www.example.com"
+        url: "{{ request_url }}"
         method: "GET"
         status_code: 200
-        allow_redirects: False
+        allow_redirects: True
       runner:
         {{ constant_runner(concurrency=concurrency, times=iterations, is_smoke=smoke) }}
       sla: