From nobody Mon Nov 23 04:28:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=comstyle.com ARC-Seal: i=1; a=rsa-sha256; t=1793401755; cv=none; d=zohomail.com; s=zohoarc; b=Cw/9WzsiCygn2N9p1AM5QQasalkjGt2s8L7tTRsGNlue7y7hbyZGpJVMClhezf3aB6IpOmZ+NyMfzB1VyN7zfgJ6lsBHc0rwjzU1j6ke351BJ1fgHtYMLiG3l66FV/faHSH74G1qdrQcgPX8qioES12oVJ6BFSUGQFHJ7ejv8tc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793401755; h=Content-Type:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9vrfqSbWULMh26YGwVpPqOUTVaUhLHAAkBz9UgrwIVs=; b=bZv7QW7hZY6GvqZ6SJ0++Ahhod9KxcyLZUovwP8C9d11UsRABt9F9HiFKiRS4BY9+PtYPmdZCY61FSj5Zk4IBKrjNjLicWwMNU1/j9LFo0gJUl+Oa02G0zWPL6dveEM7XlqZ9ku1RXbVyKkwPKSYHKXpLr5xZmSpz0oOII8vJiI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17934017556709.830904434912554; Fri, 30 Oct 2026 16:09:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMviZ-0005Gl-At; Fri, 30 Oct 2026 19:09:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMviU-0005FR-DO for qemu-devel@nongnu.org; Fri, 30 Oct 2026 19:08:58 -0400 Received: from speedy.comstyle.com ([2607:f938:3000:8::2] helo=mail.comstyle.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1xMviS-0000se-B6 for qemu-devel@nongnu.org; Fri, 30 Oct 2026 19:08:57 -0400 Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4jGcGt3Fstz8Pbj; Fri, 30 Oct 2026 19:08:54 -0400 (EDT) Received: from humpty.home.comstyle.com (unknown [IPv6:2001:470:b050:3:72be:d7:b79c:1bb7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 4jGcGt2g7sz8Pbg; Fri, 30 Oct 2026 19:08:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=comstyle.com; h=date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=2Hfg/+m7Z48f707fnzNx8FAmbMnRoXMhiON8l7wNH2g=; b=ZbuX Ds592He2CvvS9l4avcDfbACFaM7D2TPmVhhB5W0R3taednl+dKez4iFx8JSoYaMp xKYfw3wc3ePMEBQcojkdigbOIn6QSg6lMz1oz6MHAAA8YcckMw8Rrj0qNDcphOwl vO8CwfavnmIKtgcoLtP6uNVIXe2jkj8KfQ8IxIM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=comstyle.com; h=date:from:to :cc:subject:message-id:mime-version:content-type; q=dns; s= default; b=aSQJd1/U3UAUHR7cdm2e0CxK7/Nn+2Y6VoNcYS0Vih28jvrKOTDwr MQ5tmKD3v/wxPBT8VN1NdaQM3qymTlCrBRf3yzY8oAqI+uiCxV0W0nujVJsZ9bMk XFPwJByfl268SaeiGALLr9pHcWqIociKTLS7kNV75+aErbPqUcsYa0= Date: Fri, 30 Oct 2026 19:08:53 -0400 From: Brad Smith To: Michael Roth , Kostiantyn Kostiuk Cc: qemu-devel@nongnu.org Subject: [PATCH] tests/unit/test-qga: only run tests for commands the host provides Message-ID: MIME-Version: 1.0 Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f938:3000:8::2; envelope-from=brad@comstyle.com; helo=mail.comstyle.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-Zoho-Virus-Status: 1 X-Zoho-AV-Stamp: zmail-av-0.2.10.1.5.2/293.370.16 X-ZohoMail-DKIM: pass (identity @comstyle.com) X-ZM-MESSAGEID: 1793401759041154100 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tests/unit/test-qga: only run tests for commands the host provides guest-fsfreeze-status is only implemented when CONFIG_FSFREEZE is set (Linux and FreeBSD), and guest-get-users is only built on POSIX hosts when HAVE_UTMPX is set, so neither command exists on hosts such as OpenBSD. Only build and register these tests where the commands are available. Signed-off-by: Brad Smith --- tests/unit/test-qga.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index b1c84c188b..ef796f2f7d 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -787,6 +787,7 @@ static void test_qga_config(gconstpointer data) g_free(env[0]); } =20 +#ifdef CONFIG_FSFREEZE static void test_qga_fsfreeze_status(gconstpointer fix) { const TestFixture *fixture =3D fix; @@ -800,6 +801,7 @@ static void test_qga_fsfreeze_status(gconstpointer fix) status =3D qdict_get_try_str(ret, "return"); g_assert_cmpstr(status, =3D=3D, "thawed"); } +#endif =20 static QDict *wait_for_guest_exec_completion(int fd, int64_t pid) { @@ -1028,6 +1030,7 @@ static void test_qga_guest_get_timezone(gconstpointer= fix) g_assert(qdict_haskey(val, "offset")); } =20 +#ifdef HAVE_UTMPX static void test_qga_guest_get_users(gconstpointer fix) { const TestFixture *fixture =3D fix; @@ -1042,6 +1045,7 @@ static void test_qga_guest_get_users(gconstpointer fi= x) val =3D qdict_get_qlist(ret, "return"); g_assert_nonnull(val); } +#endif =20 static void test_qga_guest_get_osinfo(gconstpointer data) { @@ -1133,8 +1137,10 @@ int main(int argc, char **argv) g_test_add_data_func("/qga/invalid-oob", &fix, test_qga_invalid_oob); g_test_add_data_func("/qga/invalid-cmd", &fix, test_qga_invalid_cmd); g_test_add_data_func("/qga/invalid-args", &fix, test_qga_invalid_args); +#ifdef CONFIG_FSFREEZE g_test_add_data_func("/qga/fsfreeze-status", &fix, test_qga_fsfreeze_status); +#endif =20 g_test_add_data_func("/qga/blockedrpcs", NULL, test_qga_blockedrpcs); g_test_add_data_func("/qga/allowedrpcs", NULL, test_qga_allowedrpcs); @@ -1152,8 +1158,10 @@ int main(int argc, char **argv) test_qga_guest_get_host_name); g_test_add_data_func("/qga/guest-get-timezone", &fix, test_qga_guest_get_timezone); +#ifdef HAVE_UTMPX g_test_add_data_func("/qga/guest-get-users", &fix, test_qga_guest_get_users); +#endif =20 ret =3D g_test_run(); =20 --=20 2.56.0