All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 0/9] Fixes for busybox ptest
@ 2018-11-23  2:16 Chen Qi
  2018-11-23  2:16 ` [PATCH 1/9] busybox: enable bzip2 by default Chen Qi
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Chen Qi @ 2018-11-23  2:16 UTC (permalink / raw)
  To: openembedded-core

Changes in V2:
* fix bzip2 recipe to extend its alternatives list
* check CONFIG_DESKTOP beforing using 'od -t' in test cases

Changes in V3:
* add a symlink farm for busybox ptest to ensure utilities provided by busybox are used in ptest
* default hostname to 'localhost'
* drop the patch to remove three test cases for hostname

The following changes since commit 6b84ac788321b24cfa2e6a883806eb3f3198254b:

  ref-manual: Updated list of supported Linux Distros: (2018-11-22 12:20:52 +0000)

are available in the git repository at:

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

Chen Qi (8):
  busybox: enable bzip2 by default
  bzip2: extend alternatives list to include bzip2
  busybox: add zip to RDEPENDS of ptest package
  busybox: check uudecode before using it in test case
  busybox: use example.org instead of google.com in wget test case
  busybox: fix du-l-works test case
  busybox: check CONFIG_DESKTOP before using 'od -t' in test case
  base-files: default hostname to localhost

Ross Burton (1):
  busybox: ship a symlink farm for ptest

 meta/recipes-core/base-files/base-files_3.0.14.bb  |  4 +-
 meta/recipes-core/busybox/busybox.inc              | 17 +++++
 ...-du-l-works-fix-to-use-145-instead-of-144.patch | 32 +++++++++
 ...te-check-CONFIG_DESKTOP-before-using-od-t.patch | 83 ++++++++++++++++++++++
 ...-testsuite-check-uudecode-before-using-it.patch | 45 ++++++++++++
 ...e-use-www.example.org-for-wget-test-cases.patch | 62 ++++++++++++++++
 meta/recipes-core/busybox/busybox/defconfig        |  2 +-
 meta/recipes-core/busybox/busybox_1.29.2.bb        |  4 ++
 meta/recipes-core/busybox/files/run-ptest          |  5 +-
 meta/recipes-extended/bzip2/bzip2_1.0.6.bb         |  2 +-
 10 files changed, 250 insertions(+), 6 deletions(-)
 create mode 100644 meta/recipes-core/busybox/busybox/0001-du-l-works-fix-to-use-145-instead-of-144.patch
 create mode 100644 meta/recipes-core/busybox/busybox/0001-testsuite-check-CONFIG_DESKTOP-before-using-od-t.patch
 create mode 100644 meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
 create mode 100644 meta/recipes-core/busybox/busybox/0001-testsuite-use-www.example.org-for-wget-test-cases.patch

-- 
1.9.1



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

* [PATCH 1/9] busybox: enable bzip2 by default
  2018-11-23  2:16 [PATCH V3 0/9] Fixes for busybox ptest Chen Qi
@ 2018-11-23  2:16 ` Chen Qi
  2018-11-23  2:16 ` [PATCH 2/9] bzip2: extend alternatives list to include bzip2 Chen Qi
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Chen Qi @ 2018-11-23  2:16 UTC (permalink / raw)
  To: openembedded-core

bunzip2 is enabled by default, but bzip2 is not. This is kind of
strange, and it also causes busybox's ptest failure regarding
bunzip2, as bunzip2's test case needs bzip2 command.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/busybox/busybox/defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/busybox/busybox/defconfig b/meta/recipes-core/busybox/busybox/defconfig
index 32213c0..0c40990 100644
--- a/meta/recipes-core/busybox/busybox/defconfig
+++ b/meta/recipes-core/busybox/busybox/defconfig
@@ -150,7 +150,7 @@ CONFIG_LZCAT=y
 # CONFIG_UNXZ is not set
 CONFIG_XZCAT=y
 # CONFIG_XZ is not set
-# CONFIG_BZIP2 is not set
+CONFIG_BZIP2=y
 CONFIG_FEATURE_BZIP2_DECOMPRESS=y
 CONFIG_CPIO=y
 # CONFIG_FEATURE_CPIO_O is not set
-- 
1.9.1



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

* [PATCH 2/9] bzip2: extend alternatives list to include bzip2
  2018-11-23  2:16 [PATCH V3 0/9] Fixes for busybox ptest Chen Qi
  2018-11-23  2:16 ` [PATCH 1/9] busybox: enable bzip2 by default Chen Qi
