MAC address comparison
Fixes:
- Move common keywords from test suites to
lib/bmc_network_utils.robot
- Add new python function to compare the MAC address.
Resolves openbmc/openbmc-test-automation#1261
Change-Id: Ie3447d6a82679152ccd0b571ade63a1f1b71fd05
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/bmc_network_utils.robot b/lib/bmc_network_utils.robot
index 7946974..41b248c 100644
--- a/lib/bmc_network_utils.robot
+++ b/lib/bmc_network_utils.robot
@@ -3,6 +3,7 @@
Resource ../lib/connection_client.robot
Resource ../lib/boot_utils.robot
Library ../lib/gen_misc.py
+Library ../lib/utils.py
*** Variables ***
# MAC input from user.
@@ -200,3 +201,17 @@
Fail msg=No non-pingable IP could be found in subnet ${network_part}.
+
+Validate MAC On BMC
+ [Documentation] Validate MAC on BMC.
+ [Arguments] ${mac_addr}
+
+ # Description of argument(s):
+ # mac_addr MAC address of the BMC.
+
+ ${system_mac}= Get BMC MAC Address
+
+ ${status}= Compare MAC Address ${system_mac} ${mac_addr}
+ Should Be True ${status}
+ ... msg=MAC address ${system_mac} does not match ${mac_addr}.
+