All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] opkg: add ptest
@ 2019-04-08 17:01 Alejandro del Castillo
  2019-04-08 19:20 ` Burton, Ross
  0 siblings, 1 reply; 4+ messages in thread
From: Alejandro del Castillo @ 2019-04-08 17:01 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
---
 ....py-resolve-paths-before-comparision.patch | 31 +++++++++++++++++++
 meta/recipes-devtools/opkg/opkg/run-ptest     |  3 ++
 meta/recipes-devtools/opkg/opkg_0.4.0.bb      | 15 ++++++++-
 3 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch
 create mode 100644 meta/recipes-devtools/opkg/opkg/run-ptest

diff --git a/meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch b/meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch
new file mode 100644
index 0000000000..75ecb5fb42
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch
@@ -0,0 +1,31 @@
+From 5f005830eea7d03c02107a3a3fc58907b0a037bf Mon Sep 17 00:00:00 2001
+From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Date: Mon, 8 Apr 2019 11:14:56 -0500
+Subject: [PATCH] regress/issue72.py: resolve paths before comparision
+
+In systems that have a volatile /tmp, the test incorrectly fails since
+it doesn't resolve the real path in all cases.
+
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+---
+Upstream-Status: Submitted
+
+ tests/regress/issue72.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/regress/issue72.py b/tests/regress/issue72.py
+index 1626877..2f24dec 100755
+--- a/tests/regress/issue72.py
++++ b/tests/regress/issue72.py
+@@ -56,7 +56,7 @@ if not os.path.lexists("{}/{}".format(cfg.offline_root, long_filename2)):
+ 				"not created.")
+ 
+ linky = os.path.realpath("{}/{}".format(cfg.offline_root, long_filename2))
+-linky_dst = "{}/{}".format(cfg.offline_root, long_filename)
++linky_dst = os.path.realpath("{}/{}".format(cfg.offline_root, long_filename))
+ if linky != linky_dst:
+ 	opk.fail("symlink path truncated.")
+ 
+-- 
+2.20.1
+
diff --git a/meta/recipes-devtools/opkg/opkg/run-ptest b/meta/recipes-devtools/opkg/opkg/run-ptest
new file mode 100644
index 0000000000..23189c976f
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make run-tests
diff --git a/meta/recipes-devtools/opkg/opkg_0.4.0.bb b/meta/recipes-devtools/opkg/opkg_0.4.0.bb
index a2329d3e71..9bb37d9e09 100644
--- a/meta/recipes-devtools/opkg/opkg_0.4.0.bb
+++ b/meta/recipes-devtools/opkg/opkg_0.4.0.bb
@@ -15,12 +15,15 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz
            file://opkg.conf \
            file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
            file://0001-libopkg-add-add-ignore-recommends-option.patch \
+           file://0001-regress-issue72.py-resolve-paths-before-comparision.patch \
+           file://run-ptest \
 "
 
+
 SRC_URI[md5sum] = "ae51d95fee599bb4dce08453529158f5"
 SRC_URI[sha256sum] = "f6c00515d8a2ad8f6742a8e73830315d1983ed0459cba77c4d656cfc9e7fe6fe"
 
-inherit autotools pkgconfig systemd
+inherit autotools pkgconfig systemd ptest
 
 target_localstatedir := "${localstatedir}"
 OPKGLIBDIR = "${target_localstatedir}/lib"
@@ -37,6 +40,15 @@ PACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv"
 
 EXTRA_OECONF_class-native = "--localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
 
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}
+	install -m 755 ${WORKDIR}/run-ptest ${D}/${PTEST_PATH}/run-ptest
+	install -m 755 ${B}/Makefile ${D}${PTEST_PATH}/Makefile
+	sed -i -e 's,^Makefile:,_Makefile:,' ${D}/${PTEST_PATH}/Makefile
+	cp -r ${S}/tests ${D}${PTEST_PATH}
+	sed -i -e 's,^opkgcl = os.path.realpath("../src/opkg"),opkgcl="${bindir}/opkg",' ${D}/${PTEST_PATH}/tests/cfg.py
+}
+
 do_install_append () {
 	install -d ${D}${sysconfdir}/opkg
 	install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
@@ -49,6 +61,7 @@ do_install_append () {
 RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
 RDEPENDS_${PN}_class-native = ""
 RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-ptest += "make binutils python3-core python3-compression"
 RREPLACES_${PN} = "opkg-nogpg opkg-collateral"
 RCONFLICTS_${PN} = "opkg-collateral"
 RPROVIDES_${PN} = "opkg-collateral"
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] opkg: add ptest
  2019-04-08 17:01 [PATCH] opkg: add ptest Alejandro del Castillo
@ 2019-04-08 19:20 ` Burton, Ross
  2019-04-09 20:48   ` Alejandro Del Castillo
  2019-04-10 20:54   ` [PATCH v2] " Alejandro del Castillo
  0 siblings, 2 replies; 4+ messages in thread
