[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH] PDU/IPMI: Be less aggressive with IPMI commands


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Fri, 10 Mar 2023 17:07:21 +0000
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Fri, 10 Mar 2023 17:08:19 +0000
  • Ironport-data: A9a23:F0KSMa+I2iEAdop7pGysDrUDjH6TJUtcMsCJ2f8bNWPcYEJGY0x3y jFJCmCBM/mKNGrweNslO4y+oEkDvpbQzIIyTgQ6pX88E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kI/1BjOkGlA5AdmPqkT5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDkl3q OwyKDohUCvSnum0nKqDEftHvpwseZyD0IM34hmMzBncBPciB5vCX7/L9ZlT2zJYasJmRKiEI ZBDMHw2MUqGOkcUUrsUIMtWcOOAj3/jczpeuRSNqLA++WT7xw1tyrn9dtHSf7RmQO0Mxh7H+ D6fozWR7hcyHdKumDSK9zWXouaUmQb3fqRRRJ2y36s/6LGU7jNKU0BHPbehmtGph0j7V99BJ kg8/is1sbN05EGtVsP6XRCzvDiDpBF0c9tPEcUq5QeV0K3W7g2FQG8eQVZ8hMcO7ZFsA2Zwj xnQwo2vXGY02FGIdZ6D3o7JvRmyMwQrFj4bbi1YVTNe8fLb+I5m23ojUe1fOKKyi9T0HxT5z DaLsDUyit0vsCIb60mo1QuZ2mzx//AlWiZwv1yKBTz9smuVcab/P+SVBU7nAeGsxWpzZn2Ip zA6lseX94ji5rndxXXWEI3h8FxEjstp0QEwY3Y1QvHNFBz3oRZPmLy8BxkvTHqFyu5eJVfUj Lb74Gu9HqN7MnqwdrNQaImsEcksxqWIPY27CaCPPoQfOsMsK1PvEMRSiam4hT2FraTRuftnZ cfznTiEVx729piLPBLpHrxAgNfHNwg1xH/JRICT8vhU+eP2WZJhcp9caAHmRrlgvMu5TPD9r 4432z2il08OD4UTo0D/reYuELz9BSFmVMGp9ZEJKbXrz8gPMDhJNsI9CIgJI+RN95m5XM+Tp hlRhmcwJILDuED6
  • Ironport-hdrordr: A9a23:d2apPansdgKVacUIJYalLctuxGLpDfLo3DAbv31ZSRFFG/Fw9/ rCoB17726QtN91YhsdcL+7V5VoLUmzyXcX2/hyAV7BZmnbUQKTRekP0WKL+Vbd8kbFh41gPM lbEpSXCLfLfCJHZcSR2njELz73quP3jJxBho3lvghQpRkBUdAF0+/gYDzranGfQmN9dP0EPa vZ3OVrjRy6d08aa8yqb0N1JNQq97Xw5fTbiQdtPW9f1DWz
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The machine rimava0 doesn't power off or power on when we keep doing
"power status" then "power off" ipmi command without waiting.

Currently, osstest does:
    loop
        ipmitool power status
        ipmitool power off
        sleep 1

This loop goes on forever, the machine never change power state.
Adding some wait in between both command works.

While here, test for timeout just after a status check instead of
sending the `power off` command again which we would never check the
result of.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 Osstest/PDU/ipmi.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Osstest/PDU/ipmi.pm b/Osstest/PDU/ipmi.pm
index 21c94d98..ce498cb7 100644
--- a/Osstest/PDU/ipmi.pm
+++ b/Osstest/PDU/ipmi.pm
@@ -69,10 +69,10 @@ sub pdu_power_state {
     my $count = 60;
     for (;;) {
         last if $getstatus->() eq $onoff;
+        die "did not power $onoff" unless --$count > 0;
+        sleep(1);
 
        system_checked((@cmd, qw(power), $onoff));
-
-        die "did not power $onoff" unless --$count > 0;
         sleep(1);
     }
 }
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.