Merge lp:~qzhang/lava-dispatcher/update-lmc into lp:lava-dispatcher

Proposed by Spring Zhang
Status: Rejected
Rejected by: Neil Williams
Proposed branch: lp:~qzhang/lava-dispatcher/update-lmc
Merge into: lp:lava-dispatcher
Diff against target: 58 lines (+33/-0)
2 files modified
lava/dispatcher/client.py (+27/-0)
lava/dispatcher/config.py (+6/-0)
To merge this branch: bzr merge lp:~qzhang/lava-dispatcher/update-lmc
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Abstain
Review via email: mp+57192@code.launchpad.net

Description of the change

implementation of updating linaro-media-create to the latest version in master image, to satisfy the option which needs to update to a new l-m-c.

tested on imx51evk, but met timeout 300s error and serial command string truncation issue, others are ok.

To post a comment you must log in.
Revision history for this message
Loïc Minier (lool) wrote :

 Consider using add-apt-repository instead?

--
Loïc Minier

Revision history for this message
Spring Zhang (qzhang) wrote :

> Consider using add-apt-repository instead?
I did consider it, but the headless rootfs doesn't support the command add-apt-repository. I don't know if there is an update, will have a check.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Spring: to get that command you need to install python-software-properties package

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I agree with lool but not strongly enough to block it. I'm not that familiar with the way we interact over the serial line (and all the methods we've built around this to review the code that carefully)

review: Abstain

Unmerged revisions

31. By Spring Zhang

add timeout when apt update and remove simple test code

30. By Spring Zhang

init update-lmc and simple test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava/dispatcher/client.py'
2--- lava/dispatcher/client.py 2011-04-08 05:18:09 +0000
3+++ lava/dispatcher/client.py 2011-04-11 16:34:39 +0000
4@@ -7,6 +7,8 @@
5 LAVA_SERVER_IP,
6 MASTER_STR,
7 TESTER_STR,
8+ LINARO_MAINTAINERS_PPA,
9+ LINARO_MAINTAINERS_KEY,
10 )
11
12
13@@ -99,6 +101,31 @@
14 return
15 raise NetworkError
16
17+ def update_lmc(self):
18+ """
19+ Update l-m-c to the latest, replace the default installed version
20+ """
21+ self.in_master_shell()
22+ aptcfg="/etc/apt/sources.list"
23+ self.proc.sendline("grep linaro-maintainers %s" % aptcfg)
24+ try:
25+ self.proc.expect(["deb-src"], timeout=5)
26+ except pexpect.TIMEOUT:
27+ self.proc.expect(MASTER_STR)
28+ # add PPA
29+ for ppa in LINARO_MAINTAINERS_PPA:
30+ self.run_shell_command("echo %s >> %s" % (ppa, aptcfg),
31+ response = MASTER_STR)
32+ # add key
33+ self.run_shell_command(
34+ "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys %s"
35+ % LINARO_MAINTAINERS_KEY, response = MASTER_STR)
36+
37+ self.run_shell_command("apt-get update",
38+ response = MASTER_STR, timeout = 1200)
39+ self.run_shell_command("apt-get -y install linaro-image-tools",
40+ response = MASTER_STR)
41+
42
43 class NetworkError(Exception):
44 """
45
46=== modified file 'lava/dispatcher/config.py'
47--- lava/dispatcher/config.py 2011-04-06 15:41:54 +0000
48+++ lava/dispatcher/config.py 2011-04-11 16:34:39 +0000
49@@ -66,3 +66,9 @@
50 MASTER_STR = "root@master:"
51 #Test image recognization string
52 TESTER_STR = "root@linaro:"
53+
54+#linaro-maintainers PPA
55+LINARO_MAINTAINERS_PPA = [
56+ "deb http://ppa.launchpad.net/linaro-maintainers/tools/ubuntu natty main",
57+ "deb-src http://ppa.launchpad.net/linaro-maintainers/tools/ubuntu natty main"]
58+LINARO_MAINTAINERS_KEY = "7BE1F97B"

Subscribers

People subscribed via source and target branches