openbmc / openbmc-test-automation

Apache License 2.0
100 stars 92 forks source link

more time required with password changes for 'Modify IPMI User' in ipmi/test_ipmi_user.robot #2188

Closed generatz closed 2 years ago

generatz commented 2 years ago

We have experienced intermittent fails of this test case, especially when it is run repeatedly, back-to-back. It seems that more time is needed to allow password changes to be fully complete.

To address the issue, I created a new keyword 'Wait and Confirm New Username And Password' to allow for this delay. With this keyword added to the test case (in two places), the fails are gone. Here is the diff:

diff --git a/ipmi/test_ipmi_user.robot b/ipmi/test_ipmi_user.robot
index a9d1857d..76552978 100644
--- a/ipmi/test_ipmi_user.robot
+++ b/ipmi/test_ipmi_user.robot
@@ -499,6 +499,7 @@ Modify IPMI User
     Sleep  5s

     Enable IPMI User And Verify  ${random_userid}
+    Wait and Confirm New Username And Password  ${random_username}  ${valid_password}

     # Verify that user is able to run administrator level IPMI command.
     Verify IPMI Command  ${random_username}  ${valid_password}  Administrator  ${CHANNEL_NUMBER}
@@ -506,6 +507,7 @@ Modify IPMI User
     # Set different username for same IPMI user.
     Run IPMI Standard Command
     ...  user set name ${random_userid} ${new_username}
+    Wait and Confirm New Username And Password  ${new_username}  ${valid_password}

     # Verify that user is able to run administrator level IPMI command.
     Verify IPMI Command  ${new_username}  ${valid_password}  Administrator  ${CHANNEL_NUMBER}
@@ -670,3 +672,15 @@ Check Active Ethernet Channels
     END

     Set Suite Variable  ${secondary_channel_number}
+
+
+Wait and Confirm New Username And Password
+    [Documentation]  Check active ethernet channels and set suite variables.
+    [Arguments]  ${username}  ${password}
+
+     # Give time for previous command to complete
+     Sleep  5s
+
+    # Looping verify that root user is able to run IPMI command using new password.
+    Wait Until Keyword Succeeds  15 sec  5 sec  Verify IPMI Username And Password
+    ...  ${username}  ${password}
gkeishin commented 2 years ago

@generatz Thank you for the changes. Here is the code https://gerrit.openbmc-project.xyz/c/openbmc/openbmc-test-automation/+/53372