From patchwork Tue Jul 26 19:21:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 593467 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b811:0:0:0:0 with SMTP id fc17csp3815578mab; Tue, 26 Jul 2022 12:23:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vFi76J5qyqWw5Mj+tlxyonXKv2exq3ceAjw33mfCfjgf+kXTmO7k63+aLeWqW5NAD5WKk+ X-Received: by 2002:a05:622a:1301:b0:31f:373e:b8b1 with SMTP id v1-20020a05622a130100b0031f373eb8b1mr9799075qtk.387.1658863439247; Tue, 26 Jul 2022 12:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658863439; cv=none; d=google.com; s=arc-20160816; b=KUe2kpzVDyTVGistSwL4bQqHIYi19vrgYBsmsgGvEQudj5/pqOwraoLvv11i47oHzt 7bql5HcTbBi6+3pGK/73AvyGdV9u7YTN+n+hffgBSWUpHhy5jXwxQslzdXfoHZwJez2W XLvxKmnqtBZpTK3cv6Mf8WExkRFZ3kbyqgK2cOvtdQGl3wi8ypcX6eTLpu9/AP3xS6Z9 sRSGMLD7JfuNCbDz2LHSYhI+b/gbuE0+1fNa7KNhezSmMgiiMInO7yI5TZvsYOCRFtIZ yUWMuCiG6nMu9vV7awOsIYfE0FaUAxGojp4tAuDNtYs3LGYObjbTJVlOH/seibjkuGeL 4aJQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rgdjLK+rHmGYzX+axfdcXU3cC80ktttNYMslWS8NxWI=; b=uK4jnKI7S9L+kLokTFzwgfw2QP/pdJ+7JNk/cZ/v99qFtIWoFef/Jr4gPFQkUrSvDk MO9sPIbNzCk414VYaP02V+lR6oJ4L1O6xSDRVSss2LkkOBzx5vQ7qL8NPRJkyvLOZp8M QvEShtltZ38IJnVLE5ScnkeySI8XQDZ0Eny6QcjBK+oGc9+lgI9knsw9fDW2I5WsBSEI 37+yfbQH+ZC8SWbkCE1k+XVx2X+PjSH2BPzu/K4xAB2F125AN2Iy8PL68RAm5R2qQSoy xpfQktsxU2c6kRVxEZz75Ui2V+O8wjbDRBwhuJaiiAm4/k5W7eKBVc0C6p7TdIHL6Tsg 3dpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bxqWqE5c; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k17-20020a05620a415100b006b59c3bdd88si11766413qko.243.2022.07.26.12.23.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jul 2022 12:23:59 -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=@linaro.org header.s=google header.b=bxqWqE5c; 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=linaro.org Received: from localhost ([::1]:53278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGQ9u-0003Nc-Nb for patch@linaro.org; Tue, 26 Jul 2022 15:23:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGQ8C-0003LR-DN for qemu-devel@nongnu.org; Tue, 26 Jul 2022 15:22:12 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:42996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGQ8A-0002OI-9Z for qemu-devel@nongnu.org; Tue, 26 Jul 2022 15:22:11 -0400 Received: by mail-wr1-x429.google.com with SMTP id bn9so10575923wrb.9 for ; Tue, 26 Jul 2022 12:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rgdjLK+rHmGYzX+axfdcXU3cC80ktttNYMslWS8NxWI=; b=bxqWqE5cdTZyQNhToMXoxCgKMRyOYgZEl/xoUkm3uBAbqW1J3E3JcxNGIFFCYcik8R v1an9MAOYZ+Py5I3CKXRsjGiorpPEd8/6MsNlXctQ3PkSEF/CNepV6nRBQDE+CfaL9kz AUQ++dbXJoMY8clgcu/WNQvdMrVqakcmMWlpRTo/CA8CCP6j9ihRLX0nTvgzUEEDnnfL L1x5g8fBiotXQxH/sXDG1CRofmRLH2o5tkcE8KVDyD965oFnGXvCZ/W0hsVZQBI2ac4b bI3FLNUGDL/DxTpbFmrjzVBZZqYQ1X26LnR4R00mQwvbj6nvEgN0zoleH2FFlSj1nI/t M2Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rgdjLK+rHmGYzX+axfdcXU3cC80ktttNYMslWS8NxWI=; b=RVigpPd0v0Xxi7yj3HlbIdibeDLLjcxGja8EIodUa9yOGtcgWnVHU7sEkzUpNLUECg 1DTqdgUZbrFOztmQZLvQGIq+dC8iB3fCDwrzzhGQm1FNBG8r2IW/rrmUvLP1vyVVUd5P RXyj68cGdY2LILVtL+7MzeDiVv4L3N5DTL4kldDX/KtmcJBMt2IQmx1W/xj7M1R6y/O1 vYr8XteUTP5XRUvrlyvYHMbiyW3DVRjDVpQV6kwK4YYqHefxoI0EcOdBRO65KwpPQgyr uQbWWSzDlwFhFHdR7BzECI1bZAgl3quXAhDq0ZTgd049AmL2dMd1VkjH9oiVfNWM6Vax ujzw== X-Gm-Message-State: AJIora9Byg8cb7jxinwofLhpGBopL7HwS3QFAr3krompXdlN46Ihx6cf yrklziDpHEkei+AG4ECCymhdqA== X-Received: by 2002:a5d:588d:0:b0:21d:a5d2:42d5 with SMTP id n13-20020a5d588d000000b0021da5d242d5mr11559128wrf.588.1658863328911; Tue, 26 Jul 2022 12:22:08 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id y7-20020adfe6c7000000b0021e4f595590sm15502588wrm.28.2022.07.26.12.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 12:21:59 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 919121FFC7; Tue, 26 Jul 2022 20:21:51 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: slp@redhat.com, mst@redhat.com, marcandre.lureau@redhat.com, stefanha@redhat.com, mathieu.poirier@linaro.org, viresh.kumar@linaro.org, mark.cave-ayland@ilande.co.uk, jasowang@redhat.com, =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PATCH v3 15/21] tests/qtest: use qos_printf instead of g_test_message Date: Tue, 26 Jul 2022 20:21:44 +0100 Message-Id: <20220726192150.2435175-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220726192150.2435175-1-alex.bennee@linaro.org> References: <20220726192150.2435175-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- 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 ac23def284..d0bdf06fad 100644 --- a/tests/qtest/qos-test.c +++ b/tests/qtest/qos-test.c @@ -320,6 +320,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 8bf390be20..968113d591 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; }