diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-16 17:43:45 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-20 16:43:38 +0000 |
commit | f87b32833ac5327c4659ab8c06af34e7bda83f83 (patch) | |
tree | 0c3cf9004c916e75ff89a0ed2eca9e3cb7d4b501 /meta/lib | |
parent | 7ca1bce20ded40468e31ede74f901434ad31c0e2 (diff) | |
download | openembedded-core-contrib-f87b32833ac5327c4659ab8c06af34e7bda83f83.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/controllers/controllerimage.py (renamed from meta/lib/oeqa/controllers/masterimage.py) | 44 | ||||
-rw-r--r-- | meta/lib/oeqa/runtime/cases/ssh.py | 4 |
2 files changed, 24 insertions, 24 deletions
diff --git a/meta/lib/oeqa/controllers/masterimage.py b/meta/lib/oeqa/controllers/controllerimage.py index 0bf5917e48..78a4aaff87 100644 --- a/meta/lib/oeqa/controllers/masterimage.py +++ b/meta/lib/oeqa/controllers/controllerimage.py @@ -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) diff --git a/meta/lib/oeqa/runtime/cases/ssh.py b/meta/lib/oeqa/runtime/cases/ssh.py index 60a5fbbfbf..e31224b3af 100644 --- a/meta/lib/oeqa/runtime/cases/ssh.py +++ b/meta/lib/oeqa/runtime/cases/ssh.py @@ -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) |