From patchwork Thu Mar 2 19:44:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruce Rogers X-Patchwork-Id: 9601427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D73AC60429 for ; Thu, 2 Mar 2017 19:46:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3B7428541 for ; Thu, 2 Mar 2017 19:46:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B72B4285D8; Thu, 2 Mar 2017 19:46:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 45BC728541 for ; Thu, 2 Mar 2017 19:46:10 +0000 (UTC) Received: from localhost ([::1]:54232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjWfx-0004v7-DP for patchwork-qemu-devel@patchwork.kernel.org; Thu, 02 Mar 2017 14:46:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjWen-0004C6-Oy for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:44:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjWek-0007Kg-Ao for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:44:57 -0500 Received: from inet-orm.provo.novell.com ([137.65.248.124]:60929 helo=mail.novell.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cjWek-0007KQ-0t for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:44:54 -0500 Received: from brogers1.provo.novell.com (brogers1.dnsdhcp.provo.novell.com [137.65.132.245]) by mail.novell.com with ESMTP (NOT encrypted); Thu, 02 Mar 2017 12:44:41 -0700 From: Bruce Rogers To: qemu-devel@nongnu.org Date: Thu, 2 Mar 2017 12:44:37 -0700 Message-Id: <20170302194437.21823-1-brogers@suse.com> X-Mailer: git-send-email 2.11.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 137.65.248.124 Subject: [Qemu-devel] [PATCH] tests: check path to avoid a failing qga/get-vcpus test 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: mdroth@linux.vnet.ibm.com, Bruce Rogers Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The qga/get-vcpus test fails in a simple chroot environment, as used in an openSUSE Build Service local build, so first check that the sysfs based path exists in order to avoid calling this test in an environment where it won't work right. Signed-off-by: Bruce Rogers Reviewed-by: Marc-André Lureau --- tests/test-qga.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test-qga.c b/tests/test-qga.c index 868b02a40f..9e6d19a6e1 100644 --- a/tests/test-qga.c +++ b/tests/test-qga.c @@ -924,7 +924,9 @@ int main(int argc, char **argv) g_test_add_data_func("/qga/info", &fix, test_qga_info); g_test_add_data_func("/qga/network-get-interfaces", &fix, test_qga_network_get_interfaces); - g_test_add_data_func("/qga/get-vcpus", &fix, test_qga_get_vcpus); + if (!access("/sys/devices/system/cpu/cpu0", F_OK)) { + g_test_add_data_func("/qga/get-vcpus", &fix, test_qga_get_vcpus); + } g_test_add_data_func("/qga/get-fsinfo", &fix, test_qga_get_fsinfo); g_test_add_data_func("/qga/get-memory-block-info", &fix, test_qga_get_memory_block_info);