[isar-cip-core] tests: put all tests into a opt layer


Daniel Sangorrin <daniel.sangorrin@...>
 

having an opt-tests layer makes it easier to see what
tests are installed, and allows creating images without
them as well

Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
---
.gitlab-ci.yml | 8 ++++----
README.md | 4 ++++
opt-tests.yml | 19 +++++++++++++++++++
recipes-core/customizations/customizations.bb | 5 ++---
recipes-core/images/cip-core-image.bb | 3 +--
5 files changed, 30 insertions(+), 9 deletions(-)
create mode 100644 opt-tests.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6f1dc91..90eec1f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,17 +13,17 @@ all:
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY

- - kas build kas.yml:board-simatic-ipc227e.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-simatic-ipc227e.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster simatic-ipc227e

- sudo rm -rf build/tmp
- - kas build kas.yml:board-bbb.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-bbb.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster bbb am335x-boneblack.dtb

- sudo rm -rf build/tmp
- - kas build kas.yml:board-iwg20m.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-iwg20m.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster iwg20m r8a7743-iwg20d-q7-dbcm-ca.dtb

- sudo rm -rf build/tmp
- - kas build kas.yml:board-rzg2m.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-rzg2m.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster hihope-rzg2m renesas/r8a774a1-hihope-rzg2m-ex.dtb
diff --git a/README.md b/README.md
index bbad1a0..7339396 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,10 @@ this:

This image can be run using `start-qemu.sh x86`.

+If you want to include the testing layer add ':opt-tests.yml' like this
+
+ ./kas-docker --isar build kas.yml:board-qemu-amd64.yml:opt-tests.yml
+
The BeagleBone Black target is selected by `... kas.yml:board-bbb.yml`. In
order to build the image with the PREEMPT-RT kernel, append `:opt-rt.yml` to
the above. Append ':opt-4.4.yml' to use the kernel version 4.4 instead of 4.19.
diff --git a/opt-tests.yml b/opt-tests.yml
new file mode 100644
index 0000000..a1f431d
--- /dev/null
+++ b/opt-tests.yml
@@ -0,0 +1,19 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba corp., 2020
+#
+# Authors:
+# Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
+#
+# SPDX-License-Identifier: MIT
+#
+
+header:
+ version: 8
+
+local_conf_header:
+ tests: |
+ IMAGE_INSTALL += "ltp-full"
+ IMAGE_PREINSTALL += "rt-tests stress-ng"
+
diff --git a/recipes-core/customizations/customizations.bb b/recipes-core/customizations/customizations.bb
index 38881fb..cbd6daf 100644
--- a/recipes-core/customizations/customizations.bb
+++ b/recipes-core/customizations/customizations.bb
@@ -11,7 +11,7 @@

inherit dpkg-raw

-DESCRIPTION = "CIP Core image demo & test customizations"
+DESCRIPTION = "CIP Core image demo customizations"

SRC_URI = " \
file://postinst \
@@ -21,8 +21,7 @@ SRC_URI = " \
DEPENDS += "sshd-regen-keys"

DEBIAN_DEPENDS = " \
- ifupdown, isc-dhcp-client, net-tools, iputils-ping, ssh, sshd-regen-keys, \
- rt-tests, stress-ng"
+ ifupdown, isc-dhcp-client, net-tools, iputils-ping, ssh, sshd-regen-keys"

