summaryrefslogtreecommitdiffstats
path: root/meta-yocto-bsp/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-04 08:43:33 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-04 08:46:00 +0100
commit57bbb1af5ea1ef0cf10d92e399c445a3607b8be2 (patch)
tree295d0d0697a891e9e01bfc400303f2bc9de6439e /meta-yocto-bsp/lib
parentb21f799dfe4297a910a661859a28affadf310a69 (diff)
downloadpoky-57bbb1af5ea1ef0cf10d92e399c445a3607b8be2.tar.gz
Revert "meta-yocto-bsp: oeqa/controllers: add GrubTarget"
This reverts commit 01968e9244d0cf3deb1ec5cfb8e562d3b364add6. Wrong repo Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-yocto-bsp/lib')
-rw-r--r--meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py71
1 files changed, 0 insertions, 71 deletions
diff --git a/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py b/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py
deleted file mode 100644
index 02ada65da6..0000000000
--- a/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py
+++ /dev/null
@@ -1,71 +0,0 @@
1# Copyright (C) 2014 Intel Corporation
2#
3# Released under the MIT license (see COPYING.MIT)
4
5# This module adds support to testimage.bbclass to deploy images and run
6# tests on a Generic PC that boots using grub bootloader. The device must
7# be set up as per README.hardware and the master image should be deployed
8# onto the harddisk so that it boots into it by default.For booting into the
9# image under test we interact with grub over serial, so for the
10# Generic PC you will need an additional serial cable and device under test
11# needs to have a serial interface. The separate ext3
12# partition that will contain the image to be tested must be labelled
13# "testrootfs" so that the deployment code below can find it.
14
15import os
16import bb
17import time
18import subprocess
19import sys
20import pexpect
21
22import oeqa.utils.sshcontrol as sshcontrol
23from oeqa.controllers.masterimage import MasterImageHardwareTarget
24
25class GrubTarget(MasterImageHardwareTarget):
26
27 def __init__(self, d):
28 super(GrubTarget, self).__init__(d)
29 self.deploy_cmds = [
30 'mount -L boot /boot',
31 'mkdir -p /mnt/testrootfs',
32 'mount -L testrootfs /mnt/testrootfs',
33 'cp ~/test-kernel /boot',
34 'rm -rf /mnt/testrootfs/*',
35 'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype,
36 ]
37
38 if not self.serialcontrol_cmd:
39 bb.fatal("This TEST_TARGET needs a TEST_SERIALCONTROL_CMD defined in local.conf.")
40
41
42 def _deploy(self):
43 # make sure these aren't mounted
44 self.master.run("umount /boot; umount /mnt/testrootfs;")
45 self.master.ignore_status = False
46 # Kernel files may not be in the image, so copy them just in case
47 self.master.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype)
48 self.master.copy_to(self.kernel, "~/test-kernel")
49 for cmd in self.deploy_cmds:
50 self.master.run(cmd)
51
52 def _start(self, params=None):
53 self.power_cycle(self.master)
54 try:
55 serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
56 serialconn.expect("GNU GRUB version 2.00")
57 serialconn.expect("Linux")
58 serialconn.sendline("OB\r")
59 serialconn.expect("login:", timeout=120)
60 serialconn.close()
61 except pexpect.ExceptionPexpect as e:
62 bb.fatal('Serial interaction failed: %s' % str(e))
63
64 def _wait_until_booted(self):
65 try:
66 serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
67 serialconn.expect("login:", timeout=120)
68 serialconn.close()
69 except pexpect.ExceptionPexpect as e:
70 bb.fatal('Serial interaction failed: %s' % str(e))
71