mirror of
https://git.yoctoproject.org/git/poky
synced 2026-01-04 16:10:04 +00:00
core-image-testmaster: Rename to core-image-testcontroller
Rename the image, the test controller class/code/module and the underlying image sentinel file to all match the controller terminology. (From OE-Core rev: f87b32833ac5327c4659ab8c06af34e7bda83f83) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
9ebd0a84e7
commit
95f236f668
|
|
@ -42,8 +42,8 @@ DISTRO_PN_ALIAS:pn-core-image-rt-sdk = "OE-Core"
|
|||
DISTRO_PN_ALIAS:pn-core-image-sato = "OE-Core"
|
||||
DISTRO_PN_ALIAS:pn-core-image-sato-dev = "OE-Core"
|
||||
DISTRO_PN_ALIAS:pn-core-image-sato-sdk = "OE-Core"
|
||||
DISTRO_PN_ALIAS:pn-core-image-testmaster = "OE-Core"
|
||||
DISTRO_PN_ALIAS:pn-core-image-testmaster-initramfs = "OE-Core"
|
||||
DISTRO_PN_ALIAS:pn-core-image-testcontroller = "OE-Core"
|
||||
DISTRO_PN_ALIAS:pn-core-image-testcontroller-initramfs = "OE-Core"
|
||||
DISTRO_PN_ALIAS:pn-core-image-weston = "OE-Core"
|
||||
DISTRO_PN_ALIAS:pn-core-image-x11 = "OE-Core"
|
||||
DISTRO_PN_ALIAS:pn-createrepo-c = "Fedora=createrepo_c Clear=createrepo_c"
|
||||
|
|
|
|||
|
|
@ -112,8 +112,8 @@ RECIPE_MAINTAINER:pn-core-image-ptest-all = "Richard Purdie <richard.purdie@linu
|
|||
RECIPE_MAINTAINER:pn-core-image-ptest-fast = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER:pn-core-image-sato = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER:pn-core-image-sato-sdk = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER:pn-core-image-testmaster-initramfs = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER:pn-core-image-testmaster = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER:pn-core-image-testcontroller-initramfs = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER:pn-core-image-testcontroller = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER:pn-core-image-weston = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER:pn-core-image-weston-sdk = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER:pn-core-image-x11 = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
# This module adds support to testimage.bbclass to deploy images and run
|
||||
# tests using a "master image" - this is a "known good" image that is
|
||||
# tests using a "controller image" - this is a "known good" image that is
|
||||
# installed onto the device as part of initial setup and will be booted into
|
||||
# with no interaction; we can then use it to deploy the image to be tested
|
||||
# to a second partition before running the tests.
|
||||
#
|
||||
# For an example master image, see core-image-testmaster
|
||||
# (meta/recipes-extended/images/core-image-testmaster.bb)
|
||||
# For an example controller image, see core-image-testcontroller
|
||||
# (meta/recipes-extended/images/core-image-testcontroller.bb)
|
||||
|
||||
import os
|
||||
import bb
|
||||
|
|
@ -24,12 +24,12 @@ from oeqa.utils import CommandError
|
|||
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta):
|
||||
class ControllerImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta):
|
||||
|
||||
supported_image_fstypes = ['tar.gz', 'tar.bz2']
|
||||
|
||||
def __init__(self, d):
|
||||
super(MasterImageHardwareTarget, self).__init__(d)
|
||||
super(ControllerImageHardwareTarget, self).__init__(d)
|
||||
|
||||
# target ip
|
||||
addr = d.getVar("TEST_TARGET_IP") or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
|
||||
|
|
@ -61,8 +61,8 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta
|
|||
if not os.path.isfile(self.kernel):
|
||||
bb.fatal("No kernel found. Expected path: %s" % self.kernel)
|
||||
|
||||
# master ssh connection
|
||||
self.master = None
|
||||
# controller ssh connection
|
||||
self.controller = None
|
||||
# if the user knows what they are doing, then by all means...
|
||||
self.user_cmds = d.getVar("TEST_DEPLOY_CMDS")
|
||||
self.deploy_cmds = None
|
||||
|
|
@ -119,19 +119,19 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta
|
|||
|
||||
def deploy(self):
|
||||
# base class just sets the ssh log file for us
|
||||
super(MasterImageHardwareTarget, self).deploy()
|
||||
self.master = sshcontrol.SSHControl(ip=self.ip, logfile=self.sshlog, timeout=600, port=self.port)
|
||||
status, output = self.master.run("cat /etc/masterimage")
|
||||
super(ControllerImageHardwareTarget, self).deploy()
|
||||
self.controller = sshcontrol.SSHControl(ip=self.ip, logfile=self.sshlog, timeout=600, port=self.port)
|
||||
status, output = self.controller.run("cat /etc/controllerimage")
|
||||
if status != 0:
|
||||
# We're not booted into the master image, so try rebooting
|
||||
bb.plain("%s - booting into the master image" % self.pn)
|
||||
# We're not booted into the controller image, so try rebooting
|
||||
bb.plain("%s - booting into the controller image" % self.pn)
|
||||
self.power_ctl("cycle")
|
||||
self._wait_until_booted()
|
||||
|
||||
bb.plain("%s - deploying image on target" % self.pn)
|
||||
status, output = self.master.run("cat /etc/masterimage")
|
||||
status, output = self.controller.run("cat /etc/controllerimage")
|
||||
if status != 0:
|
||||
bb.fatal("No ssh connectivity or target isn't running a master image.\n%s" % output)
|
||||
bb.fatal("No ssh connectivity or target isn't running a controller image.\n%s" % output)
|
||||
if self.user_cmds:
|
||||
self.deploy_cmds = self.user_cmds.split("\n")
|
||||
try:
|
||||
|
|
@ -156,10 +156,10 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta
|
|||
|
||||
def stop(self):
|
||||
bb.plain("%s - reboot/powercycle target" % self.pn)
|
||||
self.power_cycle(self.master)
|
||||
self.power_cycle(self.controller)
|
||||
|
||||
|
||||
class SystemdbootTarget(MasterImageHardwareTarget):
|
||||
class SystemdbootTarget(ControllerImageHardwareTarget):
|
||||
|
||||
def __init__(self, d):
|
||||
super(SystemdbootTarget, self).__init__(d)
|
||||
|
|
@ -184,16 +184,16 @@ class SystemdbootTarget(MasterImageHardwareTarget):
|
|||
|
||||
def _deploy(self):
|
||||
# make sure these aren't mounted
|
||||
self.master.run("umount /boot; umount /mnt/testrootfs; umount /sys/firmware/efi/efivars;")
|
||||
self.controller.run("umount /boot; umount /mnt/testrootfs; umount /sys/firmware/efi/efivars;")
|
||||
# from now on, every deploy cmd should return 0
|
||||
# else an exception will be thrown by sshcontrol
|
||||
self.master.ignore_status = False
|
||||
self.master.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype)
|
||||
self.master.copy_to(self.kernel, "~/test-kernel")
|
||||
self.controller.ignore_status = False
|
||||
self.controller.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype)
|
||||
self.controller.copy_to(self.kernel, "~/test-kernel")
|
||||
for cmd in self.deploy_cmds:
|
||||
self.master.run(cmd)
|
||||
self.controller.run(cmd)
|
||||
|
||||
def _start(self, params=None):
|
||||
self.power_cycle(self.master)
|
||||
self.power_cycle(self.controller)
|
||||
# there are better ways than a timeout but this should work for now
|
||||
time.sleep(120)
|
||||
|
|
@ -13,7 +13,7 @@ class SSHTest(OERuntimeTestCase):
|
|||
def test_ssh(self):
|
||||
(status, output) = self.target.run('uname -a')
|
||||
self.assertEqual(status, 0, msg='SSH Test failed: %s' % output)
|
||||
(status, output) = self.target.run('cat /etc/masterimage')
|
||||
msg = "This isn't the right image - /etc/masterimage " \
|
||||
(status, output) = self.target.run('cat /etc/controllerimage')
|
||||
msg = "This isn't the right image - /etc/controllerimage " \
|
||||
"shouldn't be here %s" % output
|
||||
self.assertEqual(status, 1, msg=msg)
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /rootmnt
|
|||
echo "Copying rootfs files..."
|
||||
cp -a /rootmnt/* /ssd
|
||||
|
||||
touch /ssd/etc/masterimage
|
||||
touch /ssd/etc/controllerimage
|
||||
|
||||
if [ -d /ssd/etc/ ] ; then
|
||||
# We dont want udev to mount our root device while we're booting...
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
|
|||
echo "Copying rootfs files..."
|
||||
cp -a /src_root/* /tgt_root
|
||||
|
||||
touch /tgt_root/etc/masterimage
|
||||
touch /tgt_root/etc/controllerimage
|
||||
|
||||
if [ -d /tgt_root/etc/ ] ; then
|
||||
echo "$bootfs /boot ext3 defaults 1 2" >> /tgt_root/etc/fstab
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install-testfs initramfs-l
|
|||
# Do not pollute the initrd image with rootfs features
|
||||
IMAGE_FEATURES = ""
|
||||
|
||||
export IMAGE_BASENAME = "core-image-testmaster-initramfs"
|
||||
export IMAGE_BASENAME = "core-image-testcontroller-initramfs"
|
||||
IMAGE_NAME_SUFFIX ?= ""
|
||||
IMAGE_LINGUAS = ""
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
DESCRIPTION = "A master image to be deployed on a target useful for testing other images"
|
||||
DESCRIPTION = "A test controller image to be deployed on a target useful for testing other images using the OEQA runtime tests"
|
||||
|
||||
IMAGE_FEATURES += "ssh-server-openssh package-management"
|
||||
|
||||
|
|
@ -14,5 +14,5 @@ IMAGE_INSTALL += "\
|
|||
# we need a particular initramfs for live images
|
||||
# that pulls custom install scripts which take
|
||||
# care of partitioning for us
|
||||
INITRD_IMAGE = "core-image-testmaster-initramfs"
|
||||
INITRD_IMAGE = "core-image-testcontroller-initramfs"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user