All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ltp: nm01: Remove prefix zeros of the addresses output by nm before comparing
@ 2020-01-06 11:43 zhe.he
  2020-01-06 11:51 ` Ross Burton
  0 siblings, 1 reply; 4+ messages in thread
From: zhe.he @ 2020-01-06 11:43 UTC (permalink / raw)
  To: openembedded-core

From: He Zhe <zhe.he@windriver.com>

The latest nm v2.33.1 outputs symbols addresses without prefix zeros
for "nm -f posix", which causes the following error.
nm01 5 TFAIL: Got wrong format with -f bsd

Backport a patch to fix it.

Signed-off-by: He Zhe <zhe.he@windriver.com>
---
v2: Add ltp prefix to the patch title

 ...-prefix-zeros-of-the-addresses-output-by-.patch | 43 ++++++++++++++++++++++
 meta/recipes-extended/ltp/ltp_20190517.bb          |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta/recipes-extended/ltp/ltp/0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch

diff --git a/meta/recipes-extended/ltp/ltp/0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch b/meta/recipes-extended/ltp/ltp/0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch
new file mode 100644
index 0000000..502ea69
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch
@@ -0,0 +1,43 @@
+From 59cb0dd9f8e65b2d398fcaf4d163cbc8e1d0ae45 Mon Sep 17 00:00:00 2001
+From: He Zhe <zhe.he@windriver.com>
+Date: Tue, 31 Dec 2019 15:02:48 +0800
+Subject: [PATCH] nm01: Remove prefix zeros of the addresses output by nm
+ before comparing
+
+The latest nm v2.33.1 outputs symbols addresses without prefix zeros
+for "nm -f posix", which causes the following error.
+nm01 5 TFAIL: Got wrong format with -f bsd
+
+Let's remove the prefix zeros before comparing.
+
+Upstream-Status: Backport [http://lists.linux.it/pipermail/ltp/2020-January/014884.html]
+
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+Reviewed-by: Li Wang <liwang@redhat.com>
+Reviewed-by: Petr Vorel <pvorel@suse.cz>
+Tested-by: Petr Vorel <pvorel@suse.cz>
+---
+ testcases/commands/nm/nm01 | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/commands/nm/nm01 b/testcases/commands/nm/nm01
+index 30c41bd..fd9d3d9 100755
+--- a/testcases/commands/nm/nm01
++++ b/testcases/commands/nm/nm01
+@@ -84,8 +84,11 @@ test5()
+ 	EXPECT_PASS $NM -f bsd $TST_DATAROOT/f1 \> nm_bsd.out
+ 	EXPECT_PASS $NM -f posix $TST_DATAROOT/f1 \> nm_posix.out
+ 
+-	ROD awk '{print $3 $2 $1}' nm_bsd.out \> nm1.out
+-	ROD awk '{print $1 $2 $3}' nm_posix.out \> nm2.out
++	ROD awk '{print gensub(/\y(0+)([0-9a-fA-F]+)\y/, "\\2", "g")}' nm_bsd.out \> trimmed_nm_bsd.out
++	ROD awk '{print gensub(/\y(0+)([0-9a-fA-F]+)\y/, "\\2", "g")}' nm_posix.out \> trimmed_nm_posix.out
++
++	ROD awk '{print $3 $2 $1}' trimmed_nm_bsd.out \> nm1.out
++	ROD awk '{print $1 $2 $3}' trimmed_nm_posix.out \> nm2.out
+ 
+ 	if diff nm1.out nm2.out > /dev/null; then
+ 		tst_res TPASS "Got BSD format with -f bsd"
+-- 
+2.7.4
+
diff --git a/meta/recipes-extended/ltp/ltp_20190517.bb b/meta/recipes-extended/ltp/ltp_20190517.bb
index 60f749b..f70687f 100644
--- a/meta/recipes-extended/ltp/ltp_20190517.bb
+++ b/meta/recipes-extended/ltp/ltp_20190517.bb
@@ -51,6 +51,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
            file://0001-cve-2017-17052-Avoid-unsafe-exits-in-threads.patch \
            file://0001-overcommit_memory-update-for-mm-fix-false-positive-O.patch \
            file://0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch \
+           file://0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch \
            "
 
 S = "${WORKDIR}/git"
-- 
2.7.4



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

* Re: [PATCH v2] ltp: nm01: Remove prefix zeros of the addresses output by nm before comparing
  2020-01-06 11:43 [PATCH v2] ltp: nm01: Remove prefix zeros of the addresses output by nm before comparing zhe.he
@ 2020-01-06 11:51 ` Ross Burton
  2020-01-06 12:32   ` He Zhe
  0 siblings, 1 reply; 4+ messages in thread
From: Ross Burton @ 2020-01-06 11:51 UTC (permalink / raw)
  To: zhe.he, openembedded-core

We've a patch queued to upgrade to 20190930, is this fix included in 
that release or does this patch need to be rebased?

Ross


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

* Re: [PATCH v2] ltp: nm01: Remove prefix zeros of the addresses output by nm before comparing
  2020-01-06 11:51 ` Ross Burton
@ 2020-01-06 12:32   ` He Zhe
  2020-01-09  3:11     ` He Zhe
  0 siblings, 1 reply; 4+ messages in thread
From: He Zhe @ 2020-01-06 12:32 UTC (permalink / raw)
  To: Ross Burton, openembedded-core

I saw that thread stop a few days ago. This was just merged in ltp about 10 hours ago and should not be in that patch.

Regards,
Zhe

On 1/6/20 7:51 PM, Ross Burton wrote:
> We've a patch queued to upgrade to 20190930, is this fix included in that release or does this patch need to be rebased?
>
> Ross



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

* Re: [PATCH v2] ltp: nm01: Remove prefix zeros of the addresses output by nm before comparing
  2020-01-06 12:32   ` He Zhe
@ 2020-01-09  3:11     ` He Zhe
  0 siblings, 0 replies; 4+ messages in thread
From: He Zhe @ 2020-01-09  3:11 UTC (permalink / raw)
  To: Ross Burton, openembedded-core

Hi Ross,

It seems that the upgrading of ltp is not moving on. And this patch is not included in ltp 20190930. Could we get this merged first?

Thanks,
Zhe

On 1/6/20 8:32 PM, He Zhe wrote:
> I saw that thread stop a few days ago. This was just merged in ltp about 10 hours ago and should not be in that patch.
>
> Regards,
> Zhe
>
> On 1/6/20 7:51 PM, Ross Burton wrote:
>> We've a patch queued to upgrade to 20190930, is this fix included in that release or does this patch need to be rebased?
>>
>> Ross



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

end of thread, other threads:[~2020-01-09  3:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 11:43 [PATCH v2] ltp: nm01: Remove prefix zeros of the addresses output by nm before comparing zhe.he
2020-01-06 11:51 ` Ross Burton
2020-01-06 12:32   ` He Zhe
2020-01-09  3:11     ` He Zhe

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.