From: Burton, Ross @ 2019-04-08 19:20 UTC (permalink / raw)
  To: Alejandro del Castillo; +Cc: OE-core

On Mon, 8 Apr 2019 at 20:03, Alejandro del Castillo
<alejandro.delcastillo@ni.com> wrote:
> +do_install_ptest() {
> +       install -d ${D}${PTEST_PATH}
> +       install -m 755 ${WORKDIR}/run-ptest ${D}/${PTEST_PATH}/run-ptest
> +       install -m 755 ${B}/Makefile ${D}${PTEST_PATH}/Makefile
> +       sed -i -e 's,^Makefile:,_Makefile:,' ${D}/${PTEST_PATH}/Makefile
> +       cp -r ${S}/tests ${D}${PTEST_PATH}
> +       sed -i -e 's,^opkgcl = os.path.realpath("../src/opkg"),opkgcl="${bindir}/opkg",' ${D}/${PTEST_PATH}/tests/cfg.py
> +}

You're the maintainer of opkg, just add an install target for the test suite ;)

Ross


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] opkg: add ptest
  2019-04-08 19:20 ` Burton, Ross
@ 2019-04-09 20:48   ` Alejandro Del Castillo
  2019-04-10 20:54   ` [PATCH v2] " Alejandro del Castillo
  1 sibling, 0 replies; 4+ messages in thread
From: Alejandro Del Castillo @ 2019-04-09 20:48 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core



On 4/8/19 2:20 PM, Burton, Ross wrote:
> On Mon, 8 Apr 2019 at 20:03, Alejandro del Castillo
> <alejandro.delcastillo@ni.com> wrote:
>> +do_install_ptest() {
>> +       install -d ${D}${PTEST_PATH}
>> +       install -m 755 ${WORKDIR}/run-ptest ${D}/${PTEST_PATH}/run-ptest
>> +       install -m 755 ${B}/Makefile ${D}${PTEST_PATH}/Makefile
>> +       sed -i -e 's,^Makefile:,_Makefile:,' ${D}/${PTEST_PATH}/Makefile
>> +       cp -r ${S}/tests ${D}${PTEST_PATH}
>> +       sed -i -e 's,^opkgcl = os.path.realpath("../src/opkg"),opkgcl="${bindir}/opkg",' ${D}/${PTEST_PATH}/tests/cfg.py
>> +}
> 
> You're the maintainer of opkg, just add an install target for the test suite ;)

At first glance, it looked a bit odd to add a ptest specific target 
(install-ptest) to opkg. But I can see other components do that (gdbm, 
libxml). And give that opkg primary client is OE, then it should be OK. 
I'll add the install-ptest to opkg and will send a v2 soon.

-- 
Cheers,

Alejandro

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] opkg: add ptest
  2019-04-08 19:20 ` Burton, Ross
  2019-04-09 20:48   ` Alejandro Del Castillo
@ 2019-04-10 20:54   ` Alejandro del Castillo
  1 sibling, 0 replies; 4+ messages in thread
From: Alejandro del Castillo @ 2019-04-10 20:54 UTC (permalink / raw)
  To: openembedded-core

Install opkg test suite and run it as ptest.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
---
 ...dd-target-for-testsuite-installation.patch | 43 +++++++++++++++++++
 ....py-resolve-paths-before-comparision.patch | 31 +++++++++++++
 meta/recipes-devtools/opkg/opkg/run-ptest     |  5 +++
 meta/recipes-devtools/opkg/opkg_0.4.0.bb      |  6 ++-
 4 files changed, 84 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/opkg/opkg/0001-opkg-add-target-for-testsuite-installation.patch
 create mode 100644 meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch
 create mode 100644 meta/recipes-devtools/opkg/opkg/run-ptest

