From patchwork Mon Nov 4 15:13:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 11225989 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B313D1390 for ; Mon, 4 Nov 2019 15:20:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8939620663 for ; Mon, 4 Nov 2019 15:20:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Nn7kPJOh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8939620663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRe9k-0002CE-Em for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 Nov 2019 10:20:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40504) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRe3M-0002pe-2J for qemu-devel@nongnu.org; Mon, 04 Nov 2019 10:14:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRe3K-0002ju-Q8 for qemu-devel@nongnu.org; Mon, 04 Nov 2019 10:13:59 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58357 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iRe3K-0002jg-M4 for qemu-devel@nongnu.org; Mon, 04 Nov 2019 10:13:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572880438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZhvQYdqSVxC8PNSualrUpwUPMTwWhSaMc4yvowmz3iI=; b=Nn7kPJOhJi11OmrhJz8JspsSzCP0dqjMb0UHqCz4k4y+RPPMw/QQQ3gL4r0QB+65kyktbb dbYkAOUqXEOvNDMMwB+1hDrYCnRrMu+a6LcM1PUoy+8EbTweRa29QxZAHUbu0WGo8YA7ik j967uZLrNohnLE/jEjC9qhdAN4d1tbo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-fzc0QGGeOiyvNTWHtLurEA-1; Mon, 04 Nov 2019 10:13:55 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C72B31800D53; Mon, 4 Nov 2019 15:13:53 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-123-183.rdu2.redhat.com [10.10.123.183]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13DA35D6C8; Mon, 4 Nov 2019 15:13:51 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v7 6/8] Acceptance tests: add the build directory to the system PATH Date: Mon, 4 Nov 2019 10:13:21 -0500 Message-Id: <20191104151323.9883-7-crosa@redhat.com> In-Reply-To: <20191104151323.9883-1-crosa@redhat.com> References: <20191104151323.9883-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: fzc0QGGeOiyvNTWHtLurEA-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Beraldo Leal , Fabien Chouteau , KONRAD Frederic , =?utf-8?q?Herv=C3=A9_Poussin?= =?utf-8?q?eau?= , Wainer dos Santos Moschetta , Willian Rampazzo , Cleber Rosa , qemu-ppc@nongnu.org, Aleksandar Rikalo , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" So that when binaries such as qemu-img are searched for, those in the build tree will be favored. As a clarification, SRC_ROOT_DIR is dependent on the location from where tests are executed, so they are equal to the build directory if one is being used. The original motivation is that Avocado libraries such as avocado.utils.vmimage.get() may use the matching binaries, but it may also apply to any other binary that test code may eventually attempt to execute. Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 17ce583c87..a4bb796a47 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -110,6 +110,12 @@ class Test(avocado.Test): return None def setUp(self): + # Some utility code uses binaries from the system's PATH. For + # instance, avocado.utils.vmimage.get() uses qemu-img, to + # create a snapshot image. This is a transparent way of + # making sure those utilities find and use binaries on the + # build tree by default. + os.environ['PATH'] = '%s:%s' % (SRC_ROOT_DIR, os.environ['PATH']) self._vms = {} self.arch = self.params.get('arch',