Skip to contentSkip to conversation

tests/tools_test: Find the tool binaries also from bindir

PATCH In review Petri Latvala 3 participants 7 messages Oct 8, 2018 – Nov 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/tools_test: Find the tool binaries also from bindir

Also print what directory gets used.

---
 tests/tools_test.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
tests/tools_test.c +20 -7
index a0025bed..ac8717c5 100644
@@ -59,20 +59,33 @@ static void assert_cmd_success(int exec_return)
 	igt_assert_eq(exec_return, IGT_EXIT_SUCCESS);
 }
 
+bool chdir_to_tools_dir()
+{
+	char path[4096];
+
+	/* Try TOOLS relative to cwd */
+	if (chdir(TOOLS) == 0)
+		return true;
+
+	/* Try TOOLS and install dir relative to test binary */
+	if (readlink("/proc/self/exe", path, sizeof(path)) > 0)
+		chdir(dirname(path));
+
+	return chdir(TOOLS) == 0 || chdir("../../bin") == 0;
+}
+
 igt_main
 {
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		char path[4096];
-
-		/* Try to guess where the TOOLS are! */
-		if (access(TOOLS, F_OK) &&
-		    readlink("/proc/self/exe", path, sizeof(path)) > 0)
-			chdir(dirname(path));
+		char *path;
 
-		igt_require_f(chdir(TOOLS) == 0,
+		igt_require_f(chdir_to_tools_dir(),
 			      "Unable to determine the tools directory, expecting them in $cwd/" TOOLS " or $path/" TOOLS "\n");
+		path = get_current_dir_name();
+		igt_info("Using tools from %s\n", path);
+		free(path);
 	}
 
 	igt_subtest("sysfs_l3_parity") {
Signature · 6 lines
2.18.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir

== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir
URL : https://patchwork.freedesktop.org/series/50685/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4944 -> IGTPW_1924 =

== Summary - FAILURE ==

Serious unknown changes coming with IGTPW_1924 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_1924, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/50685/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in IGTPW_1924:

=== IGT changes ===

    ==== Possible regressions ====

    igt@drv_selftest@live_hangcheck:
      fi-icl-u:           PASS -> INCOMPLETE

== Known issues ==

Here are the changes found in IGTPW_1924 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s3:
      fi-kbl-soraka:      NOTRUN -> INCOMPLETE (fdo#107859, fdo#107556, fdo#107774)

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     NOTRUN -> FAIL (fdo#103167)

    igt@kms_pipe_crc_basic@hang-read-crc-pipe-b:
      fi-byt-clapper:     NOTRUN -> FAIL (fdo#107362, fdo#103191)

    igt@pm_rpm@module-reload:
      fi-hsw-peppy:       NOTRUN -> DMESG-WARN (fdo#107603, fdo#106386)

    
    ==== Possible fixes ====

    igt@pm_rpm@module-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#107726) -> PASS

fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#106386 https://bugs.freedesktop.org/show_bug.cgi?id=106386
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
fdo#107603 https://bugs.freedesktop.org/show_bug.cgi?id=107603
fdo#107726 https://bugs.freedesktop.org/show_bug.cgi?id=107726
fdo#107774 https://bugs.freedesktop.org/show_bug.cgi?id=107774
fdo#107859 https://bugs.freedesktop.org/show_bug.cgi?id=107859

== Participating hosts (45 -> 43) ==

Additional (5): fi-kbl-soraka fi-byt-clapper fi-hsw-peppy fi-bwr-2160 fi-kbl-r
Missing (7): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-icl-u2 fi-snb-2520m fi-ctg-p8600 fi-bdw-samus

== Build changes ==

* IGT: IGT_4670 -> IGTPW_1924

CI_DRM_4944: 66bd263b99fd264b57432c232756baf95b0a6255 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1924: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1924/
IGT_4670: 7e066794d2ea860f4199fd67549080de17b6b852 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1924/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir

In reply to Petri Latvala
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir
URL : https://patchwork.freedesktop.org/series/50685/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4944 -> IGTPW_1925 =

== Summary - WARNING ==

Minor unknown changes coming with IGTPW_1925 need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_1925, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/50685/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in IGTPW_1925:

=== IGT changes ===

    ==== Warnings ====

    igt@pm_rpm@module-reload:
      fi-hsw-4770r:       PASS -> SKIP

== Known issues ==

Here are the changes found in IGTPW_1925 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload-inject:
      fi-hsw-4770r:       PASS -> DMESG-WARN (fdo#107425, fdo#107924)

    igt@gem_exec_suspend@basic-s3:
      fi-kbl-soraka:      NOTRUN -> INCOMPLETE (fdo#107556, fdo#107774, fdo#107859)

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     NOTRUN -> FAIL (fdo#103167)

    igt@pm_rpm@module-reload:
      fi-hsw-peppy:       NOTRUN -> DMESG-WARN (fdo#106386, fdo#107603)

    
    ==== Possible fixes ====

    igt@pm_rpm@module-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#107726) -> PASS

fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#106386 https://bugs.freedesktop.org/show_bug.cgi?id=106386
fdo#107425 https://bugs.freedesktop.org/show_bug.cgi?id=107425
fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
fdo#107603 https://bugs.freedesktop.org/show_bug.cgi?id=107603
fdo#107726 https://bugs.freedesktop.org/show_bug.cgi?id=107726
fdo#107774 https://bugs.freedesktop.org/show_bug.cgi?id=107774
fdo#107859 https://bugs.freedesktop.org/show_bug.cgi?id=107859
fdo#107924 https://bugs.freedesktop.org/show_bug.cgi?id=107924

== Participating hosts (45 -> 43) ==

Additional (6): fi-kbl-soraka fi-hsw-peppy fi-bwr-2160 fi-kbl-7560u fi-byt-clapper fi-kbl-r
Missing (8): fi-ilk-m540 fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-snb-2520m fi-ctg-p8600 fi-pnv-d510 fi-bdw-samus

== Build changes ==

* IGT: IGT_4670 -> IGTPW_1925

CI_DRM_4944: 66bd263b99fd264b57432c232756baf95b0a6255 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1925: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1925/
IGT_4670: 7e066794d2ea860f4199fd67549080de17b6b852 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1925/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir

In reply to Petri Latvala
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/1] tests/tools_test: Find the tool binaries also from bindir
URL : https://patchwork.freedesktop.org/series/50685/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4670_full -> IGTPW_1925_full =

== Summary - WARNING ==

Minor unknown changes coming with IGTPW_1925_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_1925_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/50685/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in IGTPW_1925_full:

=== IGT changes ===

    ==== Warnings ====

    igt@kms_flip@flip-vs-dpms-off-vs-modeset:
      shard-apl:          PASS -> SKIP +21

    igt@perf_pmu@rc6:
      shard-kbl:          PASS -> SKIP

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          SKIP -> PASS +1

    igt@tools_test@tools_test:
      shard-apl:          SKIP -> PASS
      shard-glk:          SKIP -> PASS
      shard-snb:          SKIP -> PASS
      shard-hsw:          SKIP -> PASS +1

== Known issues ==

Here are the changes found in IGTPW_1925_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_workarounds@suspend-resume-fd:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
      shard-glk:          PASS -> FAIL (fdo#108145)

    igt@kms_color@pipe-a-ctm-max:
      shard-apl:          PASS -> FAIL (fdo#108147)

    igt@kms_color@pipe-a-degamma:
      shard-apl:          PASS -> FAIL (fdo#108145, fdo#104782)

    igt@kms_cursor_crc@cursor-128x128-suspend:
      shard-apl:          PASS -> FAIL (fdo#103232, fdo#103191)

    igt@kms_cursor_crc@cursor-64x64-dpms:
      shard-kbl:          PASS -> FAIL (fdo#103232)
      shard-apl:          PASS -> FAIL (fdo#103232) +2

    igt@kms_cursor_crc@cursor-64x64-sliding:
      shard-glk:          PASS -> FAIL (fdo#103232) +5

    igt@kms_frontbuffer_tracking@fbc-1p-rte:
      shard-apl:          PASS -> DMESG-WARN (fdo#108131, fdo#103558)

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
      shard-glk:          PASS -> FAIL (fdo#103167) +9

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      shard-glk:          PASS -> FAIL (fdo#103166)
      shard-kbl:          PASS -> FAIL (fdo#103166)

    igt@kms_plane_multiple@atomic-pipe-c-tiling-x:
      shard-apl:          PASS -> FAIL (fdo#103166)

    igt@pm_rpm@dpms-mode-unset-non-lpsp:
      shard-apl:          PASS -> DMESG-WARN (fdo#105602, fdo#103558) +25

    
    ==== Possible fixes ====

    igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
      shard-apl:          FAIL (fdo#106510, fdo#105458) -> SKIP

    igt@kms_cursor_crc@cursor-128x42-random:
      shard-glk:          FAIL (fdo#103232) -> PASS +2

    igt@kms_cursor_crc@cursor-64x21-onscreen:
      shard-apl:          FAIL (fdo#103232) -> SKIP

    igt@kms_cursor_crc@cursor-64x21-random:
      shard-apl:          FAIL (fdo#103232) -> PASS +5

    igt@kms_cursor_crc@cursor-64x21-sliding:
      shard-kbl:          FAIL (fdo#103232) -> PASS

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#105363) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-indfb-fliptrack:
      shard-glk:          DMESG-WARN (fdo#106538, fdo#105763) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
      shard-apl:          FAIL (fdo#103167) -> PASS +4

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
      shard-kbl:          FAIL (fdo#103167) -> PASS

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-blt:
      shard-glk:          FAIL (fdo#103167) -> PASS +3

    igt@kms_plane@pixel-format-pipe-a-planes:
      shard-snb:          FAIL (fdo#103166, fdo#107749) -> PASS

    {igt@kms_plane_alpha_blend@pipe-a-alpha-transparant-fb}:
      shard-apl:          FAIL (fdo#108145) -> SKIP +1

    igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
      shard-apl:          FAIL (fdo#103166) -> PASS +5
      shard-kbl:          FAIL (fdo#103166) -> PASS +2

    igt@kms_rotation_crc@sprite-rotation-180:
      shard-snb:          FAIL (fdo#103925) -> PASS +1

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS

    igt@kms_universal_plane@universal-plane-pipe-c-functional:
      shard-glk:          FAIL (fdo#103166) -> PASS +4

    
    ==== Warnings ====

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
      shard-glk:          DMESG-WARN (fdo#107956) -> INCOMPLETE (k.org#198133, fdo#103359)

    igt@kms_cursor_crc@cursor-256x256-sliding:
      shard-apl:          FAIL (fdo#103232) -> DMESG-WARN (fdo#105602, fdo#103558)

    igt@kms_cursor_crc@cursor-64x64-suspend:
      shard-apl:          FAIL (fdo#103232, fdo#103191) -> INCOMPLETE (fdo#103927)

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105458 https://bugs.freedesktop.org/show_bug.cgi?id=105458
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
fdo#106510 https://bugs.freedesktop.org/show_bug.cgi?id=106510
fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
fdo#107749 https://bugs.freedesktop.org/show_bug.cgi?id=107749
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108131 https://bugs.freedesktop.org/show_bug.cgi?id=108131
fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
fdo#108147 https://bugs.freedesktop.org/show_bug.cgi?id=108147
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133

== Participating hosts (6 -> 5) ==

Missing (1): shard-skl

== Build changes ==

* IGT: IGT_4670 -> IGTPW_1925
* Linux: CI_DRM_4933 -> CI_DRM_4944

CI_DRM_4933: 6b7a44d1597791524f46d7ea17620db54dffdc8c @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_4944: 66bd263b99fd264b57432c232756baf95b0a6255 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1925: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1925/
IGT_4670: 7e066794d2ea860f4199fd67549080de17b6b852 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1925/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#4 lore raw
In reply to Petri Latvala
Quoted 12 lines · Petri Latvala

Also print what directory gets used.

---
 tests/tools_test.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
tests/tools_test.c +0 -0
index a0025bed..ac8717c5 100644

tests/tools_test.c static void assert_cmd_success(int exec_return) · line 64

Quoted 6 lines
tests/tools_test.c +3 -0
@@ -59,20 +59,33 @@ static void assert_cmd_success(int exec_return)
 	igt_assert_eq(exec_return, IGT_EXIT_SUCCESS);
 }
 
+bool chdir_to_tools_dir()
+{
+	char path[4096];

use PATH_MAX

tests/tools_test.c static void assert_cmd_success(int exec_return) · line 68

Quoted 4 lines
tests/tools_test.c +4 -0
+
+	/* Try TOOLS relative to cwd */
+	if (chdir(TOOLS) == 0)
+		return true;

1st chdir(TOOLS)

tests/tools_test.c static void assert_cmd_success(int exec_return) · line 74

Quoted 6 lines
tests/tools_test.c +6 -0
+
+	/* Try TOOLS and install dir relative to test binary */
+	if (readlink("/proc/self/exe", path, sizeof(path)) > 0)
+		chdir(dirname(path));
+
+	return chdir(TOOLS) == 0 || chdir("../../bin") == 0;

2nd chdir(TOOLS)

one should be enough

tests/tools_test.c static void assert_cmd_success(int exec_return) · line 75

Quoted 1 line
tests/tools_test.c +1 -0
+}

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#5 lore raw
Quoted 38 lines · Arkadiusz Hiler
Quoted 12 lines · Petri Latvala

Also print what directory gets used.

---
 tests/tools_test.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
tests/tools_test.c +0 -0
index a0025bed..ac8717c5 100644

tests/tools_test.c static void assert_cmd_success(int exec_return) · line 64

Quoted 6 lines
tests/tools_test.c +3 -0
@@ -59,20 +59,33 @@ static void assert_cmd_success(int exec_return)
 	igt_assert_eq(exec_return, IGT_EXIT_SUCCESS);
 }
 
+bool chdir_to_tools_dir()
+{
+	char path[4096];

use PATH_MAX

tests/tools_test.c static void assert_cmd_success(int exec_return) · line 68

Quoted 4 lines
tests/tools_test.c +4 -0
+
+	/* Try TOOLS relative to cwd */
+	if (chdir(TOOLS) == 0)
+		return true;

1st chdir(TOOLS)

tests/tools_test.c static void assert_cmd_success(int exec_return) · line 74

Quoted 6 lines
tests/tools_test.c +6 -0
+
+	/* Try TOOLS and install dir relative to test binary */
+	if (readlink("/proc/self/exe", path, sizeof(path)) > 0)
+		chdir(dirname(path));
+
+	return chdir(TOOLS) == 0 || chdir("../../bin") == 0;

2nd chdir(TOOLS)

Quoted 1 line

one should be enough

TOOLS is "../blahblah" and chdir(dirname(path)) changes what the second one does.

Signature · 5 lines
Petri Latvala
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Reviewed-by
#6 lore raw
Quoted 39 lines · Petri Latvala
Quoted 38 lines · Arkadiusz Hiler
Quoted 12 lines · Petri Latvala

Also print what directory gets used.

---
 tests/tools_test.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
tests/tools_test.c +0 -0
index a0025bed..ac8717c5 100644

tests/tools_test.c static void assert_cmd_success(int exec_return) · line 64

Quoted 6 lines
tests/tools_test.c +3 -0
@@ -59,20 +59,33 @@ static void assert_cmd_success(int exec_return)
 	igt_assert_eq(exec_return, IGT_EXIT_SUCCESS);
 }
 
+bool chdir_to_tools_dir()
+{
+	char path[4096];

use PATH_MAX

tests/tools_test.c static void assert_cmd_success(int exec_return) · line 68

Quoted 4 lines
tests/tools_test.c +4 -0
+
+	/* Try TOOLS relative to cwd */
+	if (chdir(TOOLS) == 0)
+		return true;

1st chdir(TOOLS)

tests/tools_test.c static void assert_cmd_success(int exec_return) · line 74

Quoted 6 lines
tests/tools_test.c +6 -0
+
+	/* Try TOOLS and install dir relative to test binary */
+	if (readlink("/proc/self/exe", path, sizeof(path)) > 0)
+		chdir(dirname(path));
+
+	return chdir(TOOLS) == 0 || chdir("../../bin") == 0;

2nd chdir(TOOLS)

Quoted 3 lines
Quoted 1 line

one should be enough

TOOLS is "../blahblah" and chdir(dirname(path)) changes what the second one does.

right

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev