Skip to contentSkip to conversation

meta-parsec: Add pkg grps

PATCH New Armin Kuster 1 participant 3 messages May 23, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 meta-parsec: Add pkg grps

--
V2]
Drop tpm pkgs, use the tpm2 pkg grp

---
 .../packagegroup-security-parsec.bb             | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 meta-parsec/recipes-core/packagegroups/packagegroup-security-parsec.bb
meta-parsec/recipes-core/packagegroups/packagegroup-security-parsec.bb new file +17 -0
new file mode 100644
index 0000000..b6c4f59
@@ -0,0 +1,17 @@
+DESCRIPTION = "Parsec Security packagegroup for Poky"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+inherit packagegroup
+
+PACKAGES = "\
+    packagegroup-security-parsec \
+    "
+
+SUMMARY:packagegroup-security-parsec = "Security Parsec"
+RDEPENDS:packagegroup-security-parsec = "\
+    softhsm \
+    parsec-tool \
+    parsec-service \
+    "
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 2/3 meta-parsec: add build image.

---
v2]
Use packagegroup-security-tpm2
add swtpm

---
 .../images/security-parsec-image.bb             | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 meta-parsec/recipes-core/images/security-parsec-image.bb
meta-parsec/recipes-core/images/security-parsec-image.bb new file +17 -0
new file mode 100644
index 0000000..2ddc543
@@ -0,0 +1,17 @@
+DESCRIPTION = "A small image for building meta-parsec packages"
+
+inherit core-image
+
+IMAGE_FEATURES += "ssh-server-openssh"
+
+IMAGE_INSTALL = "\
+    packagegroup-base \
+    packagegroup-core-boot \
+    packagegroup-security-tpm2 \
+    packagegroup-security-parsec \
+    swtpm \
+    os-release" 
+
+export IMAGE_BASENAME = "security-parsec-image"
+
+IMAGE_ROOTFS_EXTRA_SPACE = "5242880"
Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 3/3 oeqa: add parsec runtime tests

In reply to Armin Kuster

---
v2]
Add parsec-cli-tests.sh to mix

---
 meta-parsec/lib/oeqa/runtime/cases/parsec.py | 33 ++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 meta-parsec/lib/oeqa/runtime/cases/parsec.py
meta-parsec/lib/oeqa/runtime/cases/parsec.py new file +33 -0
new file mode 100644
index 0000000..547f74c
@@ -0,0 +1,33 @@
+# Copyright (C) 2022 Armin Kuster <[email protected]>
+#
+import re
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class ParsecTest(OERuntimeTestCase):
+    @OEHasPackage(['parsec-service'])
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_parsec_service(self):
+        toml_file = '/etc/parsec/config.tom'
+        status, output = self.target.run('echo library_path = "/usr/lib/softhsm/libsofthsm2.so" >> %s' %(toml_file))
+        status, output = self.target.run('echo slot_number = 0 >> %s' %(toml_file))
+        status, output = self.target.run('echo user_pin = "123456" >> %s' %(toml_file))
+        cmds = [
+                '/etc/init.d/parsec stop',
+                'sleep 5',
+                'softhsm2-util --init-token --slot 0 --label "Parsec Service" --pin 123456 --so-pin 123456',
+                'for d in /var/lib/softhsm/tokens/*; do chown -R parsec $d; done', 
+                'mkdir /tmp/myvtpm',
+                'swtpm socket --tpmstate dir=/tmp/myvtpm --tpm2 --ctrl type=tcp,port=2322 --server type=tcp,port=2321 --flags not-need-init &',
+                'export TPM2TOOLS_TCTI="swtpm:port=2321"',
+                'tpm2_startup -c',
+                'sleep 2',
+                '/etc/init.d/parsec start',
+                'parsec-cli-tests.sh'
+               ]
+
+        for cmd in cmds:
+            status, output = self.target.run(cmd)
+            self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
Signature · 1 line
2.25.1