@ 2018-11-23  2:16 ` Chen Qi
  2018-11-23  2:16 ` [PATCH 3/9] busybox: add zip to RDEPENDS of ptest package Chen Qi
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Chen Qi @ 2018-11-23  2:16 UTC (permalink / raw)
  To: openembedded-core

bzip2 could also be provided by busybox. So extend the alternatives
list to include bzip2.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-extended/bzip2/bzip2_1.0.6.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-extended/bzip2/bzip2_1.0.6.bb b/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
index 025f45c..7d04e30 100644
--- a/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
+++ b/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
@@ -29,7 +29,7 @@ CFLAGS_append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=
 inherit autotools update-alternatives ptest relative_symlinks
 
 ALTERNATIVE_PRIORITY = "100"
-ALTERNATIVE_${PN} = "bunzip2 bzcat"
+ALTERNATIVE_${PN} = "bunzip2 bzcat bzip2"
 
 #install binaries to bzip2-native under sysroot for replacement-native
 EXTRA_OECONF_append_class-native = " --bindir=${STAGING_BINDIR_NATIVE}/${PN}"
-- 
1.9.1



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

* [PATCH 3/9] busybox: add zip to RDEPENDS of ptest package
  2018-11-23  2:16 [PATCH V3 0/9] Fixes for busybox ptest Chen Qi
  2018-11-23  2:16 ` [PATCH 1/9] busybox: enable bzip2 by default Chen Qi
  2018-11-23  2:16 ` [PATCH 2/9] bzip2: extend alternatives list to include bzip2 Chen Qi
@ 2018-11-23  2:16 ` Chen Qi
  2018-11-23  2:16 ` [PATCH 4/9] busybox: check uudecode before using it in test case Chen Qi
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Chen Qi @ 2018-11-23  2:16 UTC (permalink / raw)
  To: openembedded-core

busybox's unzip test case requires zip command. However, busybox
itself does not provide one. So add zip as a runtime dependency.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/busybox/busybox.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index b8d8858..b45d2b6 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -53,6 +53,9 @@ RDEPENDS_${PN} = "${@["", "busybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_man
 
 inherit cml1 systemd update-rc.d ptest
 
+# busybox's unzip test case needs zip command, which busybox itself does not provide
+RDEPENDS_${PN}-ptest = "zip"
+
 # internal helper
 def busybox_cfg(feature, tokens, cnf, rem):
 	if type(tokens) == type(""):
-- 
1.9.1



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

* [PATCH 4/9] busybox: check uudecode before using it in test case
  2018-11-23  2:16 [PATCH V3 0/9] Fixes for busybox ptest Chen Qi
                   ` (2 preceding siblings ...)
  2018-11-23  2:16 ` [PATCH 3/9] busybox: add zip to RDEPENDS of ptest package Chen Qi
@ 2018-11-23  2:16 ` Chen Qi
  2018-11-23  2:16 ` [PATCH 5/9] busybox: use example.org instead of google.com in wget " Chen Qi
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Chen Qi @ 2018-11-23  2:16 UTC (permalink / raw)
  To: openembedded-core

Check uudecode before using it in test case to avoid unexpected failure.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 ...-testsuite-check-uudecode-before-using-it.patch | 45 ++++++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.29.2.bb        |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch

