From nobody Sun Oct 5 17:37:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521115015731705.0314216822562; Thu, 15 Mar 2018 04:56:55 -0700 (PDT) Received: from localhost ([::1]:50825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewRV8-00006Y-W2 for importer@patchew.org; Thu, 15 Mar 2018 07:56:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewRQM-0004zj-2e for qemu-devel@nongnu.org; Thu, 15 Mar 2018 07:51:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewRQK-00034x-PV for qemu-devel@nongnu.org; Thu, 15 Mar 2018 07:51:58 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41154 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewRQB-0002vq-PZ; Thu, 15 Mar 2018 07:51:47 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 509A5406F8AB; Thu, 15 Mar 2018 11:51:47 +0000 (UTC) Received: from red.redhat.com (ovpn-121-135.rdu2.redhat.com [10.10.121.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78071202322B; Thu, 15 Mar 2018 11:51:46 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Thu, 15 Mar 2018 06:51:44 -0500 Message-Id: <20180315115144.801202-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 15 Mar 2018 11:51:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 15 Mar 2018 11:51:47 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 for-2.12] iotests: Avoid realpath, for CentOS 6 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , pbonzini@redhat.com, famz@redhat.com, qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" CentOS 6 lacks a realpath binary on the base install, which makes all iotests runs fail since the 2.11 release: 001 - output mismatch (see 001.out.bad) ./check: line 815: realpath: command not found diff: missing operand after `/home/dummy/qemu/tests/qemu-iotests/001.out' diff: Try `diff --help' for more information. Many of the uses of 'realpath' in the check script were being used on the output of 'type -p' - but that is already an absolute file name. While a canonical name can often be shorter (realpath gets rid of /../), it can also be longer (due to symlink expansion); and we really don't care if the name is canonical, merely that it was an executable file with an absolute path. These were broken in commit cceaf1db. The remaining use of realpath was to convert a possibly relative filename into an absolute one before calling diff to make it easier to copy-and-paste the filename for moving the .bad file into place as the new reference file even when running iotests out-of-tree (see commit 93e53fb6), but $PWD can achieve the same purpose. Signed-off-by: Eric Blake Reviewed-by: Jeff Cody Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v2: Don't revert 93e53fb6, add commit id mentions in commit message, retitle --- tests/qemu-iotests/check | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 469142cd586..ec8033350d1 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -92,7 +92,7 @@ set_prog_path() { p=3D`command -v $1 2> /dev/null` if [ -n "$p" -a -x "$p" ]; then - realpath -- "$(type -p "$p")" + type -p "$p" else return 1 fi @@ -554,7 +554,7 @@ then [ "$QEMU_PROG" =3D "" ] && _init_error "qemu not found" fi fi -export QEMU_PROG=3D$(realpath -- "$(type -p "$QEMU_PROG")") +export QEMU_PROG=3D"$(type -p "$QEMU_PROG")" if [ -z "$QEMU_IMG_PROG" ]; then if [ -x "$build_iotests/qemu-img" ]; then @@ -565,7 +565,7 @@ if [ -z "$QEMU_IMG_PROG" ]; then _init_error "qemu-img not found" fi fi -export QEMU_IMG_PROG=3D$(realpath -- "$(type -p "$QEMU_IMG_PROG")") +export QEMU_IMG_PROG=3D"$(type -p "$QEMU_IMG_PROG")" if [ -z "$QEMU_IO_PROG" ]; then if [ -x "$build_iotests/qemu-io" ]; then @@ -576,7 +576,7 @@ if [ -z "$QEMU_IO_PROG" ]; then _init_error "qemu-io not found" fi fi -export QEMU_IO_PROG=3D$(realpath -- "$(type -p "$QEMU_IO_PROG")") +export QEMU_IO_PROG=3D"$(type -p "$QEMU_IO_PROG")" if [ -z $QEMU_NBD_PROG ]; then if [ -x "$build_iotests/qemu-nbd" ]; then @@ -587,7 +587,7 @@ if [ -z $QEMU_NBD_PROG ]; then _init_error "qemu-nbd not found" fi fi -export QEMU_NBD_PROG=3D$(realpath -- "$(type -p "$QEMU_NBD_PROG")") +export QEMU_NBD_PROG=3D"$(type -p "$QEMU_NBD_PROG")" if [ -z "$QEMU_VXHS_PROG" ]; then export QEMU_VXHS_PROG=3D"`set_prog_path qnio_server`" @@ -811,7 +811,7 @@ do else echo " - output mismatch (see $seq.out.bad)" mv $tmp.out $seq.out.bad - $diff -w "$reference" $(realpath $seq.out.bad) + $diff -w "$reference" "$PWD"/$seq.out.bad err=3Dtrue fi fi --=20 2.14.3