<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 31, 2019 at 3:03 PM <<a href="mailto:zhe.he@windriver.com">zhe.he@windriver.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: He Zhe <<a href="mailto:zhe.he@windriver.com" target="_blank">zhe.he@windriver.com</a>><br>
<br>
The latest nm v2.33.1.20191208 outputs symbols addresses without prefix zeros<br>
for "nm -f posix", which causes the following error.<br>
nm01 5 TFAIL: Got wrong format with -f bsd<br>
<br>
Let's remove the prefix zeros before comparing.<br>
<br>
Signed-off-by: He Zhe <<a href="mailto:zhe.he@windriver.com" target="_blank">zhe.he@windriver.com</a>><br></blockquote><div><span class="gmail_default" style="font-size:small">Reviewed-by: Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>></span></div><div><span class="gmail_default" style="font-size:small"></span> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
v2:<br>
Add boundary mark to RE pattern to exactly cover the prefix zeros<br>
Add one more temp file to contain trimmed output<br>
<br>
 testcases/commands/nm/nm01.sh | 7 +++++--<br>
 1 file changed, 5 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/testcases/commands/nm/nm01.sh b/testcases/commands/nm/nm01.sh<br>
index 30c41bd..fd9d3d9 100755<br>
--- a/testcases/commands/nm/nm01.sh<br>
+++ b/testcases/commands/nm/nm01.sh<br>
@@ -84,8 +84,11 @@ test5()<br>
        EXPECT_PASS $NM -f bsd $TST_DATAROOT/f1 \> nm_bsd.out<br>
        EXPECT_PASS $NM -f posix $TST_DATAROOT/f1 \> nm_posix.out<br>
<br>
-       ROD awk '{print $3 $2 $1}' nm_bsd.out \> nm1.out<br>
-       ROD awk '{print $1 $2 $3}' nm_posix.out \> nm2.out<br>
+       ROD awk '{print gensub(/\y(0+)([0-9a-fA-F]+)\y/, "\\2", "g")}' nm_bsd.out \> trimmed_nm_bsd.out<br>
+       ROD awk '{print gensub(/\y(0+)([0-9a-fA-F]+)\y/, "\\2", "g")}' nm_posix.out \> trimmed_nm_posix.out<br>
+<br>
+       ROD awk '{print $3 $2 $1}' trimmed_nm_bsd.out \> nm1.out<br>
+       ROD awk '{print $1 $2 $3}' trimmed_nm_posix.out \> nm2.out<br>
<br>
        if diff nm1.out nm2.out > /dev/null; then<br>
                tst_res TPASS "Got BSD format with -f bsd"<br>
-- <br>
2.7.4<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>