diff --git a/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch b/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
new file mode 100644
index 0000000..2d9856f
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
@@ -0,0 +1,45 @@
+From 85f164ec427fecbae24140b3c93acbbe2ba1c817 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 13 Nov 2018 11:27:01 +0800
+Subject: [PATCH] testsuite: check uudecode before using it
+
+The unzip and tar test cases use uudecode command, so also
+check it via optional function.
+
+Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2018-November/086833.html]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ testsuite/tar.tests   | 2 +-
+ testsuite/unzip.tests | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testsuite/tar.tests b/testsuite/tar.tests
+index d71a349..8c88567 100755
+--- a/testsuite/tar.tests
++++ b/testsuite/tar.tests
+@@ -336,7 +336,7 @@ SKIP=
+ cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+ 
+ mkdir tar.tempdir && cd tar.tempdir || exit 1
+-optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS
++optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS UUDECODE
+ testing "Symlink attack: create symlink and then write through it" '\
+ exec 2>&1
+ uudecode -o input && tar xvf input; echo $?
+diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests
+index af53de9..3b45ece 100755
+--- a/testsuite/unzip.tests
++++ b/testsuite/unzip.tests
+@@ -31,7 +31,7 @@ rmdir foo
+ rm foo.zip
+ 
+ # File containing some damaged encrypted stream
+-optional FEATURE_UNZIP_CDF
++optional FEATURE_UNZIP_CDF UUDECODE
+ testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \
+ "Archive:  bad.zip
+   inflating: ]3j½r«I^[\x12K-%Ix
+-- 
+2.7.4
+
diff --git a/meta/recipes-core/busybox/busybox_1.29.2.bb b/meta/recipes-core/busybox/busybox_1.29.2.bb
index df3ea59..a63fa82 100644
--- a/meta/recipes-core/busybox/busybox_1.29.2.bb
+++ b/meta/recipes-core/busybox/busybox_1.29.2.bb
@@ -41,6 +41,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://rcS \
            file://rcK \
            file://makefile-libbb-race.patch \
+           file://0001-testsuite-check-uudecode-before-using-it.patch \
 "
 SRC_URI_append_libc-musl = " file://musl.cfg "
 
-- 
1.9.1



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

* [PATCH 5/9] busybox: use example.org instead of google.com in wget test case
  2018-11-23  2:16 [PATCH V3 0/9] Fixes for busybox ptest Chen Qi
                   ` (3 preceding siblings ...)
  2018-11-23  2:16 ` [PATCH 4/9] busybox: check uudecode before using it in test case Chen Qi
@ 2018-11-23  2:16 ` Chen Qi
  2018-11-23  2:16 ` [PATCH 6/9] busybox: fix du-l-works " Chen Qi
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Chen Qi @ 2018-11-23  2:16 UTC (permalink / raw)
  To: openembedded-core

Use example.org to ensure it's always reachible.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 ...e-use-www.example.org-for-wget-test-cases.patch | 62 ++++++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.29.2.bb        |  1 +
 2 files changed, 63 insertions(+)
 create mode 100644 meta/recipes-core/busybox/busybox/0001-testsuite-use-www.example.org-for-wget-test-cases.patch

diff --git a/meta/recipes-core/busybox/busybox/0001-testsuite-use-www.example.org-for-wget-test-cases.patch b/meta/recipes-core/busybox/busybox/0001-testsuite-use-www.example.org-for-wget-test-cases.patch
new file mode 100644
index 0000000..7ba0f77
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-testsuite-use-www.example.org-for-wget-test-cases.patch
@@ -0,0 +1,62 @@
+From 03acf460990dfcf6e52b298301b348b9504460a8 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 13 Nov 2018 13:51:42 +0800
+Subject: [PATCH] testsuite: use www.example.org for wget test cases
+
+Use example.org instead of google.com to make sure it's
+always reachible.
+
+Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2018-November/086835.html]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ testsuite/wget/wget--O-overrides--P        | 2 +-
+ testsuite/wget/wget-handles-empty-path     | 2 +-
+ testsuite/wget/wget-retrieves-google-index | 2 +-
+ testsuite/wget/wget-supports--P            | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/testsuite/wget/wget--O-overrides--P b/testsuite/wget/wget--O-overrides--P
+index 40a3a96..490d743 100644
+--- a/testsuite/wget/wget--O-overrides--P
++++ b/testsuite/wget/wget--O-overrides--P
+@@ -1,5 +1,5 @@
+ test x"$SKIP_INTERNET_TESTS" != x"" && exit
+ 
+ mkdir foo
+-busybox wget -q -O index.html -P foo http://www.google.com/
++busybox wget -q -O index.html -P foo http://www.example.org/
+ test -s index.html
+diff --git a/testsuite/wget/wget-handles-empty-path b/testsuite/wget/wget-handles-empty-path
+index 01d60bd..1802db6 100644
+--- a/testsuite/wget/wget-handles-empty-path
++++ b/testsuite/wget/wget-handles-empty-path
+@@ -1,3 +1,3 @@
+ test x"$SKIP_INTERNET_TESTS" != x"" && exit
+ 
+-busybox wget http://www.google.com
++busybox wget http://www.example.org
+diff --git a/testsuite/wget/wget-retrieves-google-index b/testsuite/wget/wget-retrieves-google-index
+index f9dbb8b..fc801d4 100644
+--- a/testsuite/wget/wget-retrieves-google-index
++++ b/testsuite/wget/wget-retrieves-google-index
+@@ -1,4 +1,4 @@
+ test x"$SKIP_INTERNET_TESTS" != x"" && exit
+ 
+-busybox wget -q -O foo http://www.google.com/
++busybox wget -q -O foo http://www.example.org/
+ test -s foo
+diff --git a/testsuite/wget/wget-supports--P b/testsuite/wget/wget-supports--P
+index bfe4ac4..4ff2fe0 100644
+--- a/testsuite/wget/wget-supports--P
++++ b/testsuite/wget/wget-supports--P
+@@ -1,5 +1,5 @@
+ test x"$SKIP_INTERNET_TESTS" != x"" && exit
+ 
+ mkdir foo
+-busybox wget -q -P foo http://www.google.com/
++busybox wget -q -P foo http://www.example.org/
+ test -s foo/index.html
+-- 
+2.7.4
+
diff --git a/meta/recipes-core/busybox/busybox_1.29.2.bb b/meta/recipes-core/busybox/busybox_1.29.2.bb
index a63fa82..98767f0 100644
--- a/meta/recipes-core/busybox/busybox_1.29.2.bb
+++ b/meta/recipes-core/busybox/busybox_1.29.2.bb
@@ -42,6 +42,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://rcK \
            file://makefile-libbb-race.patch \
            file://0001-testsuite-check-uudecode-before-using-it.patch \
