From 077dc19445574457769eb4f231de97e8059cb75e Mon Sep 17 00:00:00 2001 From: Mariano Lopez Date: Fri, 13 Jan 2017 10:47:53 +0000 Subject: testimage.bbclass: Add package install feature This allows to use the package install feature with the new OEQA framework. [YOCTO #10234] Signed-off-by: Mariano Lopez --- meta/classes/testimage.bbclass | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'meta/classes/testimage.bbclass') diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass index 1dfbc490de..96e41c6c87 100644 --- a/meta/classes/testimage.bbclass +++ b/meta/classes/testimage.bbclass @@ -159,7 +159,6 @@ def testimage_main(d): pn = d.getVar("PN") bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR")) - #test_create_extract_dirs(d) image_name = ("%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))) @@ -170,6 +169,8 @@ def testimage_main(d): image_manifest = "%s.manifest" % image_name image_packages = OERuntimeTestContextExecutor.readPackagesManifest(image_manifest) + extract_dir = d.getVar("TEST_EXTRACTED_DIR") + # Get machine machine = d.getVar("MACHINE") @@ -236,7 +237,8 @@ def testimage_main(d): d.getVar("TEST_SERVER_IP"), **target_kwargs) # test context - tc = OERuntimeTestContext(td, logger, target, host_dumper, image_packages) + tc = OERuntimeTestContext(td, logger, target, host_dumper, + image_packages, extract_dir) # Load tests before starting the target test_paths = get_runtime_paths(d) @@ -343,22 +345,13 @@ def package_extraction(d, test_suites): from oeqa.utils.package_manager import find_packages_to_extract from oeqa.utils.package_manager import extract_packages - test_create_extract_dirs(d) + bb.utils.remove(d.getVar("TEST_NEEDED_PACKAGES_DIR"), recurse=True) packages = find_packages_to_extract(test_suites) - extract_packages(d, packages) - -def test_create_extract_dirs(d): - install_path = d.getVar("TEST_INSTALL_TMP_DIR") - package_path = d.getVar("TEST_PACKAGED_DIR") - extracted_path = d.getVar("TEST_EXTRACTED_DIR") - bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR")) - bb.utils.remove(install_path, recurse=True) - bb.utils.remove(package_path, recurse=True) - bb.utils.remove(extracted_path, recurse=True) - bb.utils.mkdirhier(install_path) - bb.utils.mkdirhier(package_path) - bb.utils.mkdirhier(extracted_path) - + if packages: + bb.utils.mkdirhier(d.getVar("TEST_INSTALL_TMP_DIR")) + bb.utils.mkdirhier(d.getVar("TEST_PACKAGED_DIR")) + bb.utils.mkdirhier(d.getVar("TEST_EXTRACTED_DIR")) + extract_packages(d, packages) testimage_main[vardepsexclude] += "BB_ORIGENV DATETIME" -- cgit v1.2.3