[OE-core] [poky][meta][PATCH] package_manager.py: handle renamed packages for PACKAGE_EXCLUDE with opkg

2019-06-04 Thread Aditya Tayade
From: Michael Ho 

The PACKAGE_EXCLUDE variable is used to pass a list of packages to be
forbidden from installation with opkg. This list however does not account
normally for the renaming of packages which can occur (for example when the
debian bbclass is enabled, packages with libs are renamed from xxx to libxxx)
and so expected excluded packages are not blocked.

Rather than tediously maintaining the PACKAGE_EXCLUDE variable to handle
renamed packages that can dynamically change, move the expansion of the
variable from parsing time to run time so it can use the pkgdata dictionaries
to add automatically any renamed packages.

Upstream-Status: Pending

Signed-off-by: Michael Ho 
Signed-off-by: Aditya.Tayade 
---
 meta/classes/package_ipk.bbclass |  1 -
 meta/lib/oe/package_manager.py   | 15 +++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index d1b317b..fa71869 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -12,7 +12,6 @@ OPKGBUILDCMD ??= 'opkg-build -Z xz -a "${XZ_DEFAULTS}"'

 OPKG_ARGS += "--force_postinstall --prefer-arch-to-version"
 OPKG_ARGS += "${@['', 
'--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
-OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude 
'.join((d.getVar('PACKAGE_EXCLUDE') or 
"").split())][(d.getVar("PACKAGE_EXCLUDE") or "").strip() != ""]}"

 OPKGLIBDIR = "${localstatedir}/lib"

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 06feb4d..ca66bdf 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -1160,6 +1160,21 @@ class OpkgPM(OpkgDpkgPM):
 self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock")
 self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
 self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % 
(self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs)
+
+# Handle excluded packages here rather than at parsing time so we can 
expand out the
+# PACKAGE_EXCLUDES at the runtime moment when pkgdata is available
+def opkg_exclude_args(pkg_excludes):
+remapped_pkg_excludes = []
+for pkg in pkg_excludes:
+pkg_data = oe.packagedata.read_subpkgdata(pkg, d)
+rename_key = "PKG_{}".format(pkg)
+if pkg_data and rename_key in pkg_data and 
pkg_data[rename_key] != pkg:
+remapped_pkg_excludes.append(pkg_data[rename_key])
+pkg_excludes.extend(remapped_pkg_excludes)
+pkg_excludes.sort()
+return " --add-exclude " + " --add-exclude ".join(pkg_excludes)
+
+self.opkg_args += opkg_exclude_args((d.getVar("PACKAGE_EXCLUDE") or 
"").split())
 self.opkg_args += self.d.getVar("OPKG_ARGS")

 if prepare_index:
--
2.7.4

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient, you are not 
authorized to read, print, retain copy, disseminate, distribute, or use this 
message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message. KPIT 
Technologies Ltd. does not accept any liability for virus infected mails.
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [meta][PATCH] run-ptest: use error handling for useradd and userdel

2019-03-25 Thread Aditya Tayade
Error handling in shell scripts is too easy to forget and
get wrong. It is possible to check every external command
for return values but it is better to use a generic setting
which halts execution of the script on any failures.

Upstream-Status: Pending
Signed-off-by: Aditya Tayade 
---
 meta/recipes-core/glib-2.0/glib-2.0/run-ptest | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/glib-2.0/glib-2.0/run-ptest 
b/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
index 5b85e8f..8f082d3 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
+++ b/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
@@ -1,5 +1,6 @@
 #! /bin/sh

+set -eux
 useradd glib2-test
 su glib2-test -c gnome-desktop-testing-runner glib
 userdel glib2-test
--
2.7.4

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient, you are not 
authorized to read, print, retain copy, disseminate, distribute, or use this 
message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message. KPIT 
Technologies Ltd. does not accept any liability for virus infected mails.
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [poky][meta][sumo][PATCH] run-ptest: fix testcase test-names failure