+           file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \
 "
 SRC_URI_append_libc-musl = " file://musl.cfg "
 
-- 
1.9.1



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

* [PATCH 6/9] busybox: fix du-l-works test case
  2018-11-23  2:16 [PATCH V3 0/9] Fixes for busybox ptest Chen Qi
                   ` (4 preceding siblings ...)
  2018-11-23  2:16 ` [PATCH 5/9] busybox: use example.org instead of google.com in wget " Chen Qi
@ 2018-11-23  2:16 ` Chen Qi
  2018-11-23  2:16 ` [PATCH 7/9] busybox: check CONFIG_DESKTOP before using 'od -t' in " Chen Qi
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Chen Qi @ 2018-11-23  2:16 UTC (permalink / raw)
  To: openembedded-core

64 + 64 + 16 = 144K
144 + sizeof_a_directory >= 145
So fix to use 145 instead of 144.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 ...-du-l-works-fix-to-use-145-instead-of-144.patch | 32 ++++++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.29.2.bb        |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 meta/recipes-core/busybox/busybox/0001-du-l-works-fix-to-use-145-instead-of-144.patch

diff --git a/meta/recipes-core/busybox/busybox/0001-du-l-works-fix-to-use-145-instead-of-144.patch b/meta/recipes-core/busybox/busybox/0001-du-l-works-fix-to-use-145-instead-of-144.patch
new file mode 100644
index 0000000..bb5f753
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-du-l-works-fix-to-use-145-instead-of-144.patch
@@ -0,0 +1,32 @@
+From c69feb2fdb755d6db34d0eb0a9e9994386c15e3a Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 14 Nov 2018 15:19:57 +0800
+Subject: [PATCH] du-l-works: fix to use 145 instead of 144
+
+64 + 64 + 16 = 144
+144 + size_of_directory >= 145
+So fix to use 145 instead of 144.
+
+Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2018-November/086836.html]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ testsuite/du/du-l-works | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testsuite/du/du-l-works b/testsuite/du/du-l-works
+index af87345..575064a 100644
+--- a/testsuite/du/du-l-works
++++ b/testsuite/du/du-l-works
+@@ -5,7 +5,7 @@ cd du.testdir
+ dd if=/dev/zero of=file1 bs=1k count=64 2>/dev/null
+ ln file1 file1.1
+ dd if=/dev/zero of=file2 bs=1k count=16 2>/dev/null
+-test x"`busybox du -l .`" = x"144	." \
++test x"`busybox du -l .`" = x"145	." \
+   -o x"`busybox du -l .`" = x"146	." \
+   -o x"`busybox du -l .`" = x"148	." \
+   -o x"`busybox du -l .`" = x"152	." \
+-- 
+2.7.4
+
diff --git a/meta/recipes-core/busybox/busybox_1.29.2.bb b/meta/recipes-core/busybox/busybox_1.29.2.bb
index 98767f0..f38db2a 100644
--- a/meta/recipes-core/busybox/busybox_1.29.2.bb
+++ b/meta/recipes-core/busybox/busybox_1.29.2.bb
@@ -43,6 +43,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://makefile-libbb-race.patch \
            file://0001-testsuite-check-uudecode-before-using-it.patch \
            file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \
