QEMU test run fix for REST testcases
Resolves openbmc/openbmc-test-automation#72
Change-Id: I1ad5ef4ea48c47f48a7de2f699d03869e6a70fc3
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/data/variables.py b/data/variables.py
index 99705c2..9c0e773 100644
--- a/data/variables.py
+++ b/data/variables.py
@@ -1,3 +1,30 @@
+import os
+
+'''
+ QEMU HTTPS variable:
+
+ By default lib/resource.txt AUTH URI construct is as
+ ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
+ ${AUTH_SUFFIX} is populated here by default EMPTY else
+ the port from the OS environment
+'''
+def get_port_https():
+ # defaulted to empty string
+ l_suffix = ''
+ try:
+ l_https_port = os.getenv('HTTPS_PORT')
+ if l_https_port:
+ l_suffix = ':' + l_https_port
+ except:
+ print "Environment variable HTTPS_PORT not set,using default HTTPS port"
+ return l_suffix
+
+AUTH_SUFFIX={
+ "https_port":[get_port_https()],
+}
+
+# Update the ':Port number' to this variable
+AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
# Here contains a list of valid Properties bases on fru_type after a boot.
INVENTORY_ITEMS={
diff --git a/lib/resource.txt b/lib/resource.txt
index ecfea7a..37c3234 100755
--- a/lib/resource.txt
+++ b/lib/resource.txt
@@ -9,7 +9,8 @@
${OPENBMC_HOST} 9.3.164.161
${DBUS_PREFIX} ${EMPTY}
${PORT} ${EMPTY}
-${AUTH_URI} https://${OPENBMC_HOST}
+# AUTH_SUFFIX here is derived from variables.py
+${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
${OPENBMC_USERNAME} root
${OPENBMC_PASSWORD} 0penBmc
${MACHINE_TYPE} palmetto