Skip to contentSkip to conversation

ptest-runner: trivial fixes and refine

PATCH In review [email protected] 4 participants 7 messages Sep 11, 2013 – Sep 20, 2013

lore
Share & tools
lore
#0 lore raw

v2 cover ptest-runner: trivial fixes and refine

From: Roy Li <[email protected]>

The following changes since commit 5b451a46550ba62e2fbfe5dbe50723b34a4fd527:

systemd.bbclass: get the correct /lib directory (2013-09-10 23:15:09 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib roy/ptest-1
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=roy/ptest-1

Roy Li (1):
ptest-runner: trivial fixes and refine

 .../ptest-runner/files/ptest-runner                |   30 +++++++++++++++-----
 1 file changed, 23 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/1 ptest-runner: trivial fixes and refine

From: Roy Li <[email protected]>

1. ptest files may be installed under /usr/lib64/ for 64bit filesystem or under /usr/lib/ for 64bit multilib filesystem, so we should check both directories

2. If a soft link is linking to a directory under the same directory, we only run once.

[YOCTO #5125]
[YOCTO #5126]

---
 .../ptest-runner/files/ptest-runner                |   30 +++++++++++++++-----
 1 file changed, 23 insertions(+), 7 deletions(-)
meta/recipes-support/ptest-runner/files/ptest-runner +23 -7
index 4f3c7ce..ccb0434 100644
@@ -1,16 +1,32 @@
 #!/bin/sh
 
 echo "START: $0"
-cd /usr/lib
-for x in *
+
+for libdir in /usr/lib*
 do
-    if [ -x "/usr/lib/$x/ptest/run-ptest" ]; then
-       date "+%Y-%m-%dT%H:%M"
+
+    [ ! -d "$libdir" ] && continue
+
+    cd "$libdir"
+    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
+    do
+        # test if a dir is linking to one that they are under same directory
+        # like perl5-->perl
+        ptestdir=`dirname $x|cut -f2 -d"/"`
+        if [ -h "$ptestdir" ]; then
+            linkdir=`readlink -f "$ptestdir"`
+            if [ `dirname "$linkdir"` = "$libdir" ]; then
+                continue
+            fi
+        fi
+    
+        date "+%Y-%m-%dT%H:%M"
         echo "BEGIN: $x"
-        cd /usr/lib/$x/ptest
+        pushd `dirname "$x"`
         ./run-ptest
+        popd
         echo "END: $x"
-       date "+%Y-%m-%dT%H:%M"
-    fi
+        date "+%Y-%m-%dT%H:%M"
+    done
 done
 echo "STOP: $0"
Signature · 1 line
1.7.10.4
#2 lore raw

meta/recipes-support/ptest-runner/files/ptest-runner line 12

Quoted 3 lines · On Wed, Sep 11, 2013 at 2:17 AM, <[email protected]> wrote:
meta/recipes-support/ptest-runner/files/ptest-runner +2 -0
+    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
+    do

As far as I can tell, busybox find doesn't support -L, so this adds an implicit, undeclared dependency upon findutils.

Signature · 1 line
Christopher Larson
#3 lore raw
Quoted 8 lines · Chris Larson

meta/recipes-support/ptest-runner/files/ptest-runner line 12

Quoted 3 lines · On Wed, Sep 11, 2013 at 2:17 AM, <[email protected]> wrote:
meta/recipes-support/ptest-runner/files/ptest-runner +2 -0
+    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
+    do

As far as I can tell, busybox find doesn't support -L, so this adds an implicit, undeclared dependency upon findutils.

That is correct. Busybox find does however support -follow, which in turn GNU find does not...

Signature · 1 line
Björn
#4 lore raw
In reply to Chris Larson
Quoted 8 lines · Chris Larson

meta/recipes-support/ptest-runner/files/ptest-runner line 12

Quoted 3 lines · On Wed, Sep 11, 2013 at 2:17 AM, <[email protected]> wrote:
meta/recipes-support/ptest-runner/files/ptest-runner +2 -0
+    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
+    do

As far as I can tell, busybox find doesn't support -L, so this adds an implicit, undeclared dependency upon findutils.

Rongquing, are you planning on fixing this? As committed, ptest-runner can't run on busybox systems (which I'd argue are the majority of embedded systems).

Signature · 1 line
Björn
#5 lore raw
Quoted 12 lines · Björn Stenberg
Quoted 8 lines · Chris Larson

meta/recipes-support/ptest-runner/files/ptest-runner line 12

Quoted 3 lines · On Wed, Sep 11, 2013 at 2:17 AM, <[email protected]> wrote:
meta/recipes-support/ptest-runner/files/ptest-runner +2 -0
+    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
+    do

As far as I can tell, busybox find doesn't support -L, so this adds an implicit, undeclared dependency upon findutils.

Rongqing, are you planning on fixing this? As committed, ptest-runner can't run on busybox systems

Yes, Roy will fix this. He's on holiday for a few days.

I presume he'll add a check to see which arg to use for find rather than add a dependency on findutils.

Quoted 1 line

(which I'd argue are the majority of embedded systems).

That's becoming less true over time, IMO.
It seems that more and more embedded linux users are on bigger targets that use the discrete GNU tools.

Signature · 2 lines
# Randy MacLeod. SMTS, Linux, Wind River
Direct: 613.963.1350
#6 lore raw
Quoted 1 line · Randy MacLeod

Yes, Roy will fix this. He's on holiday for a few days.

Excellent.

Quoted 2 lines

I presume he'll add a check to see which arg to use for find rather than add a dependency on findutils.

I suggest skipping the find command altogether. The run-ptest files are defined to always sit in ${libdir}/${PN}/ptest and thus don't really need to be searched for.

Also, 'pushd' is not available in the busybox shell.

(I should have spotted these during patch review, but I was temporarily unavailable. Sorry about that.)

Signature · 1 line
Björn