+           file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \
 "
 SRC_URI_append_libc-musl = " file://musl.cfg "
 
-- 
1.9.1



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

* [PATCH 7/9] busybox: check CONFIG_DESKTOP before using 'od -t' in test case
  2018-11-23  2:16 [PATCH V3 0/9] Fixes for busybox ptest Chen Qi
                   ` (5 preceding siblings ...)
  2018-11-23  2:16 ` [PATCH 6/9] busybox: fix du-l-works " Chen Qi
@ 2018-11-23  2:16 ` Chen Qi
  2018-11-23  2:16 ` [PATCH 8/9] busybox: ship a symlink farm for ptest Chen Qi
  2018-11-23  2:16 ` [PATCH 9/9] base-files: default hostname to localhost Chen Qi
  8 siblings, 0 replies; 11+ messages in thread
From: Chen Qi @ 2018-11-23  2:16 UTC (permalink / raw)
  To: openembedded-core

The '-t' option support for 'od' is enabled by CONFIG_DESKTOP.
So check it before using it in test cases.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 ...te-check-CONFIG_DESKTOP-before-using-od-t.patch | 83 ++++++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.29.2.bb        |  1 +
 2 files changed, 84 insertions(+)
 create mode 100644 meta/recipes-core/busybox/busybox/0001-testsuite-check-CONFIG_DESKTOP-before-using-od-t.patch

diff --git a/meta/recipes-core/busybox/busybox/0001-testsuite-check-CONFIG_DESKTOP-before-using-od-t.patch b/meta/recipes-core/busybox/busybox/0001-testsuite-check-CONFIG_DESKTOP-before-using-od-t.patch
new file mode 100644
index 0000000..9b96eee
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-testsuite-check-CONFIG_DESKTOP-before-using-od-t.patch
@@ -0,0 +1,83 @@
+From b09db631e77c63ebe733c69b00108f043f1f1d85 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 21 Nov 2018 10:00:29 +0800
+Subject: [PATCH] testsuite: check CONFIG_DESKTOP before using 'od -t'
+
+The '-t' option for od is enabled by CONFIG_DESKTOP. So
+check this config before using 'od -t' in test cases.
+
+Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2018-November/086895.html]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ testsuite/echo/echo-prints-dash        | 1 +
+ testsuite/echo/echo-prints-non-opts    | 1 +
+ testsuite/echo/echo-prints-slash-zero  | 2 +-
+ testsuite/echo/echo-prints-slash_00041 | 2 +-
+ testsuite/echo/echo-prints-slash_0041  | 2 +-
+ testsuite/echo/echo-prints-slash_041   | 2 +-
+ testsuite/echo/echo-prints-slash_41    | 2 +-
+ 7 files changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/testsuite/echo/echo-prints-dash b/testsuite/echo/echo-prints-dash
+index ddcdbad..f1f31a0 100644
+--- a/testsuite/echo/echo-prints-dash
++++ b/testsuite/echo/echo-prints-dash
+@@ -1 +1,2 @@
++# FEATURE: CONFIG_DESKTOP
+ test "`busybox echo - | od -t x1 | head -n 1`" = "0000000 2d 0a"
+diff --git a/testsuite/echo/echo-prints-non-opts b/testsuite/echo/echo-prints-non-opts
+index c7d1e20..4e642a1 100644
+--- a/testsuite/echo/echo-prints-non-opts
++++ b/testsuite/echo/echo-prints-non-opts
+@@ -1 +1,2 @@
++# FEATURE: CONFIG_DESKTOP
+ test "`busybox echo -neEZ | od -t x1 | head -n 1`" = "0000000 2d 6e 65 45 5a 0a"
+diff --git a/testsuite/echo/echo-prints-slash-zero b/testsuite/echo/echo-prints-slash-zero
+index d97ed8e..948f899 100644
+--- a/testsuite/echo/echo-prints-slash-zero
++++ b/testsuite/echo/echo-prints-slash-zero
+@@ -1,3 +1,3 @@
+-# FEATURE: CONFIG_FEATURE_FANCY_ECHO
++# FEATURE: CONFIG_FEATURE_FANCY_ECHO CONFIG_DESKTOP
+ 
+ test "`busybox echo -e -n 'msg\n\0' | od -t x1 | head -n 1`" = "0000000 6d 73 67 0a 00"
+diff --git a/testsuite/echo/echo-prints-slash_00041 b/testsuite/echo/echo-prints-slash_00041
+index 9cffabd..7ea217b 100644
+--- a/testsuite/echo/echo-prints-slash_00041
++++ b/testsuite/echo/echo-prints-slash_00041
+@@ -1,3 +1,3 @@
+-# FEATURE: CONFIG_FEATURE_FANCY_ECHO
++# FEATURE: CONFIG_FEATURE_FANCY_ECHO CONFIG_DESKTOP
+ 
+ test "`busybox echo -ne '\00041z' | od -t x1 | head -n 1`" = "0000000 04 31 7a"
+diff --git a/testsuite/echo/echo-prints-slash_0041 b/testsuite/echo/echo-prints-slash_0041
+index b07429d..941faca 100644
+--- a/testsuite/echo/echo-prints-slash_0041
++++ b/testsuite/echo/echo-prints-slash_0041
+@@ -1,3 +1,3 @@
+-# FEATURE: CONFIG_FEATURE_FANCY_ECHO
++# FEATURE: CONFIG_FEATURE_FANCY_ECHO CONFIG_DESKTOP
+ 
+ test "`busybox echo -ne '\0041z' | od -t x1 | head -n 1`" = "0000000 21 7a"
+diff --git a/testsuite/echo/echo-prints-slash_041 b/testsuite/echo/echo-prints-slash_041
+index 1d70cec..60cbfca 100644
+--- a/testsuite/echo/echo-prints-slash_041
++++ b/testsuite/echo/echo-prints-slash_041
+@@ -1,3 +1,3 @@
+-# FEATURE: CONFIG_FEATURE_FANCY_ECHO
++# FEATURE: CONFIG_FEATURE_FANCY_ECHO CONFIG_DESKTOP
+ 
+ test "`busybox echo -ne '\041z' | od -t x1 | head -n 1`" = "0000000 21 7a"
+diff --git a/testsuite/echo/echo-prints-slash_41 b/testsuite/echo/echo-prints-slash_41
+index 6d8999b..afd7c36 100644
+--- a/testsuite/echo/echo-prints-slash_41
++++ b/testsuite/echo/echo-prints-slash_41
+@@ -1,3 +1,3 @@
+-# FEATURE: CONFIG_FEATURE_FANCY_ECHO
++# FEATURE: CONFIG_FEATURE_FANCY_ECHO CONFIG_DESKTOP
+ 
+ test "`busybox echo -ne '\41z' | od -t x1 | head -n 1`" = "0000000 21 7a"
+-- 
+2.7.4
+
diff --git a/meta/recipes-core/busybox/busybox_1.29.2.bb b/meta/recipes-core/busybox/busybox_1.29.2.bb
index f38db2a..66049bd 100644
--- a/meta/recipes-core/busybox/busybox_1.29.2.bb
+++ b/meta/recipes-core/busybox/busybox_1.29.2.bb
@@ -44,6 +44,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://0001-testsuite-check-uudecode-before-using-it.patch \
            file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \
            file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \
+           file://0001-testsuite-check-CONFIG_DESKTOP-before-using-od-t.patch \
 "
 SRC_URI_append_libc-musl = " file://musl.cfg "
 
-- 
1.9.1



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

* [PATCH 8/9] busybox: ship a symlink farm for ptest
  2018-11-23  2:16 [PATCH V3 0/9] Fixes for busybox ptest Chen Qi
                   ` (6 preceding siblings ...)
  2018-11-23  2:16 ` [PATCH 7/9] busybox: check CONFIG_DESKTOP before using 'od -t' in " Chen Qi
@ 2018-11-23  2:16 ` Chen Qi
  2018-11-23  2:16 ` [PATCH 9/9] base-files: default hostname to localhost Chen Qi
  8 siblings, 0 replies; 11+ messages in thread
From: Chen Qi @ 2018-11-23  2:16 UTC (permalink / raw)
  To: openembedded-core

From: Ross Burton <ross.burton@intel.com>

Ship a symlink farm for busybox, which correctly considers SUID
split. This ensures that all utilities used in busybox's test cases
will first use that ones that are provided by busybox.

Modify run-ptest to prepend the directory to PATH, and also change
variable name from current_dir to current_path, as the former is
a little misleading. `readlink -f $0' gets a path to the current
script instead of the current directory.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/busybox/busybox.inc     | 14 ++++++++++++++
 meta/recipes-core/busybox/files/run-ptest |  5 +++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index b45d2b6..68ba8c6 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -352,6 +352,20 @@ do_install_ptest () {
 	cp -r ${B}/testsuite ${D}${PTEST_PATH}/
 	cp ${B}/.config      ${D}${PTEST_PATH}/
 	ln -s /bin/busybox   ${D}${PTEST_PATH}/busybox
+
+	mkdir ${D}${PTEST_PATH}/bin
+	if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then
+		while read link; do
+			ln -s ${base_bindir}/busybox.suid ${D}${PTEST_PATH}/bin/$(basename $link)
+		done <${D}${sysconfdir}/busybox.links.suid
+		while read link; do
+			ln -s ${base_bindir}/busybox.nosuid ${D}${PTEST_PATH}/bin/$(basename $link)
+		done <${D}${sysconfdir}/busybox.links.nosuid
+	else
+		while read link; do
+			ln -s ${base_bindir}/busybox ${D}${PTEST_PATH}/bin/$(basename $link)
+		done <${D}${sysconfdir}/busybox.links
+	fi
 }
 
 inherit update-alternatives
