From patchwork Mon Oct 10 17:29:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 613771 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2129237pvb; Mon, 10 Oct 2022 10:57:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6HJUxTW/LBVd+QJssimCwFAyaCxsOYvLZOdJeOfgrzPJNlEq/2sqkHuoSvv5cPGgN5H05L X-Received: by 2002:ad4:574c:0:b0:4b1:87b5:c0dd with SMTP id q12-20020ad4574c000000b004b187b5c0ddmr16264499qvx.68.1665424636624; Mon, 10 Oct 2022 10:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665424636; cv=none; d=google.com; s=arc-20160816; b=ZWT8qD9kHi97vDf55mURRU+2dOx1p8QJdZcUFvJqhQjVbm1FdyblGku9SCCwZxhX0T c0RxQ9SE6isfQc7UjK6nkqdoYZnO0qtTvGgOgX2w2+oFg1JJjYHFfR9gCUJZpKJOw12q EOjtGfRuORqhAEzzhLsRTfCFY7imy7qJ3uyHmwapupPte1ITLU5DwMNc4bzH2MwzGnM5 PIXsYfBxp1Nyo/XXkW/2LWe7EDiTZwujKcOgJM4+1rg4usaI7R1S6TESeLDlWb4TYiki CdEuwgFYek3e8dl9QKpjTacrDGjGzglfM8zi8wYMlYJ/xfsgF5ntw5rF5AGSOYjH+0vu 6l/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7npCfBPJ3SU6f/b3cEDN5Cf+Lw7VA1jtIVngNbIXD3s=; b=QjtiJsmyDY9/nb8DgjPW+LGYqYkb0HdasoAe9OwgrRE///pHXQQzrJx3IukVJMQwZO tJeGJMmQoXw04KVtKaIhuNuBUtRl/kyUu1pPz8I/Rz6LsSoi9zVAt0LHPl0ek3Guy/o4 sBA2KO9cSN9FUvof8A3ejMMov2+fcklaI3Zwd+At42MORtTT9YrVVRfr9no5g8xbYaFi MykxRNsbHagjL2lW4dJYH+LnpV1pQzn8AMreHiJ90XU7V+HArBAfXyC+QnIKkHfrgsv4 N5IAxetGQ3/qnWSaPzvkYu1LUcowEbCdJmbiTRqfghukULfjcD6j04beZm/cDMUj4Nsr L68A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DkOFXOGL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t125-20020ae9df83000000b006e38697f537si5012795qkf.195.2022.10.10.10.57.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Oct 2022 10:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DkOFXOGL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:60958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohx1g-000767-5M for patch@linaro.org; Mon, 10 Oct 2022 13:57:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohwb9-0001Ys-Vo for qemu-devel@nongnu.org; Mon, 10 Oct 2022 13:29:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:60138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohwb0-0006b5-Ag for qemu-devel@nongnu.org; Mon, 10 Oct 2022 13:29:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665422981; 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=7npCfBPJ3SU6f/b3cEDN5Cf+Lw7VA1jtIVngNbIXD3s=; b=DkOFXOGLhGjKPS7FJLoVRtnf16aeARBM/W3VTy7opniRB1PYCX4US/Ji+YnvJ4S/O3IXHY YaQMkS8vfCls8jbmF9ZCA29NXX4k0u95zD/ZVwX33WyDxLesoCGIWpDayZusgwtz5GwaPx 89Tjn/BGWGqVMQrGCWYm+icbQxeF5SU= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-471-4TC5cJ_xNJaDYz2lcjLRGA-1; Mon, 10 Oct 2022 13:29:40 -0400 X-MC-Unique: 4TC5cJ_xNJaDYz2lcjLRGA-1 Received: by mail-wm1-f70.google.com with SMTP id f26-20020a7bcc1a000000b003c03db14864so3261411wmh.6 for ; Mon, 10 Oct 2022 10:29:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7npCfBPJ3SU6f/b3cEDN5Cf+Lw7VA1jtIVngNbIXD3s=; b=78Fo7r06OJHlTj/2fLihdFSwYSsDb6/sUWo5mXi+L4zGQr6J2BY6BvaFx+RA3xd3wU nc0ECxTRk6GY4IW5FvTcKgl+BoQvGxS4hnxCMy/D7wVlik8XpGgndjjZIz9ExYde3jZa /EUGMaTPU2i7cKx4ZqY2VMkZDfxJWnrKzvi/e8aoiZQisdVEHhS+K4p6PaOhfmaP0JCl 9serqI6a9zGq4K91DTiqFfjUkv1qDID57eOMFYmuy/weSRiWrL9lA6Lzx2vLI/mvk3Yr 3kGJU6upVJu+5bTqyc/JnYRwnEfFRWVUAdZ7t1NFWTrgUagqKTArZmanec2hwdK5WqeN ykfA== X-Gm-Message-State: ACrzQf1j9Cjim3zhrxj/DYh9gXJHpaX7I9Rck7TU9qkrKRefgzcizCom gilFFXW6Gyy8oNS52KM/5+sfEXVwiKD1zWED97oOwGQ5IQaD1vGLITM47jPkJOTJKkUR+QWamVn 1rAptoQ1A2UyEtlW8o7aSuSqVjYlwhD0RbxjYXLtVmoYAwOiUF5ubxoiiUAss X-Received: by 2002:adf:d1ec:0:b0:22e:3341:a8cb with SMTP id g12-20020adfd1ec000000b0022e3341a8cbmr11952006wrd.151.1665422978932; Mon, 10 Oct 2022 10:29:38 -0700 (PDT) X-Received: by 2002:adf:d1ec:0:b0:22e:3341:a8cb with SMTP id g12-20020adfd1ec000000b0022e3341a8cbmr11951984wrd.151.1665422978556; Mon, 10 Oct 2022 10:29:38 -0700 (PDT) Received: from redhat.com ([2.55.183.131]) by smtp.gmail.com with ESMTPSA id u16-20020adfdd50000000b002238ea5750csm11850269wrm.72.2022.10.10.10.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 10:29:38 -0700 (PDT) Date: Mon, 10 Oct 2022 13:29:34 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alex =?utf-8?q?Benn=C3=A9e?= , Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PULL 13/55] tests/qtest: use qos_printf instead of g_test_message Message-ID: <20221010172813.204597-14-mst@redhat.com> References: <20221010172813.204597-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221010172813.204597-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée The vhost-user tests respawn qos-test as a standalone process. As a result the gtester framework squashes all messages coming out of it which make it hard to debug. As the test does not care about asserting certain messages just convert the tests to use the direct qos_printf. Signed-off-by: Alex Bennée Message-Id: <20220802095010.3330793-17-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/qos-test.c | 5 +++++ tests/qtest/vhost-user-test.c | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/qtest/qos-test.c b/tests/qtest/qos-test.c index 566cb3b00b..5da4091ec3 100644 --- a/tests/qtest/qos-test.c +++ b/tests/qtest/qos-test.c @@ -321,6 +321,11 @@ static void walk_path(QOSGraphNode *orig_path, int len) int main(int argc, char **argv, char** envp) { g_test_init(&argc, &argv, NULL); + + if (g_test_subprocess()) { + qos_printf("qos_test running single test in subprocess\n"); + } + if (g_test_verbose()) { qos_printf("ENVIRONMENT VARIABLES: {\n"); for (char **env = envp; *env != 0; env++) { diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index 84498941a6..99dc6080e5 100644 --- a/tests/qtest/vhost-user-test.c +++ b/tests/qtest/vhost-user-test.c @@ -26,6 +26,7 @@ #include "libqos/virtio-pci.h" #include "libqos/malloc-pc.h" +#include "libqos/qgraph_internal.h" #include "hw/virtio/virtio-net.h" #include "standard-headers/linux/vhost_types.h" @@ -316,7 +317,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size) } if (size != VHOST_USER_HDR_SIZE) { - g_test_message("Wrong message size received %d", size); + qos_printf("%s: Wrong message size received %d\n", __func__, size); return; } @@ -327,8 +328,8 @@ static void chr_read(void *opaque, const uint8_t *buf, int size) p += VHOST_USER_HDR_SIZE; size = qemu_chr_fe_read_all(chr, p, msg.size); if (size != msg.size) { - g_test_message("Wrong message size received %d != %d", - size, msg.size); + qos_printf("%s: Wrong message size received %d != %d\n", + __func__, size, msg.size); return; } } @@ -450,7 +451,7 @@ static const char *init_hugepagefs(void) } if (access(path, R_OK | W_OK | X_OK)) { - g_test_message("access on path (%s): %s", path, strerror(errno)); + qos_printf("access on path (%s): %s", path, strerror(errno)); g_test_fail(); return NULL; } @@ -460,13 +461,13 @@ static const char *init_hugepagefs(void) } while (ret != 0 && errno == EINTR); if (ret != 0) { - g_test_message("statfs on path (%s): %s", path, strerror(errno)); + qos_printf("statfs on path (%s): %s", path, strerror(errno)); g_test_fail(); return NULL; } if (fs.f_type != HUGETLBFS_MAGIC) { - g_test_message("Warning: path not on HugeTLBFS: %s", path); + qos_printf("Warning: path not on HugeTLBFS: %s", path); g_test_fail(); return NULL; }