big-test: Add test for enumerate dicts in an archive

Message ID 20240820110930.125828-1-claudiu.zissulescu-ianculescu@oracle.com
State New
Headers
Series big-test: Add test for enumerate dicts in an archive |

Commit Message

Claudiu Zissulescu-Ianculescu Aug. 20, 2024, 11:09 a.m. UTC
  From: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>

Hello,

This patch adds a simple test for the: ctf-reader: Enumerate dicts in
the archive rather than using their name patch. It calls abidw with
annotate and ctf option directly on vmlinux test image. If the above
patch is not acting, the abidw will return with an error.

	* test-self-compare-linux.cc (in_out_specs): Add new test.
	(main): Update test infrastructure for the new test.

Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
---
 test-self-compare-linux.cc | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
  

Comments

Dodji Seketeli Aug. 20, 2024, 5:45 p.m. UTC | #1
claudiu.zissulescu-ianculescu@oracle.com a écrit:

> From: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
>
> Hello,
>
> This patch adds a simple test for the: ctf-reader: Enumerate dicts in
> the archive rather than using their name patch. It calls abidw with
> annotate and ctf option directly on vmlinux test image. If the above
> patch is not acting, the abidw will return with an error.
>
> 	* test-self-compare-linux.cc (in_out_specs): Add new test.
> 	(main): Update test infrastructure for the new test.
>
> Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>

Many thanks!

The patch looks good to me and I have applied it to the mainline at
https://sourceware.org/git/?p=libabigail-tests.git;a=shortlog;h=refs/heads/master.

I just one question below.

[...]

> diff --git a/test-self-compare-linux.cc b/test-self-compare-linux.cc
> index 4b3cb44..d99c45c 100644
> --- a/test-self-compare-linux.cc
> +++ b/test-self-compare-linux.cc
> @@ -45,17 +45,26 @@ static InOutSpec in_out_specs[] =

> +
> +  {
> +    "",
> +    "data/test-self-compare-linux/test-minimal-ctf-1/vmlinux",
> +    "--ctf --annotate ",
> +    abigail::tools_utils::ABIDIFF_OK,
> +    "data/test-self-compare-linux/test-minimal-ctf-1/test1-output.txt",
> +    "output/test-self-compare-linux/test-minimal-ctf-1/test3-output.txt"
> +  },

Ah, I didn't realize that the vmlinux binary used in that tree, there
was a dictionary with a non-expected name.  What tool do I need to use
to see that?

Thanks.

[...]

Cheers,
  

Patch

diff --git a/test-self-compare-linux.cc b/test-self-compare-linux.cc
index 4b3cb44..d99c45c 100644
--- a/test-self-compare-linux.cc
+++ b/test-self-compare-linux.cc
@@ -45,17 +45,26 @@  static InOutSpec in_out_specs[] =
   {
     "data/test-self-compare-linux/test-minimal-ctf-1",
     "data/test-self-compare-linux/test-minimal-ctf-1/vmlinux",
-    "--ctf ",
+    "--ctf --linux-tree --vmlinux ",
     abigail::tools_utils::ABIDIFF_OK,
     "data/test-self-compare-linux/test-minimal-ctf-1/test1-output.txt",
     "output/test-self-compare-linux/test-minimal-ctf-1/test1-output.txt"
   },
+
+  {
+    "",
+    "data/test-self-compare-linux/test-minimal-ctf-1/vmlinux",
+    "--ctf --annotate ",
+    abigail::tools_utils::ABIDIFF_OK,
+    "data/test-self-compare-linux/test-minimal-ctf-1/test1-output.txt",
+    "output/test-self-compare-linux/test-minimal-ctf-1/test3-output.txt"
+  },
 #endif
 #if WITH_BTF
   {
     "data/test-self-compare-linux/test-minimal-ctf-1",
     "data/test-self-compare-linux/test-minimal-ctf-1/vmlinux",
-    "--btf ",
+    "--btf --linux-tree --vmlinux ",
     abigail::tools_utils::ABIDIFF_OK,
     "data/test-self-compare-linux/test-minimal-ctf-1/test1-output.txt",
     "output/test-self-compare-linux/test-minimal-ctf-1/test2-output.txt"
@@ -80,7 +89,10 @@  main()
   for (InOutSpec *spec = in_out_specs; spec->in_kernel_tree_path; ++spec)
     {
       bool is_ok = true;
-      in_kernel_tree_path = tests_src_dir + spec->in_kernel_tree_path;
+      if (spec->in_kernel_tree_path != "")
+	in_kernel_tree_path = tests_src_dir + spec->in_kernel_tree_path;
+      else
+	in_kernel_tree_path = "";
       in_vmlinux_path = tests_src_dir + spec->in_vmlinux_path;
       in_test_ouput_path = tests_src_dir + spec->in_report_path;
       out_test_output_path = build_dir + spec->out_report_path;
@@ -95,9 +107,9 @@  main()
 
       std::ostringstream o;
       o << abidw
-	<< " "
+	<< " --abidiff "
 	<< spec->options
-	<< " --abidiff --linux-tree --vmlinux "
+	<< " "
 	<< in_vmlinux_path
 	<< " "
 	<< in_kernel_tree_path