diff --git a/meta/recipes-core/busybox/files/run-ptest b/meta/recipes-core/busybox/files/run-ptest
index 8b99bed..b19e5b5 100644
--- a/meta/recipes-core/busybox/files/run-ptest
+++ b/meta/recipes-core/busybox/files/run-ptest
@@ -1,7 +1,8 @@
 #!/bin/sh
 
-current_dir=$(readlink -f $0)
-export bindir=$(dirname $current_dir)
+current_path=$(readlink -f $0)
+export bindir=$(dirname $current_path)
+export PATH=$bindir/bin:$PATH
 export SKIP_KNOWN_BUGS=1
 
 cd testsuite || exit 1
-- 
1.9.1



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

* [PATCH 9/9] base-files: default hostname to localhost
  2018-11-23  2:16 [PATCH V3 0/9] Fixes for busybox ptest Chen Qi
                   ` (7 preceding siblings ...)
  2018-11-23  2:16 ` [PATCH 8/9] busybox: ship a symlink farm for ptest Chen Qi
@ 2018-11-23  2:16 ` Chen Qi
  2018-11-23 23:38   ` Richard Purdie
  8 siblings, 1 reply; 11+ messages in thread
From: Chen Qi @ 2018-11-23  2:16 UTC (permalink / raw)
  To: openembedded-core

