1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

oetest.py: Add install/uninstall functionality for DUTs

Add the functionality to install/unistall packages in the
DUTs without the use of the package manager. This is possible
with the extraction introduced in package manager class.

testimage and testexport bbclasses has been modified in order
to support this new feature.

[YOCTO #8694]

(From OE-Core rev: b7111d9e9d64d21f57729d1ac1865aea6e54cc8b)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Mariano Lopez
2016-06-06 07:15:41 +00:00
committed by Richard Purdie
parent d9b3ee8b38
commit 938f05333b
3 changed files with 120 additions and 5 deletions
+18
View File
@@ -30,6 +30,10 @@
TEST_LOG_DIR ?= "${WORKDIR}/testimage"
TEST_EXPORT_DIR ?= "${TMPDIR}/testimage/${PN}"
TEST_INSTALL_TMP_DIR ?= "${WORKDIR}/testimage/install_tmp"
TEST_NEEDED_PACKAGES_DIR ?= "${WORKDIR}/testimage/packages"
TEST_EXTRACTED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/extracted"
TEST_PACKAGED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/packaged"
RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'smart rpm', '', d)}"
MINTESTSUITE = "ping"
@@ -100,6 +104,7 @@ testimage_dump_host () {
python do_testimage() {
testimage_main(d)
}
addtask testimage
do_testimage[nostamp] = "1"
do_testimage[depends] += "${TESTIMAGEDEPENDS}"
@@ -117,6 +122,7 @@ def testimage_main(d):
pn = d.getVar("PN", True)
bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
test_create_extract_dirs(d)
# we need the host dumper in test context
host_dumper = get_host_dumper(d)
@@ -136,6 +142,7 @@ def testimage_main(d):
import traceback
bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
tc.extract_packages()
target.deploy()
try:
target.start()
@@ -155,6 +162,17 @@ def testimage_main(d):
signal.signal(signal.SIGTERM, tc.origsigtermhandler)
target.stop()
def test_create_extract_dirs(d):
install_path = d.getVar("TEST_INSTALL_TMP_DIR", True)
package_path = d.getVar("TEST_PACKAGED_DIR", True)
extracted_path = d.getVar("TEST_EXTRACTED_DIR", True)
bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
bb.utils.remove(package_path, recurse=True)
bb.utils.mkdirhier(install_path)
bb.utils.mkdirhier(package_path)
bb.utils.mkdirhier(extracted_path)
testimage_main[vardepsexclude] =+ "BB_ORIGENV"
inherit testsdk