While playing with conmux, noticed it didn't quite
work with the version of the APC I have in my lab. Modified
the driver script so it can handle both my case and the
original one accordingly.

Changes from v1:
- Oops, little mistake made while refactoring the code that
became enter_outlet. Fixed.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 conmux/drivers/reboot-apc |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/conmux/drivers/reboot-apc b/conmux/drivers/reboot-apc
index e66dc39..7cdf296 100755
--- a/conmux/drivers/reboot-apc
+++ b/conmux/drivers/reboot-apc
@@ -24,6 +24,13 @@ proc arg {_list arg} {
         return [shift list]
 }
 
+proc enter_outlet {outlet} {
+        send "\r"
+        expect "> "
+        send $outlet
+        send "\r"
+}
+
 set timeout 10
 set user {apc}
 set pass {apc}
@@ -68,23 +75,29 @@ set timeout 2
 expect {
    "3- Outlet Control/Configuration" {
       send "3\r"
+      enter_outlet $outlet
       exp_continue
    }
    "2- Outlet Control" {
       send "2\r"
+      enter_outlet $outlet
+      exp_continue
+   }
+   "2- Outlet Management" {
+      send "2\r"
       exp_continue
    }
 }
-send "\r"
-expect "> "
-send $outlet
-send "\r"
 # Here too, if we're just an outlet controller we don't get the option
 # to modify configuration
 expect {
    "1- Control Outlet" {
       send "1\r"
    }
+   "1- Outlet Control/Configuration" {
+      send "1\r"
+      enter_outlet $outlet
+   }
 }
 expect "3- Immediate Reboot"
 expect "> "
-- 
1.7.2.3

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to