Merge lp:~tyler-baker/lava-lab/add-k3v2-support into lp:lava-lab

Proposed by Tyler Baker
Status: Merged
Merged at revision: 179
Proposed branch: lp:~tyler-baker/lava-lab/add-k3v2-support
Merge into: lp:lava-lab
Diff against target: 127 lines (+118/-0)
2 files modified
lava/devices/dispatcher01/production/k3v2-01.conf (+7/-0)
lava/lab-scripts/delayed-reboot-ap7952 (+111/-0)
To merge this branch: bzr merge lp:~tyler-baker/lava-lab/add-k3v2-support
Reviewer Review Type Date Requested Status
Tyler Baker Approve
Review via email: mp+168719@code.launchpad.net

Description of the change

Add Huawei k3v2 support to LAVA lab. Add another PDU script for delayed reboots, instead of immediate reboots.

To post a comment you must log in.
Revision history for this message
Tyler Baker (tyler-baker) wrote :

Trival changes.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'lava/devices/dispatcher01/production/k3v2-01.conf'
2--- lava/devices/dispatcher01/production/k3v2-01.conf 1970-01-01 00:00:00 +0000
3+++ lava/devices/dispatcher01/production/k3v2-01.conf 2013-06-11 16:07:28 +0000
4@@ -0,0 +1,7 @@
5+device_type = k3v2
6+connection_command = telnet serial4 7015
7+adb_command = adb -s 1234567891234567
8+fastboot_command = fastboot -i 0x12d1
9+hard_reset_command = /usr/local/lab-scripts/delayed-reboot-ap7952 pdu13 03
10+android_wait_for_home_screen_activity = android.process
11+master_str = root@android
12
13=== added file 'lava/lab-scripts/delayed-reboot-ap7952'
14--- lava/lab-scripts/delayed-reboot-ap7952 1970-01-01 00:00:00 +0000
15+++ lava/lab-scripts/delayed-reboot-ap7952 2013-06-11 16:07:28 +0000
16@@ -0,0 +1,111 @@
17+#!/usr/bin/expect --
18+#
19+# Reboot a machine connected to an APC power strip
20+#
21+# Copyright 2007 Google Inc., Martin J. Bligh <mbligh@google.com>
22+set P "reboot-apc"
23+
24+#
25+# OPTIONS: options parser.
26+#
27+proc shift {_list} {
28+ upvar $_list list
29+ set res [lindex $list 0]
30+ set list [lreplace $list 0 0]
31+ return $res
32+}
33+
34+proc arg {_list arg} {
35+ upvar $_list list
36+ if {[llength $list] < 1} {
37+ puts stderr "$arg: required argument missing"
38+ exit 1
39+ }
40+ return [shift list]
41+}
42+
43+proc enter_outlet {outlet} {
44+ expect "Press <ENTER> to continue..."
45+ send "\r"
46+ expect "> "
47+ send $outlet
48+ send "\r"
49+}
50+
51+set timeout 10
52+set user {apc}
53+set pass {apc}
54+set host [lindex $argv 0]
55+set outlet [lindex $argv 1]
56+shift argv
57+shift argv
58+
59+while {[llength $argv] > 0} {
60+puts "length [llength $argv]"
61+ switch -- [shift argv] {
62+ -p { set pass [arg argv p]}
63+ -u { set user [arg argv u]}
64+ }
65+}
66+
67+if {[llength $argv] > 0} {
68+ puts stderr "Usage: $P <host> <outlet> [-u <user>] [-p <pass>]"
69+ exit 1
70+}
71+
72+if {[string compare $host ""] == 0 ||
73+ [string compare $outlet ""] == 0} \
74+ {
75+ puts stderr "host and outlet required"
76+ exit 1
77+ }
78+
79+spawn telnet $host
80+expect "User Name :"
81+send $user
82+send "\r"
83+expect "Password :"
84+send $pass
85+send "\r"
86+expect "1- Device Manager"
87+expect "> "
88+send "1\r"
89+# We get a different prompt if we're just an outlet controller
90+# decide which response we need to enter
91+set timeout 2
92+expect {
93+ "3- Outlet Control/Configuration" {
94+ send "3\r"
95+ enter_outlet $outlet
96+ exp_continue
97+ }
98+ "2- Outlet Control" {
99+ send "2\r"
100+ enter_outlet $outlet
101+ exp_continue
102+ }
103+ "2- Outlet Management" {
104+ send "2\r"
105+ exp_continue
106+ }
107+}
108+# Here too, if we're just an outlet controller we don't get the option
109+# to modify configuration
110+expect {
111+ "1- Control Outlet" {
112+ send "1\r"
113+ }
114+ "1- Outlet Control/Configuration" {
115+ send "1\r"
116+ enter_outlet $outlet
117+ }
118+}
119+expect "1- Control Outlet"
120+send "1\r"
121+expect "3- Immediate Reboot"
122+expect "> "
123+send "6\r"
124+expect "Delayed Reboot"
125+expect "Enter 'YES' to continue or <ENTER> to cancel :"
126+send "YES\r"
127+expect "Press <ENTER> to continue..."

Subscribers

People subscribed via source and target branches