Previously we default hostname to be ${MACHINE}, but there's no entry
in /etc/hosts, and `hostname -f' command fails. So change it to
'localhost'.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 6e75652..3a0eb4e 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -60,13 +60,13 @@ conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
              ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
              ${sysconfdir}/default"
 
-# By default the hostname is the machine name. If the hostname is unset then a
+# By default the hostname is 'localhost'. If the hostname is unset then a
 # /etc/hostname file isn't written, suitable for environments with dynamic
 # hostnames.
 #
 # The hostname can be changed outside of this recipe by using
 # hostname_pn-base-files = "my-host-name".
-hostname = "${MACHINE}"
+hostname = "localhost"
 
 BASEFILESISSUEINSTALL ?= "do_install_basefilesissue"
 
-- 
1.9.1



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

* Re: [PATCH 9/9] base-files: default hostname to localhost
  2018-11-23  2:16 ` [PATCH 9/9] base-files: default hostname to localhost Chen Qi
@ 2018-11-23 23:38   ` Richard Purdie
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Purdie @ 2018-11-23 23:38 UTC (permalink / raw)
  To: Chen Qi, openembedded-core

On Fri, 2018-11-23 at 10:16 +0800, Chen Qi wrote:
> Previously we default hostname to be ${MACHINE}, but there's no entry
> in /etc/hosts, and `hostname -f' command fails. So change it to
> 'localhost'.
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/recipes-core/base-files/base-files_3.0.14.bb | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

