Fix REST connection cleanup
REST operation GET/PUT/DELETE/POST currently takes session per call,
leaking open sessions until explicitly closed.
Resolves openbmc/openbmc#1389
Change-Id: If583922ae19260411f3cdc44e5d2bf6467bada71
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/rest_client.robot b/lib/rest_client.robot
index b3c0056..eae8938 100644
--- a/lib/rest_client.robot
+++ b/lib/rest_client.robot
@@ -70,6 +70,7 @@
... base_uri=${base_uri} args=&{kwargs}
${ret}= Get Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
Run Keyword If '${quiet}' == '${0}' Log Response ${ret}
+ Delete All Sessions
[Return] ${ret}
OpenBMC Post Request
@@ -83,6 +84,7 @@
... base_uri=${base_uri} args=&{kwargs}
${ret}= Post Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
Run Keyword If '${quiet}' == '${0}' Log Response ${ret}
+ Delete All Sessions
[Return] ${ret}
OpenBMC Put Request
@@ -95,6 +97,7 @@
Log Request method=Put base_uri=${base_uri} args=&{kwargs}
${ret}= Put Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
Log Response ${ret}
+ Delete All Sessions
[Return] ${ret}
OpenBMC Delete Request
@@ -105,6 +108,7 @@
Log Request method=Delete base_uri=${base_uri} args=&{kwargs}
${ret}= Delete Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
Log Response ${ret}
+ Delete All Sessions
[Return] ${ret}
Initialize OpenBMC
@@ -218,3 +222,4 @@
${ret}= Post Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
Run Keyword If '${quiet}' == '${0}' Log Response ${ret}
Should Be Equal As Strings ${ret.status_code} ${HTTP_OK}
+ Delete All Sessions