public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/tools_test: Add extra logging around chdirs
Date: Wed, 13 Nov 2019 10:09:45 +0200	[thread overview]
Message-ID: <20191113080945.GS25209@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20191112164012.463634-1-arkadiusz.hiler@intel.com>

On Tue, Nov 12, 2019 at 06:40:12PM +0200, Arkadiusz Hiler wrote:
> Sometimes we end up in /bin and I am not able to explain that just by
> looking at the machine or the IGT tarball that was deployed there so
> let's get some more breadcrumbs.
> 
> Cc: Petri Latvala <petri.latvala@intel.com>
> Issue: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/12
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

Very similar to
https://patchwork.freedesktop.org/patch/277414/?series=55233&rev=1 so
have a

Reviewed-by: Petri Latvala <petri.latvala@intel.com>

> ---
>  tests/tools_test.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/tools_test.c b/tests/tools_test.c
> index 88a6ae96..e3f73ac2 100644
> --- a/tests/tools_test.c
> +++ b/tests/tools_test.c
> @@ -63,14 +63,30 @@ static void assert_cmd_success(int exec_return)
>  static bool chdir_to_tools_dir(void)
>  {
>  	char path[PATH_MAX];
> +	char *cwd;
> +
> +	cwd = get_current_dir_name();
> +	igt_info("Current working directory: %s\n", cwd);
> +	free(cwd);
>  
>  	/* Try TOOLS relative to cwd */
> +	igt_info("Trying to cd to %s\n", TOOLS);
>  	if (chdir(TOOLS) == 0)
>  		return true;
>  
> +	igt_info("Failed to cd to %s\n", TOOLS);
> +
>  	/* Try TOOLS and install dir relative to test binary */
> -	if (readlink("/proc/self/exe", path, sizeof(path)) > 0)
> +	if (readlink("/proc/self/exe", path, sizeof(path)) > 0) {
> +		igt_info("/proc/self/exe point to %s, going to dirname()\n", path);
>  		chdir(dirname(path));
> +	}
> +
> +	cwd = get_current_dir_name();
> +	igt_info("Current working directory: %s\n", cwd);
> +	free(cwd);
> +
> +	igt_info("Trying to cd to %s or ../../bin\n", TOOLS);
>  
>  	return chdir(TOOLS) == 0 || chdir("../../bin") == 0;
>  }
> -- 
> 2.23.0
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

      parent reply	other threads:[~2019-11-13  8:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 16:40 [igt-dev] [PATCH i-g-t] tests/tools_test: Add extra logging around chdirs Arkadiusz Hiler
2019-11-12 18:37 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-11-13  3:44 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-11-13  8:09 ` Petri Latvala [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191113080945.GS25209@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=arkadiusz.hiler@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox