qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH] iotests: Work around failing readlink -f
Date: Mon, 14 Sep 2020 14:26:47 +0200	[thread overview]
Message-ID: <abaa48c8-c947-4a50-6342-a094b7d0f532@redhat.com> (raw)
In-Reply-To: <20200914113809.63640-1-mreitz@redhat.com>

On 14/09/2020 13.38, Max Reitz wrote:
> On macOS, (out of the box) readlink does not have -f.  If the recent
> "readlink -f" call introduced by b1cbc33a397 fails, just fall back to
> the old behavior (which means you can run the iotests only from the
> build tree, but that worked fine for six years, so it should be fine
> still).
> 
> Keep any potential error message on stderr.  If users want to run the
> iotests from outside the build tree, this may point them to what's wrong
> (with their system).
> 
> Fixes: b1cbc33a3971b6bb005d5ac3569feae35a71de0f
>        ("iotests: Allow running from different directory")
> Reported-by: Claudio Fontana <cfontana@suse.de>
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> Hi Thomas,
> 
> I thought this would be quicker than writing a witty response on whether
> you or me should write this patch. O:)
> ---
>  tests/qemu-iotests/check | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index e14a1f354d..75675e1a18 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check
> @@ -45,6 +45,10 @@ then
>      fi
>      source_iotests=$(cd "$source_iotests"; pwd) || _init_error "failed to enter source tree"
>      build_iotests=$(readlink -f $(dirname "$0"))
> +    if [ "$?" -ne 0 ]; then
> +        # Perhaps -f is unsupported, revert to pre-b1cbc33a397 behavior
> +        build_iotests=$PWD
> +    fi
>  else
>      # called from the source tree
>      source_iotests=$PWD

Thanks, the macOS build seems to work again:

 https://cirrus-ci.com/task/5431828267925504?command=main#L7033

Tested-by: Thomas Huth <thuth@redhat.com>



  parent reply	other threads:[~2020-09-14 12:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 11:38 [PATCH] iotests: Work around failing readlink -f Max Reitz
2020-09-14 12:16 ` Alex Bennée
2020-09-14 12:26 ` Thomas Huth [this message]
2020-09-14 12:31 ` Peter Maydell
2020-09-14 12:32   ` Max Reitz
2020-09-14 12:51     ` Peter Maydell
2020-09-14 14:09       ` Max Reitz

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=abaa48c8-c947-4a50-6342-a094b7d0f532@redhat.com \
    --to=thuth@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).