This is not the correct way to fix this, we should be adding the
correct entry to /etc/hosts...

Cheers,

Richard



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

end of thread, other threads:[~2018-11-23 23:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-23  2:16 [PATCH V3 0/9] Fixes for busybox ptest Chen Qi
2018-11-23  2:16 ` [PATCH 1/9] busybox: enable bzip2 by default Chen Qi
2018-11-23  2:16 ` [PATCH 2/9] bzip2: extend alternatives list to include bzip2 Chen Qi
2018-11-23  2:16 ` [PATCH 3/9] busybox: add zip to RDEPENDS of ptest package Chen Qi
2018-11-23  2:16 ` [PATCH 4/9] busybox: check uudecode before using it in test case Chen Qi
2018-11-23  2:16 ` [PATCH 5/9] busybox: use example.org instead of google.com in wget " Chen Qi
2018-11-23  2:16 ` [PATCH 6/9] busybox: fix du-l-works " Chen Qi
2018-11-23  2:16 ` [PATCH 7/9] busybox: check CONFIG_DESKTOP before using 'od -t' in " Chen Qi
2018-11-23  2:16 ` [PATCH 8/9] busybox: ship a symlink farm for ptest Chen Qi
2018-11-23  2:16 ` [PATCH 9/9] base-files: default hostname to localhost Chen Qi
2018-11-23 23:38   ` Richard Purdie

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.