From aef1420e85f12b7d69353afb2b86b354e0e4b2d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eil=C3=ADs=20N=C3=AD=20Fhlannag=C3=A1in?=
 <elizabeth.flanagan@huawei.com>
Date: Mon, 27 Sep 2021 16:30:04 +0100
Subject: [PATCH] allscenarios-image*-tests: Add package testing to the test
 images
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is the first step in initiating automated package testing for
images. There will need to be some work on the CI side and some work on
the entire process but this is a first pass at getting the images to the
point where they have ptest on them.

This commit also adds an ext4 filesystem so we can test a writable
image. The wic image is still r/o but there is some benefit to having
tests run on a r/w fs.

Signed-off-by: Eilís Ní Fhlannagáin <elizabeth.flanagan@huawei.com>
---
 .../recipes-core/images/allscenarios-image-base-tests.bb    | 6 ++++++
 .../recipes-core/images/allscenarios-image-extra-tests.bb   | 6 ++++++
 .../packagegroups/packagegroup-allscenarios-tests.bb        | 3 ++-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/meta-ohos-core/recipes-core/images/allscenarios-image-base-tests.bb b/meta-ohos-core/recipes-core/images/allscenarios-image-base-tests.bb
index 70b01382..651398a7 100644
--- a/meta-ohos-core/recipes-core/images/allscenarios-image-base-tests.bb
+++ b/meta-ohos-core/recipes-core/images/allscenarios-image-base-tests.bb
@@ -9,3 +9,9 @@ SUMMARY = "AllScenariOS image including the base OS software stack and tests"
 IMAGE_INSTALL_append = "\
     packagegroup-allscenarios-tests \
 "
+
+# This adds ptest packages to the image
+EXTRA_IMAGE_FEATURES_append = " ptest-pkgs"
+
+# For testing purposes we want the ability to have a writable filesystem
+IMAGE_FSTYPES_append = " ext4"
diff --git a/meta-ohos-core/recipes-core/images/allscenarios-image-extra-tests.bb b/meta-ohos-core/recipes-core/images/allscenarios-image-extra-tests.bb
index 6e950f0f..7f45beb9 100644
--- a/meta-ohos-core/recipes-core/images/allscenarios-image-extra-tests.bb
+++ b/meta-ohos-core/recipes-core/images/allscenarios-image-extra-tests.bb
@@ -10,3 +10,9 @@ software stack and tests"
 IMAGE_INSTALL_append = "\
     packagegroup-allscenarios-tests \
 "
+
+# This adds ptest packages to the image
+EXTRA_IMAGE_FEATURES_append = " ptest-pkgs"
+
+# For testing purposes we want the ability to have a writable filesystem
+IMAGE_FSTYPES_append = " ext4"
diff --git a/meta-ohos-core/recipes-core/packagegroups/packagegroup-allscenarios-tests.bb b/meta-ohos-core/recipes-core/packagegroups/packagegroup-allscenarios-tests.bb
index 24cf34c7..07e0b4b3 100644
--- a/meta-ohos-core/recipes-core/packagegroups/packagegroup-allscenarios-tests.bb
+++ b/meta-ohos-core/recipes-core/packagegroups/packagegroup-allscenarios-tests.bb
@@ -12,4 +12,5 @@ PACKAGES = "\
 
 RDEPENDS_packagegroup-allscenarios-tests = "\
 	ohos-xts-acts \
-	"
+	ptest-runner \
+        "
-- 
GitLab