From 6d3a0411f3790e188b182b3c6a1fa102d00edda2 Mon Sep 17 00:00:00 2001 From: Alejandro del Castillo Date: Wed, 10 Apr 2019 15:54:23 -0500 Subject: opkg: add ptest Install opkg test suite and run it as ptest. (From OE-Core rev: 6b9963a58eec9f5f5fe72021d13e3c89461a9649) Signed-off-by: Alejandro del Castillo Signed-off-by: Richard Purdie --- ...pkg-add-target-for-testsuite-installation.patch | 43 ++++++++++++++++++++++ ...sue72.py-resolve-paths-before-comparision.patch | 31 ++++++++++++++++ meta/recipes-devtools/opkg/opkg/run-ptest | 5 +++ 3 files changed, 79 insertions(+) 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 (limited to 'meta/recipes-devtools/opkg/opkg') 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 +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 +--- +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 +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 +--- +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 -- cgit v1.2.3-54-g00ecf