summaryrefslogtreecommitdiffstats
path: root/meta-yocto-bsp/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta-yocto-bsp/lib')
-rw-r--r--meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py19
-rw-r--r--meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py90
-rw-r--r--meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py17
-rw-r--r--meta-yocto-bsp/lib/oeqa/runtime/cases/parselogs-ignores-beaglebone-yocto.txt4
-rw-r--r--meta-yocto-bsp/lib/oeqa/runtime/cases/parselogs-ignores-genericx86-64.txt7
-rw-r--r--meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py14
6 files changed, 36 insertions, 115 deletions
diff --git a/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py b/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
index 0f1aeb398f..7af3e1dac7 100644
--- a/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
+++ b/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
@@ -24,11 +24,10 @@ import subprocess
24import sys 24import sys
25import pexpect 25import pexpect
26 26
27import oeqa.utils.sshcontrol as sshcontrol 27from oeqa.controllers.controllerimage import ControllerImageHardwareTarget
28from oeqa.controllers.masterimage import MasterImageHardwareTarget
29 28
30 29
31class BeagleBoneTarget(MasterImageHardwareTarget): 30class BeagleBoneTarget(ControllerImageHardwareTarget):
32 31
33 dtbs = {'uImage-am335x-bone.dtb': 'am335x-bone.dtb', 'uImage-am335x-boneblack.dtb': 'am335x-boneblack.dtb'} 32 dtbs = {'uImage-am335x-bone.dtb': 'am335x-bone.dtb', 'uImage-am335x-boneblack.dtb': 'am335x-boneblack.dtb'}
34 33
@@ -57,21 +56,21 @@ class BeagleBoneTarget(MasterImageHardwareTarget):
57 56
58 57
59 def _deploy(self): 58 def _deploy(self):
60 self.master.run("umount /boot; umount /mnt/testrootfs;") 59 self.controller.run("umount /boot; umount /mnt/testrootfs;")
61 self.master.ignore_status = False 60 self.controller.ignore_status = False
62 # Kernel and dtb files may not be in the image, so copy them just in case 61 # Kernel and dtb files may not be in the image, so copy them just in case
63 self.master.copy_to(self.kernel, "~/test-kernel") 62 self.controller.copy_to(self.kernel, "~/test-kernel")
64 kernelpath = os.path.dirname(self.kernel) 63 kernelpath = os.path.dirname(self.kernel)
65 for dtborig, dtbfn in self.dtbs.iteritems(): 64 for dtborig, dtbfn in self.dtbs.iteritems():
66 dtbfile = os.path.join(kernelpath, dtborig) 65 dtbfile = os.path.join(kernelpath, dtborig)
67 if os.path.exists(dtbfile): 66 if os.path.exists(dtbfile):
68 self.master.copy_to(dtbfile, "~/%s" % dtbfn) 67 self.controller.copy_to(dtbfile, "~/%s" % dtbfn)
69 self.master.copy_to(self.rootfs, "~/test-rootfs.%s" % self.image_fstype) 68 self.controller.copy_to(self.rootfs, "~/test-rootfs.%s" % self.image_fstype)
70 for cmd in self.deploy_cmds: 69 for cmd in self.deploy_cmds:
71 self.master.run(cmd) 70 self.controller.run(cmd)
72 71
73 def _start(self, params=None): 72 def _start(self, params=None):
74 self.power_cycle(self.master) 73 self.power_cycle(self.controller)
75 try: 74 try:
76 serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout) 75 serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
77 # We'd wait for "U-Boot" here but sometimes we connect too late on BeagleBone white to see it 76 # We'd wait for "U-Boot" here but sometimes we connect too late on BeagleBone white to see it
diff --git a/meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py b/meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py
deleted file mode 100644
index 9c47b5b044..0000000000
--- a/meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py
+++ /dev/null
@@ -1,90 +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 Ubiquiti Networks EdgeRouter Lite. The device must be set up
7# to boot into the master image already - the easiest way to do that is as
8# follows:
9#
10# 1. Take out the internal USB drive and plug it into your PC
11# 2. Repartition the USB drive so that you have three partitions in this
12# order:
13# 1: vfat, labelled "boot" (it will need to be formatted with mkfs.vfat
14# for this to be possible, since FAT partitions formatted under
15# DOS/Windows will only support uppercase labels)
16# 2: ext3 (for master image) labelled "testmaster"
17# 3: ext3 (for image under test) labelled "testrootfs"
18# 3. Copy the kernel to be used by the master image to the FAT partition
19# (it should be named "vmlinux.64" with the factory u-boot configuration)
20# 4. Install the master image onto the "testmaster" ext3 partition. If
21# you do this by just extracting the contents of an image onto the
22# partition, you will also likely need to create the master image marker
23# file /etc/masterimage within this partition so that we can tell when
24# we're booted into it that it is the master image.
25# 5. Put the USB drive back into the device, and ensure the console port
26# and first ethernet port are connected before powering on
27#
28# TEST_SERIALCONTROL_CMD will need to be set in local.conf so that we can
29# interact with u-boot over the serial console port.
30
31import os
32import bb
33import time
34import subprocess
35import sys
36import pexpect
37
38import oeqa.utils.sshcontrol as sshcontrol
39from oeqa.controllers.masterimage import MasterImageHardwareTarget
40
41
42class EdgeRouterTarget(MasterImageHardwareTarget):
43
44 def __init__(self, d):
45 super(EdgeRouterTarget, self).__init__(d)
46
47 self.image_fstype = self.get_image_fstype(d)
48 self.deploy_cmds = [
49 'mount -L boot /boot',
50 'mkdir -p /mnt/testrootfs',
51 'mount -L testrootfs /mnt/testrootfs',
52 'cp ~/test-kernel /boot',
53 'rm -rf /mnt/testrootfs/*',
54 'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype
55 ]
56 if not self.serialcontrol_cmd:
57 bb.fatal("This TEST_TARGET needs a TEST_SERIALCONTROL_CMD defined in local.conf.")
58
59
60 def _deploy(self):
61 self.master.run("umount /mnt/testrootfs;")
62 self.master.ignore_status = False
63 self.master.copy_to(self.kernel, "~/test-kernel")
64 self.master.copy_to(self.rootfs, "~/test-rootfs.%s" % self.image_fstype)
65 for cmd in self.deploy_cmds:
66 self.master.run(cmd)
67
68 def _start(self, params=None):
69 self.power_cycle(self.master)
70 try:
71 serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
72 serialconn.expect("U-Boot")
73 serialconn.sendline("a")
74 serialconn.expect("Octeon ubnt_e100#")
75 serialconn.sendline("fatload usb 0:1 $loadaddr test-kernel")
76 serialconn.expect(" bytes read")
77 serialconn.expect("Octeon ubnt_e100#")
78 serialconn.sendline("bootoctlinux $loadaddr coremask=0x3 root=/dev/sda3 rw rootwait mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@3072k(eeprom)")
79 serialconn.expect("login:", timeout=120)
80 serialconn.close()
81 except pexpect.ExceptionPexpect as e:
82 bb.fatal('Serial interaction failed: %s' % str(e))
83
84 def _wait_until_booted(self):
85 try:
86 serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
87 serialconn.expect("login:", timeout=120)
88 serialconn.close()
89 except pexpect.ExceptionPexpect as e:
90 bb.fatal('Serial interaction failed: %s' % str(e))
diff --git a/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py b/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py
index 7bc807d2bc..c3a98979c5 100644
--- a/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py
+++ b/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py
@@ -19,10 +19,9 @@ import subprocess
19import sys 19import sys
20import pexpect 20import pexpect
21 21
22import oeqa.utils.sshcontrol as sshcontrol 22from oeqa.controllers.controllerimage import ControllerImageHardwareTarget
23from oeqa.controllers.masterimage import MasterImageHardwareTarget
24 23
25class GrubTarget(MasterImageHardwareTarget): 24class GrubTarget(ControllerImageHardwareTarget):
26 25
27 def __init__(self, d): 26 def __init__(self, d):
28 super(GrubTarget, self).__init__(d) 27 super(GrubTarget, self).__init__(d)
@@ -41,16 +40,16 @@ class GrubTarget(MasterImageHardwareTarget):
41 40
42 def _deploy(self): 41 def _deploy(self):
43 # make sure these aren't mounted 42 # make sure these aren't mounted
44 self.master.run("umount /boot; umount /mnt/testrootfs;") 43 self.controller.run("umount /boot; umount /mnt/testrootfs;")
45 self.master.ignore_status = False 44 self.controller.ignore_status = False
46 # Kernel files may not be in the image, so copy them just in case 45 # 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) 46 self.controller.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype)
48 self.master.copy_to(self.kernel, "~/test-kernel") 47 self.controller.copy_to(self.kernel, "~/test-kernel")
49 for cmd in self.deploy_cmds: 48 for cmd in self.deploy_cmds:
50 self.master.run(cmd) 49 self.controller.run(cmd)
51 50
52 def _start(self, params=None): 51 def _start(self, params=None):
53 self.power_cycle(self.master) 52 self.power_cycle(self.controller)
54 try: 53 try:
55 serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout) 54 serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
56 serialconn.expect("GNU GRUB version 2.00") 55 serialconn.expect("GNU GRUB version 2.00")
diff --git a/meta-yocto-bsp/lib/oeqa/runtime/cases/parselogs-ignores-beaglebone-yocto.txt b/meta-yocto-bsp/lib/oeqa/runtime/cases/parselogs-ignores-beaglebone-yocto.txt
new file mode 100644
index 0000000000..b0d98418d1
--- /dev/null
+++ b/meta-yocto-bsp/lib/oeqa/runtime/cases/parselogs-ignores-beaglebone-yocto.txt
@@ -0,0 +1,4 @@
1# These should be reviewed to see if they are still needed
2l4_wkup_cm
3Failed to make EGL context current
4glamor initialization failed \ No newline at end of file
diff --git a/meta-yocto-bsp/lib/oeqa/runtime/cases/parselogs-ignores-genericx86-64.txt b/meta-yocto-bsp/lib/oeqa/runtime/cases/parselogs-ignores-genericx86-64.txt
new file mode 100644
index 0000000000..9a655564cd
--- /dev/null
+++ b/meta-yocto-bsp/lib/oeqa/runtime/cases/parselogs-ignores-genericx86-64.txt
@@ -0,0 +1,7 @@
1# These should be reviewed to see if they are still needed
2Direct firmware load for i915
3Failed to load firmware i915
4Failed to fetch GuC
5Failed to initialize GuC
6Failed to load DMC firmware
7The driver is built-in, so to load the firmware you need to \ No newline at end of file
diff --git a/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py b/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
index 57599e19aa..6fc6925f69 100644
--- a/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
+++ b/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
@@ -2,7 +2,7 @@ import os
2 2
3from oeqa.selftest.case import OESelftestTestCase 3from oeqa.selftest.case import OESelftestTestCase
4from oeqa.core.decorator.depends import OETestDepends 4from oeqa.core.decorator.depends import OETestDepends
5from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu 5from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
6 6
7class Systemdboot(OESelftestTestCase): 7class Systemdboot(OESelftestTestCase):
8 8
@@ -18,11 +18,13 @@ class Systemdboot(OESelftestTestCase):
18 18
19 # Set EFI_PROVIDER = "systemdboot" and MACHINE = "genericx86-64" in conf/local.conf 19 # Set EFI_PROVIDER = "systemdboot" and MACHINE = "genericx86-64" in conf/local.conf
20 features = 'EFI_PROVIDER = "systemd-boot"\n' 20 features = 'EFI_PROVIDER = "systemd-boot"\n'
21 features += 'MACHINE = "genericx86-64"' 21 features += 'MACHINE = "genericx86-64"\n'
22 features += 'COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:genericx86-64 = "genericx86-64"\n'
22 self.append_config(features) 23 self.append_config(features)
23 24
24 deploydir = get_bb_var('DEPLOY_DIR_IMAGE', "core-image-minimal") 25 image = 'core-image-minimal'
25 systemdbootfile = os.path.join(deploydir, 'systemd-bootx64.efi') 26 bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image)
27 systemdbootfile = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], 'systemd-bootx64.efi')
26 28
27 # Ensure we're actually testing that this gets built and not that 29 # Ensure we're actually testing that this gets built and not that
28 # it was around from an earlier build 30 # it was around from an earlier build
@@ -50,8 +52,8 @@ class Systemdboot(OESelftestTestCase):
50 AutomatedBy: Jose Perez Carranza <jose.perez.carranza at linux-intel.com> 52 AutomatedBy: Jose Perez Carranza <jose.perez.carranza at linux-intel.com>
51 """ 53 """
52 54
53 systemdbootimage = os.path.join(deploydir, 'core-image-minimal-genericx86-64.wic') 55 systemdbootimage = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], '%s.wic' % bb_vars['IMAGE_LINK_NAME'])
54 imagebootfile = os.path.join(deploydir, 'bootx64.efi') 56 imagebootfile = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], 'bootx64.efi')
55 57
56 # Clean environment before start the test 58 # Clean environment before start the test
57 if os.path.isfile(imagebootfile): 59 if os.path.isfile(imagebootfile):