Added MAC verify on fwenv testcases
Changes:
-Configure Valid MAC And Verify
-Configure Invalid MAC And Verify on FW_Env
-Configure Valid MAC And Verify Persistency
-Configure Invalid MAC And Verify Persistency On FW_Env
-Added Validate MAC On FW_Env in test teardown
-Configure Out Of Range MAC And Verify
-Configure More Byte MAC And Verify
Keywords added:
-Get FW_Env MAC Address
-Truncate MAC Address
-Truncate MAC bits
-Validate MAC On FW_Env
-Verify MAC Address via FW_Env
Change-Id: Ie72fa551497bd27c9d1befb04f33e5b213e989c5
Signed-off-by: shrsuman123 <shrsuman@in.ibm.com>
diff --git a/redfish/managers/test_bmc_network_mac.robot b/redfish/managers/test_bmc_network_mac.robot
index 182f7ec..0f3ec5b 100644
--- a/redfish/managers/test_bmc_network_mac.robot
+++ b/redfish/managers/test_bmc_network_mac.robot
@@ -37,9 +37,9 @@
Configure MAC Settings ${valid_mac} valid
- # Verify whether new MAC is configured on BMC.
+ # Verify whether new MAC is configured on BMC and FW_Env.
Validate MAC On BMC ${valid_mac}
-
+ Verify MAC Address Via FW_Env ${valid_mac} valid
Configure Zero MAC And Verify
[Documentation] Configure zero MAC via Redfish and verify.
@@ -49,7 +49,6 @@
# MAC address scenario
${zero_mac} error
-
Configure Broadcast MAC And Verify
[Documentation] Configure broadcast MAC via Redfish and verify.
[Tags] Configure_Broadcast_MAC_And_Verify
@@ -75,17 +74,41 @@
# Verify whether new MAC is configured on BMC.
Validate MAC On BMC ${valid_mac}
- # Reboot BMC and check whether MAC is persistent.
+ # Reboot BMC and check whether MAC is persistent on BMC and FW_Env.
OBMC Reboot (off)
Validate MAC On BMC ${valid_mac}
+ Verify MAC Address Via FW_Env ${valid_mac} valid
+
+Configure Invalid MAC And Verify On FW_Env
+ [Documentation] Configure Invalid MAC via Redfish and verify on FW_Env.
+ [Tags] Configure_Invalid_MAC_And_Verify_On_FW_Env
+
+ [Template] Configure MAC Settings
+
+ # invalid_MAC scenario
+ ${zero_mac} error
+ ${broadcast_mac} error
+ ${special_char_mac} error
+ ${less_byte_mac} error
+
+ Configure Invalid MAC And Verify Persistency On FW_Env
+ [Documentation] Configure invalid MAC and verify persistency on FW_Env.
+ [Tags] Configure_Invalid_MAC_And_Verify_Persistency_On_FW_Env
+
+ Configure MAC Settings ${special_char_mac} error
+
+ # Reboot BMC and check whether MAC is persistent on FW_Env.
+ OBMC Reboot (off)
+ Verify MAC Address Via FW_Env ${special_char_mac} error
Configure Out Of Range MAC And Verify
[Documentation] Configure out of range MAC via Redfish and verify.
[Tags] Configure_Out_Of_Range_MAC_And_Verify
- [Template] Configure MAC Settings
- # MAC address scenario
- ${out_of_range_mac} error
+ Configure MAC Settings ${out_of_range_mac} valid
+
+ # Verify whether new MAC is configured on FW_Env.
+ Verify MAC Address Via FW_Env ${out_of_range_mac} valid
Configure Less Byte MAC And Verify
[Documentation] Configure less byte MAC via Redfish and verify.
@@ -99,9 +122,9 @@
[Documentation] Configure more byte MAC via Redfish and verify.
[Tags] Configure_More_Byte_MAC_And_Verify
- [Template] Configure MAC Settings
- # MAC address scenario
- ${more_byte_mac} error
+ Configure MAC Settings ${more_byte_mac} valid
+ # Verify whether new MAC is configured on FW_Env.
+ Verify MAC Address Via FW_Env ${more_byte_mac} valid
*** Keywords ***
@@ -111,8 +134,9 @@
# Revert to initial MAC address.
Configure MAC Settings ${initial_mac_address} valid
- # Verify whether new MAC is configured on BMC.
+ # Verify whether new MAC is configured on BMC and FW_Env.
Validate MAC On BMC ${initial_mac_address}
+ Validate MAC On Fw_Env ${initial_mac_address}
FFDC On Test Case Fail
Redfish.Logout
@@ -159,7 +183,6 @@
# Verify whether new MAC address is populated on BMC system.
# It should not allow to configure invalid settings.
-
${status}= Run Keyword And Return Status
... Validate MAC On BMC ${mac_address}
@@ -170,3 +193,24 @@
... Should Be Equal ${status} ${True}
... msg=Not allowing the configuration of a valid MAC.
+ Verify MAC Address Via FW_Env ${mac_address} ${expected_result}
+
+Verify MAC Address Via FW_Env
+ [Documentation] Verify MAC address on FW_Env.
+ [Arguments] ${mac_address} ${expected_result}
+
+ # Description of argument(s):
+ # mac_address MAC address of BMC.
+ # expected_result Expected status of MAC configuration.
+
+ ${status}= Run Keyword And Return Status
+ ... Validate MAC On FW_Env ${mac_address}
+
+ Run Keyword If '${expected_result}' == 'error'
+ ... Should Be Equal ${status} ${False}
+ ... msg=Allowing the configuration of an invalid MAC.
+ ... ELSE
+ ... Should Be Equal ${status} ${True}
+ ... msg=Not allowing the configuration of a valid MAC.
+
+