diff --git a/meta/recipes-devtools/opkg/opkg/0001-opkg-add-target-for-testsuite-installation.patch b/meta/recipes-devtools/opkg/opkg/0001-opkg-add-target-for-testsuite-installation.patch
new file mode 100644
index 0000000000..951c186767
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/0001-opkg-add-target-for-testsuite-installation.patch
@@ -0,0 +1,43 @@
+From 8fb0364bd0e19f35c20616dd1ab10aa00e08fa8f Mon Sep 17 00:00:00 2001
+From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Date: Wed, 10 Apr 2019 14:49:43 -0500
+Subject: [PATCH] opkg: add target for testsuite installation
+
+- Add target to install testsuite
+- Add override of opkg binary used during test via OPKG_PATH environment
+variable.
+
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+---
+Upstream-Status: Submitted
+
+ Makefile.am  | 5 +++++
+ tests/cfg.py | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 90cfcae..1f6a784 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -18,3 +18,8 @@ run-tests:
+ 	$(MAKE) -C tests DATADIR=@datadir@ SYSCONFDIR=@sysconfdir@ VARDIR=@localstatedir@
+ 
+ check: run-tests
++
++install-ptest:
++	cp -r $(srcdir)/tests $(DESTDIR)
++	cp Makefile $(DESTDIR)
++	sed -e 's/^Makefile/_Makefile/' < Makefile > $(DESTDIR)/Makefile
+diff --git a/tests/cfg.py b/tests/cfg.py
+index 4efaff6..ca59d03 100644
+--- a/tests/cfg.py
++++ b/tests/cfg.py
+@@ -2,4 +2,4 @@ import os
+ 
+ opkdir = "/tmp/opk"
+ offline_root = "/tmp/opkg"
+-opkgcl = os.path.realpath("../src/opkg")
++opkgcl = os.getenv('OPKG_PATH', os.path.realpath("../src/opkg"))
+-- 
+2.20.1
+
diff --git a/meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch b/meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch
new file mode 100644
index 0000000000..75ecb5fb42
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch
@@ -0,0 +1,31 @@
+From 5f005830eea7d03c02107a3a3fc58907b0a037bf Mon Sep 17 00:00:00 2001
+From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Date: Mon, 8 Apr 2019 11:14:56 -0500
+Subject: [PATCH] regress/issue72.py: resolve paths before comparision
+
+In systems that have a volatile /tmp, the test incorrectly fails since
+it doesn't resolve the real path in all cases.
+
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+---
+Upstream-Status: Submitted
+
+ tests/regress/issue72.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/regress/issue72.py b/tests/regress/issue72.py
+index 1626877..2f24dec 100755
+--- a/tests/regress/issue72.py
++++ b/tests/regress/issue72.py
+@@ -56,7 +56,7 @@ if not os.path.lexists("{}/{}".format(cfg.offline_root, long_filename2)):
+ 				"not created.")
+ 
+ linky = os.path.realpath("{}/{}".format(cfg.offline_root, long_filename2))
+-linky_dst = "{}/{}".format(cfg.offline_root, long_filename)
++linky_dst = os.path.realpath("{}/{}".format(cfg.offline_root, long_filename))
+ if linky != linky_dst:
+ 	opk.fail("symlink path truncated.")
+ 
+-- 
+2.20.1
+
diff --git a/meta/recipes-devtools/opkg/opkg/run-ptest b/meta/recipes-devtools/opkg/opkg/run-ptest
new file mode 100644
index 0000000000..5fb7077eec
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+OPKG_PATH=$(which opkg)
+
+make OPKG_PATH=$OPKG_PATH run-tests
diff --git a/meta/recipes-devtools/opkg/opkg_0.4.0.bb b/meta/recipes-devtools/opkg/opkg_0.4.0.bb
index a2329d3e71..20c2e0b72a 100644
--- a/meta/recipes-devtools/opkg/opkg_0.4.0.bb
+++ b/meta/recipes-devtools/opkg/opkg_0.4.0.bb
@@ -15,12 +15,15 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz
            file://opkg.conf \
            file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
            file://0001-libopkg-add-add-ignore-recommends-option.patch \
+           file://0001-regress-issue72.py-resolve-paths-before-comparision.patch \
+           file://0001-opkg-add-target-for-testsuite-installation.patch \
+           file://run-ptest \
 "
 
 SRC_URI[md5sum] = "ae51d95fee599bb4dce08453529158f5"
 SRC_URI[sha256sum] = "f6c00515d8a2ad8f6742a8e73830315d1983ed0459cba77c4d656cfc9e7fe6fe"
 
-inherit autotools pkgconfig systemd
+inherit autotools pkgconfig systemd ptest
 
 target_localstatedir := "${localstatedir}"
 OPKGLIBDIR = "${target_localstatedir}/lib"
@@ -49,6 +52,7 @@ do_install_append () {
 RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
 RDEPENDS_${PN}_class-native = ""
 RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-ptest += "make binutils python3-core python3-compression"
 RREPLACES_${PN} = "opkg-nogpg opkg-collateral"
 RCONFLICTS_${PN} = "opkg-collateral"
 RPROVIDES_${PN} = "opkg-collateral"
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-10 20:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08 17:01 [PATCH] opkg: add ptest Alejandro del Castillo
2019-04-08 19:20 ` Burton, Ross
2019-04-09 20:48   ` Alejandro Del Castillo
2019-04-10 20:54   ` [PATCH v2] " Alejandro del Castillo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.