do_install() {
install -v -d ${D}/etc/network/interfaces.d
diff --git a/recipes-core/images/cip-core-image.bb b/recipes-core/images/cip-core-image.bb
index 9ee4b25..188c714 100644
--- a/recipes-core/images/cip-core-image.bb
+++ b/recipes-core/images/cip-core-image.bb
@@ -15,5 +15,4 @@ ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags --dirty --always
DESCRIPTION = "CIP Core image"

IMAGE_INSTALL += "customizations"
-# for cip-testing
-IMAGE_INSTALL += "ltp-full"
+
--
2.25.1


Jan Kiszka
 

On 21.07.20 14:42, Daniel Sangorrin wrote:
having an opt-tests layer makes it easier to see what
tests are installed, and allows creating images without
them as well
"Having ... as well."

Does this obsolete https://gitlab.com/cip-project/cip-core/isar-cip-core/-/merge_requests/7, where I just commented on?

Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
---
.gitlab-ci.yml | 8 ++++----
README.md | 4 ++++
opt-tests.yml | 19 +++++++++++++++++++
recipes-core/customizations/customizations.bb | 5 ++---
recipes-core/images/cip-core-image.bb | 3 +--
5 files changed, 30 insertions(+), 9 deletions(-)
create mode 100644 opt-tests.yml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6f1dc91..90eec1f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,17 +13,17 @@ all:
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- - kas build kas.yml:board-simatic-ipc227e.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-simatic-ipc227e.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster simatic-ipc227e
- sudo rm -rf build/tmp
- - kas build kas.yml:board-bbb.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-bbb.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster bbb am335x-boneblack.dtb
- sudo rm -rf build/tmp
- - kas build kas.yml:board-iwg20m.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-iwg20m.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster iwg20m r8a7743-iwg20d-q7-dbcm-ca.dtb
- sudo rm -rf build/tmp
- - kas build kas.yml:board-rzg2m.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-rzg2m.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster hihope-rzg2m renesas/r8a774a1-hihope-rzg2m-ex.dtb
diff --git a/README.md b/README.md
index bbad1a0..7339396 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,10 @@ this:
This image can be run using `start-qemu.sh x86`.
+If you want to include the testing layer add ':opt-tests.yml' like this
Wording: It's not a testing layer, it's "test packages", no?

+
+ ./kas-docker --isar build kas.yml:board-qemu-amd64.yml:opt-tests.yml
+
The BeagleBone Black target is selected by `... kas.yml:board-bbb.yml`. In
order to build the image with the PREEMPT-RT kernel, append `:opt-rt.yml` to
the above. Append ':opt-4.4.yml' to use the kernel version 4.4 instead of 4.19.
diff --git a/opt-tests.yml b/opt-tests.yml
new file mode 100644
index 0000000..a1f431d
--- /dev/null
+++ b/opt-tests.yml
@@ -0,0 +1,19 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba corp., 2020
+#
+# Authors:
+# Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
+#
+# SPDX-License-Identifier: MIT
+#
+
+header:
+ version: 8
+
+local_conf_header:
+ tests: |
+ IMAGE_INSTALL += "ltp-full"
+ IMAGE_PREINSTALL += "rt-tests stress-ng"
This, in fact, has some benefit over a separate image in that it would also allow to make the security image testable by appending the snippet

+
No extra line at EOF, please.

diff --git a/recipes-core/customizations/customizations.bb b/recipes-core/customizations/customizations.bb
index 38881fb..cbd6daf 100644
--- a/recipes-core/customizations/customizations.bb
+++ b/recipes-core/customizations/customizations.bb
@@ -11,7 +11,7 @@
inherit dpkg-raw
-DESCRIPTION = "CIP Core image demo & test customizations"
+DESCRIPTION = "CIP Core image demo customizations"
Maybe "reference customizations" - typically, you will replace this package for a real product with a, well, product specific customization.

SRC_URI = " \
file://postinst \
@@ -21,8 +21,7 @@ SRC_URI = " \
DEPENDS += "sshd-regen-keys"
DEBIAN_DEPENDS = " \
- ifupdown, isc-dhcp-client, net-tools, iputils-ping, ssh, sshd-regen-keys, \
- rt-tests, stress-ng"
+ ifupdown, isc-dhcp-client, net-tools, iputils-ping, ssh, sshd-regen-keys"
do_install() {
install -v -d ${D}/etc/network/interfaces.d
diff --git a/recipes-core/images/cip-core-image.bb b/recipes-core/images/cip-core-image.bb
index 9ee4b25..188c714 100644
--- a/recipes-core/images/cip-core-image.bb
+++ b/recipes-core/images/cip-core-image.bb
@@ -15,5 +15,4 @@ ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags --dirty --always
DESCRIPTION = "CIP Core image"
IMAGE_INSTALL += "customizations"
-# for cip-testing
-IMAGE_INSTALL += "ltp-full"
+
No extra line at EOF, please.

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


Daniel Sangorrin <daniel.sangorrin@...>
 

________________________________________
From: Jan Kiszka <jan.kiszka@siemens.com>
Sent: Wednesday, July 22, 2020 3:44 PM
To: cip-dev@lists.cip-project.org; sangorrin daniel(サンゴリン ダニエル □SWC◯ACT); iwamatsu nobuhiro(岩松 信洋 □SWC◯ACT)
Subject: Re: [cip-dev] [isar-cip-core] tests: put all tests into a opt layer

On 21.07.20 14:42, Daniel Sangorrin wrote:
having an opt-tests layer makes it easier to see what
tests are installed, and allows creating images without
them as well
JAN:
"Having ... as well."

Does this obsolete
https://gitlab.com/cip-project/cip-core/isar-cip-core/-/merge_requests/7,
where I just commented on?

DANIEL: Maybe you can apply Iwamatsu-san merge request first, and I will prepare a new patch on top of that to avoid confusion.

Thanks,
Daniel


Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
---
.gitlab-ci.yml | 8 ++++----
README.md | 4 ++++
opt-tests.yml | 19 +++++++++++++++++++
recipes-core/customizations/customizations.bb | 5 ++---
recipes-core/images/cip-core-image.bb | 3 +--
5 files changed, 30 insertions(+), 9 deletions(-)
create mode 100644 opt-tests.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6f1dc91..90eec1f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,17 +13,17 @@ all:
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY

- - kas build kas.yml:board-simatic-ipc227e.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-simatic-ipc227e.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster simatic-ipc227e

- sudo rm -rf build/tmp
- - kas build kas.yml:board-bbb.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-bbb.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster bbb am335x-boneblack.dtb

- sudo rm -rf build/tmp
- - kas build kas.yml:board-iwg20m.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-iwg20m.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster iwg20m r8a7743-iwg20d-q7-dbcm-ca.dtb

- sudo rm -rf build/tmp
- - kas build kas.yml:board-rzg2m.yml:opt-rt.yml:opt-targz-img.yml
+ - kas build kas.yml:board-rzg2m.yml:opt-tests.yml:opt-rt.yml:opt-targz-img.yml
- scripts/deploy-cip-core.sh buster hihope-rzg2m renesas/r8a774a1-hihope-rzg2m-ex.dtb
diff --git a/README.md b/README.md
index bbad1a0..7339396 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,10 @@ this:

This image can be run using `start-qemu.sh x86`.

+If you want to include the testing layer add ':opt-tests.yml' like this
Wording: It's not a testing layer, it's "test packages", no?

+
+ ./kas-docker --isar build kas.yml:board-qemu-amd64.yml:opt-tests.yml
+
The BeagleBone Black target is selected by `... kas.yml:board-bbb.yml`. In
order to build the image with the PREEMPT-RT kernel, append `:opt-rt.yml` to
the above. Append ':opt-4.4.yml' to use the kernel version 4.4 instead of 4.19.
diff --git a/opt-tests.yml b/opt-tests.yml
new file mode 100644
index 0000000..a1f431d
--- /dev/null
+++ b/opt-tests.yml
@@ -0,0 +1,19 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba corp., 2020
+#
+# Authors:
+# Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
+#
+# SPDX-License-Identifier: MIT
+#
+
+header:
+ version: 8
+
+local_conf_header:
+ tests: |
+ IMAGE_INSTALL += "ltp-full"
+ IMAGE_PREINSTALL += "rt-tests stress-ng"
This, in fact, has some benefit over a separate image in that it would
also allow to make the security image testable by appending the snippet

+
No extra line at EOF, please.

diff --git a/recipes-core/customizations/customizations.bb b/recipes-core/customizations/customizations.bb
index 38881fb..cbd6daf 100644
--- a/recipes-core/customizations/customizations.bb
+++ b/recipes-core/customizations/customizations.bb
@@ -11,7 +11,7 @@

inherit dpkg-raw

-DESCRIPTION = "CIP Core image demo & test customizations"
+DESCRIPTION = "CIP Core image demo customizations"
Maybe "reference customizations" - typically, you will replace this
package for a real product with a, well, product specific customization.


SRC_URI = " \
file://postinst \
@@ -21,8 +21,7 @@ SRC_URI = " \
DEPENDS += "sshd-regen-keys"

DEBIAN_DEPENDS = " \
- ifupdown, isc-dhcp-client, net-tools, iputils-ping, ssh, sshd-regen-keys, \
- rt-tests, stress-ng"
+ ifupdown, isc-dhcp-client, net-tools, iputils-ping, ssh, sshd-regen-keys"

do_install() {
install -v -d ${D}/etc/network/interfaces.d
diff --git a/recipes-core/images/cip-core-image.bb b/recipes-core/images/cip-core-image.bb
index 9ee4b25..188c714 100644
--- a/recipes-core/images/cip-core-image.bb
+++ b/recipes-core/images/cip-core-image.bb
@@ -15,5 +15,4 @@ ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags --dirty --always
DESCRIPTION = "CIP Core image"

IMAGE_INSTALL += "customizations"
-# for cip-testing
-IMAGE_INSTALL += "ltp-full"
+
No extra line at EOF, please.

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


Jan Kiszka
 

On 22.07.20 09:25, daniel.sangorrin@toshiba.co.jp wrote:
________________________________________
From: Jan Kiszka <jan.kiszka@siemens.com>
Sent: Wednesday, July 22, 2020 3:44 PM
To: cip-dev@lists.cip-project.org; sangorrin daniel(サンゴリン ダニエル □SWC◯ACT); iwamatsu nobuhiro(岩松 信洋 □SWC◯ACT)
Subject: Re: [cip-dev] [isar-cip-core] tests: put all tests into a opt layer
On 21.07.20 14:42, Daniel Sangorrin wrote:
having an opt-tests layer makes it easier to see what
tests are installed, and allows creating images without
them as well
JAN:
"Having ... as well."
Does this obsolete
https://gitlab.com/cip-project/cip-core/isar-cip-core/-/merge_requests/7,
where I just commented on?
DANIEL: Maybe you can apply Iwamatsu-san merge request first, and I will prepare a new patch on top of that to avoid confusion.
That would confuse me now: What creating a separate test image first, just to remove it again?

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


Daniel Sangorrin <daniel.sangorrin@...>
 

Hi Jan

-----Original Message-----
From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On Behalf Of Jan Kiszka
Sent: Wednesday, July 22, 2020 5:05 PM
To: sangorrin daniel(サンゴリン ダニエル □SWC◯ACT) <daniel.sangorrin@toshiba.co.jp>; cip-dev@lists.cip-project.org; iwamatsu
nobuhiro(岩松 信洋 □SWC◯ACT) <nobuhiro1.iwamatsu@toshiba.co.jp>
Subject: Re: [cip-dev] [isar-cip-core] tests: put all tests into a opt layer

On 22.07.20 09:25, daniel.sangorrin@toshiba.co.jp wrote:
________________________________________
From: Jan Kiszka <jan.kiszka@siemens.com>
Sent: Wednesday, July 22, 2020 3:44 PM
To: cip-dev@lists.cip-project.org; sangorrin daniel(サンゴリン ダニエル
□SWC◯ACT); iwamatsu nobuhiro(岩松 信洋 □SWC◯ACT)
Subject: Re: [cip-dev] [isar-cip-core] tests: put all tests into a opt
layer

On 21.07.20 14:42, Daniel Sangorrin wrote:
having an opt-tests layer makes it easier to see what tests are
installed, and allows creating images without them as well
JAN:
"Having ... as well."

Does this obsolete
https://gitlab.com/cip-project/cip-core/isar-cip-core/-/merge_requests
/7,
where I just commented on?

DANIEL: Maybe you can apply Iwamatsu-san merge request first, and I will prepare a new patch on top of that to avoid confusion.
That would confuse me now: What creating a separate test image first, just to remove it again?
Sorry for the confusion.

If you apply MR7, I will move the rt-tests and stress-ng packages from the customization "package" to the test image.
If you instead apply MR5, I will move them to opt-testtools.yml

Or is there any special reason for rt-tests and stress-ng to be in the customization package?

Thanks,
Daniel


Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux


Jan Kiszka
 

On 22.07.20 12:46, Daniel Sangorrin wrote:
Hi Jan

-----Original Message-----
From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On Behalf Of Jan Kiszka
Sent: Wednesday, July 22, 2020 5:05 PM
To: sangorrin daniel(サンゴリン ダニエル □SWC◯ACT) <daniel.sangorrin@toshiba.co.jp>; cip-dev@lists.cip-project.org; iwamatsu
nobuhiro(岩松 信洋 □SWC◯ACT) <nobuhiro1.iwamatsu@toshiba.co.jp>
Subject: Re: [cip-dev] [isar-cip-core] tests: put all tests into a opt layer

On 22.07.20 09:25, daniel.sangorrin@toshiba.co.jp wrote:
________________________________________
From: Jan Kiszka <jan.kiszka@siemens.com>
Sent: Wednesday, July 22, 2020 3:44 PM
To: cip-dev@lists.cip-project.org; sangorrin daniel(サンゴリン ダニエル
□SWC◯ACT); iwamatsu nobuhiro(岩松 信洋 □SWC◯ACT)
Subject: Re: [cip-dev] [isar-cip-core] tests: put all tests into a opt
layer

On 21.07.20 14:42, Daniel Sangorrin wrote:
having an opt-tests layer makes it easier to see what tests are
installed, and allows creating images without them as well
JAN:
"Having ... as well."

Does this obsolete
https://gitlab.com/cip-project/cip-core/isar-cip-core/-/merge_requests
/7,
where I just commented on?

DANIEL: Maybe you can apply Iwamatsu-san merge request first, and I will prepare a new patch on top of that to avoid confusion.
That would confuse me now: What creating a separate test image first, just to remove it again?
Sorry for the confusion.
If you apply MR7, I will move the rt-tests and stress-ng packages from the customization "package" to the test image.
If you instead apply MR5, I will move them to opt-testtools.yml
Or is there any special reason for rt-tests and stress-ng to be in the customization package?
Nobuhiro, is something missing from your perspective in Daniels approach? If not, I'd like to have one patch that takes us to that level.

By now, I think an opt-testtools.yml is better (an "option", not a "layer") than a separate image. That allows to test the security image eventually as well.

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


Daniel Sangorrin <daniel.sangorrin@...>
 

-----Original Message-----
From: Jan Kiszka <jan.kiszka@siemens.com>
Sent: Wednesday, July 22, 2020 11:07 PM
[...]

Nobuhiro, is something missing from your perspective in Daniels approach? If not, I'd like to have one patch that takes us to that level.

By now, I think an opt-testtools.yml is better (an "option", not a
"layer") than a separate image. That allows to test the security image eventually as well.
Personally, I think the same.
Perhaps Iwamatsu-san got a bit confused by the comments on the merge request.

Thanks,
Daniel