Increase API retries and timeout 74/75674/4
authorTaseer <taseer94@gmail.com>
Mon, 3 Sep 2018 09:22:59 +0000 (14:22 +0500)
committerTaseer <taseer94@gmail.com>
Thu, 13 Sep 2018 08:50:38 +0000 (10:50 +0200)
The jobs are failing because API is not responding within the specified
time of 5 seconds with 5 retries. This patch increases each to 20.

This patch also adds an extra task of waiting for the API to respond
before moving to the rest of the tasks. This allows enough waiting time
for ODL to be fully functional.

Change-Id: I852660abf34d91fcd547767b5249689b415ca94b
Signed-off-by: Taseer <taseer94@gmail.com>
tests/test-odl-users.yaml

index 0fb4fd2966191bf53726af464651960220f6089b..37b6751e01fda7652c41308efbf0b491a64855b2 100644 (file)
@@ -5,6 +5,17 @@
   vars_files:
     - vars.yaml
   tasks:
+    - name: wait until the api becomes responsive
+      uri:
+        url: http://localhost:8181/auth/v1/users/
+        url_username: admin
+        url_password: admin
+        status_code: 200
+      register: intial_api_response
+      until: intial_api_response.status == 200
+      retries: 20
+      delay: 20
+
     - name: list initial users
       odl_usermod:
         state: list
@@ -23,8 +34,8 @@
         status_code: 404
       register: verify_no_test_user_api
       until: verify_no_test_user_api.status == 404
-      retries: 5
-      delay: 5
+      retries: 20
+      delay: 20
 
     - name: create odl user
       odl_usermod:
@@ -51,8 +62,8 @@
         status_code: 200
       register: verify_test_user_creation_api
       until: verify_test_user_creation_api.status == 200
-      retries: 5
-      delay: 5
+      retries: 20
+      delay: 20
 
     - name: delete odl user
       odl_usermod:
@@ -78,8 +89,8 @@
         status_code: 404
       register: verify_test_user_deletion_api
       until: verify_test_user_deletion_api.status == 404
-      retries: 5
-      delay: 5
+      retries: 20
+      delay: 20
 
     - name: create user without username or password
       odl_usermod:
         status_code: 200
       register: api_responsive_default_password
       until: api_responsive_default_password.status == 200
-      retries: 5
-      delay: 5
+      retries: 20
+      delay: 20
 
     - name: assert that API fails with new password before changing
       uri:
         status_code: 401
       register: api_failure_before_pass_change
       until: api_failure_before_pass_change.status == 401
-      retries: 5
-      delay: 5
+      retries: 20
+      delay: 20
 
     - name: update admin password
       odl_usermod:
         status_code: 401
       register: old_admin_password_failure
       until: old_admin_password_failure.status == 401
-      retries: 10
-      delay: 10
+      retries: 20
+      delay: 20
 
     - name: assert API responds with new password
       uri:
         status_code: 200
       register: new_admin_password_success
       until: new_admin_password_success.status == 200
-      retries: 5
-      delay: 5
\ No newline at end of file
+      retries: 20
+      delay: 20
\ No newline at end of file