2019-03-04 Thread Aditya Tayade
Start the dbus daemon first before executing test-names
using dbus-launch, this will set DBUS_SESSION_BUS_ADDRESS.

ERROR:Failed to open connection to system bus: Using X11 for
dbus-daemon autolaunch was disabled at compile time,
set your DBUS_SESSION_BUS_ADDRESS instead

Upstream-Status: Pending

Signed-off-by: Aditya Tayade 
---
 meta/recipes-core/dbus/dbus/run-ptest | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/dbus/dbus/run-ptest 
b/meta/recipes-core/dbus/dbus/run-ptest
index 8a8970e..444ef4a 100755
--- a/meta/recipes-core/dbus/dbus/run-ptest
+++ b/meta/recipes-core/dbus/dbus/run-ptest
@@ -13,6 +13,7 @@ output() {
 export DBUS_TEST_HOMEDIR=./test
 export XDG_RUNTIME_DIR=./test
 export LD_LIBRARY_PATH=/usr/lib/dbus-test/ptest/test/.libs
+export $(dbus-launch)

 files=`ls test/test-*`

--
2.7.4

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient, you are not 
authorized to read, print, retain copy, disseminate, distribute, or use this 
message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message. KPIT 
Technologies Ltd. does not accept any liability for virus infected mails.
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [poky][meta][sumo][PATCH] lighttpd: added ptest

2019-03-04 Thread Aditya Tayade
Reused lighttpd internal tests and did minimal patching to fix paths.

Upstream-Status: Pending

Signed-off-by: Aditya Tayade 
---
 ...-use-standard-sbin-and-lib-path-for-ptest.patch | 37 
 meta/recipes-extended/lighttpd/lighttpd/run-ptest  |  4 ++
 meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb  | 66 +-
 3 files changed, 106 insertions(+), 1 deletion(-)
 create mode 100644 
meta/recipes-extended/lighttpd/lighttpd/0002-use-standard-sbin-and-lib-path-for-ptest.patch
 create mode 100644 meta/recipes-extended/lighttpd/lighttpd/run-ptest

diff --git 
a/meta/recipes-extended/lighttpd/lighttpd/0002-use-standard-sbin-and-lib-path-for-ptest.patch
 
b/meta/recipes-extended/lighttpd/lighttpd/0002-use-standard-sbin-and-lib-path-for-ptest.patch
new file mode 100644
index 000..cd4b2b3
--- /dev/null
+++ 
b/meta/recipes-extended/lighttpd/lighttpd/0002-use-standard-sbin-and-lib-path-for-ptest.patch
@@ -0,0 +1,37 @@
+lighttpd-ptest: use standard installation path
+
+ptest should do testing against installed library or executable
+at standard installation path, hence using standard installation
+path for MODULES_PATH and LIGHTTPD_PATH variables.
+
+Upsteam-Status: Pending
+
+Signed-off-by: Aditya Tayade 
+
+diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm
+index 74caea1..2de02d0 100644
+--- a/tests/LightyTest.pm
 b/tests/LightyTest.pm
+@@ -65,19 +65,10 @@ sub new {
+ $lpath = (defined $ENV{'srcdir'} ? $ENV{'srcdir'} : '.');
+ $self->{SRCDIR} = abs_path($lpath);
+
++$self->{SBINDIR} = '/usr/sbin';
++$self->{MODULES_PATH} = '/usr/lib';
+
+-if (mtime($self->{BASEDIR}.'/src/lighttpd') > 
mtime($self->{BASEDIR}.'/build/lighttpd')) {
+-$self->{BINDIR} = $self->{BASEDIR}.'/src';
+-if (mtime($self->{BASEDIR}.'/src/.libs')) {
+-$self->{MODULES_PATH} = $self->{BASEDIR}.'/src/.libs';
+-} else {
+-$self->{MODULES_PATH} = $self->{BASEDIR}.'/src';
+-}
+-} else {
+-$self->{BINDIR} = $self->{BASEDIR}.'/build';
+-$self->{MODULES_PATH} = $self->{BASEDIR}.'/build';
+-}
+-$self->{LIGHTTPD_PATH} = $self->{BINDIR}.'/lighttpd';
++$self->{LIGHTTPD_PATH} = $self->{SBINDIR}.'/lighttpd';
+ $self->{PORT} = 2048;
+
+ my ($name, $aliases, $addrtype, $net) = gethostbyaddr(inet_aton("127.0.0.1"), 
AF_INET);
diff --git a/meta/recipes-extended/lighttpd/lighttpd/run-ptest 
b/meta/recipes-extended/lighttpd/lighttpd/run-ptest
new file mode 100644
index 000..b6781c0
--- /dev/null
+++ b/meta/recipes-extended/lighttpd/lighttpd/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+make -C tests -k check-TESTS
+make -C src -k runtest-TESTS
diff --git a/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb 
b/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb
index 3cc..6a9677e 100644
--- a/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb
+++ b/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb
@@ -9,6 +9,42 @@ SECTION = "net"
 RDEPENDS_${PN} = "lighttpd-module-dirlisting \
   lighttpd-module-indexfile \
   lighttpd-module-staticfile"
+
+RDEPENDS_${PN}-ptest += "bash \
+ ${PN} \
+ ${PN}-module-compress \
+ ${PN}-module-simple-vhost \
+ ${PN}-module-rewrite \
+ ${PN}-module-cgi \
+ ${PN}-module-evhost \
+ ${PN}-module-redirect \
+ ${PN}-module-fastcgi \
+ ${PN}-module-setenv \
+ ${PN}-module-extforward \
+ ${PN}-module-secdownload \
+ ${PN}-module-auth \
+ ${PN}-module-authn-file \
+ ${PN}-module-status \
+ ${PN}-module-expire \
+ ${PN}-module-userdir \
+ ${PN}-module-ssi \
+ ${PN}-module-proxy \
+ perl-module-tap-base \
+ perl-module-tap-parser-sourcehandler-executable \
+ perl-module-tap-formatter-file \
+ perl-module-tap-formatter-file-session \
+ perl-module-tap-formatter-base \
+ perl-module-tap-formatter-session \
+ perl-module-tap-formatter-console-session \
+ perl-module-tap-parser-scheduler \
+ perl-module-tap-parser \
+ perl-module-io-socket \
+ perl-module-test-more \
+ perl-module-test-harness \
+ perl-module-tap-object \
+ perl-module-tap-formatter-console \
+"
+
 RRECOMMENDS_${PN} = "lighttpd-module-access \
  lighttpd-module-accesslog"

@@ -18,6 +54,8 @@ SRC_UR

[OE-core] [meta-oe][sumo][PATCH] run-ptest: supplied user inputs to add_person_cpp

2019-03-04 Thread Aditya Tayade
During protobuf-ptest execution, add_person_cpp waits for user
inputs to write data into test.data file. Fixed this by supplying
dummy data through standard input.

Upstream-Status: Pending

Signed-off-by: Aditya Tayade 
---
 meta-oe/recipes-devtools/protobuf/protobuf/run-ptest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest 
b/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest
index 7c3a8d1..dc6c83d 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest
+++ b/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest
@@ -8,7 +8,7 @@ for write_exe_full_path in ${DIR}/add_person_*; do
 if [ -x "${write_exe_full_path}" ]; then
 write_exe=`basename ${write_exe_full_path}`
 echo "Generating new test file using ${write_exe}..."
-${write_exe_full_path} "${TEST_FILE}"
+printf "1234\nname\nn...@example.com\n" | ${write_exe_full_path} "${TEST_FILE}"
 RETVAL=$?
 [ $RETVAL -eq 0 ] || exit $RETVAL

--
2.7.4

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient, you are not 
authorized to read, print, retain copy, disseminate, distribute, or use this 
message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message. KPIT 
Technologies Ltd. does not accept any liability for virus infected mails.
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core