Create REST URL file with BMC firmware version.
Filename contains BMC firmware version before and after
code update.
Resolves openbmc/openbmc-test-automation#709
Change-Id: Iefb5113843cd8d733e626ae7de6d559b7905d7cc
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 9e5b5ce..a88879b 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -962,3 +962,14 @@
${state}= Read Attribute ${LED_GROUPS_URI}${led_name} Asserted
[Return] ${state}
+
+
+Get BMC Version
+ [Documentation] Returns BMC version from /etc/os-release.
+ ... e.g. "v1.99.6-141-ge662190"
+
+ Open Connection And Log In
+ ${cmd}= Set Variable grep ^VERSION_ID= /etc/os-release | cut -f 2 -d '='
+ ${output}= Execute Command On BMC ${cmd}
+ [Return] ${output}
+