From nobody Sun May 12 11:00:44 2024 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1669059837; cv=none; d=zohomail.com; s=zohoarc; b=HP+Aw4X8TCxMZuBjd5Om0eM8GbTAwoo8oSV5rXIA70luyboQEwnUP0DLyDPnB/G7kHUUCngIwRWcCinySh2IYu2NCe5ZUREvRORUtKvy2ceTWfktm2U8SM2TgDE6lAY8iLifeNCD1NgkLz3mqTBlkJpTMqtiemTfE+gunNm/+jo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669059837; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=dhy/cmS42lbR5GBWEE2S2PG2ZP1E/PaHgpxMKojSwZs=; b=BpDXYeCs2pecRJ83WFe+HTMp2iDGznJIwh8aZDtQBzuwSvVNuSyias1ra2CRF0VImgS2U+RxYzFH9TTmea61TIRlX7iX7cfFMs6UINAWeJs6KSE3sa2Ul3CoNi9s4vsu4lDXfogsaGWkBqtvFXUs2GeHQAIGBCuA+YLPR9POXyA= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1669059837504767.823660323022; Mon, 21 Nov 2022 11:43:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxCh7-0004TA-MD; Mon, 21 Nov 2022 14:43:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxCh5-0004Rs-8N for qemu-devel@nongnu.org; Mon, 21 Nov 2022 14:43:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxCh3-00057m-23 for qemu-devel@nongnu.org; Mon, 21 Nov 2022 14:43:02 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-580-uqtz-HHJM7q-TfL9s9syRg-1; Mon, 21 Nov 2022 14:42:56 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7C457101A54E; Mon, 21 Nov 2022 19:42:56 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1FA80492B18; Mon, 21 Nov 2022 19:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669059779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dhy/cmS42lbR5GBWEE2S2PG2ZP1E/PaHgpxMKojSwZs=; b=GZ7/Rg/Yb32N1CvLlbstWeyhuX+xS87CIl1/KUcjd1NgDFnQkMunN1p5ebm7gGsJLwQ7Qi ouotzYXHloWH0SsHs7amQ1gZFWeGp9Gme8CMJUdQMHRdB2loLa9Iob2eA3BScn3dVk114E rrzJy4DgKfUiZWGoNMFC3NsROA/6rLI= X-MC-Unique: uqtz-HHJM7q-TfL9s9syRg-1 From: Thomas Huth To: Paolo Bonzini , qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Stefan Hajnoczi , Peter Maydell Subject: [PATCH] tests/qtest: Decrease the amount of output from the qom-test Date: Mon, 21 Nov 2022 20:42:40 +0100 Message-Id: <20221121194240.149268-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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: 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1669059838368100001 Content-Type: text/plain; charset="utf-8" The logs in the gitlab-CI have a size constraint, and sometimes we already hit this limit. The biggest part of the log then seems to be filled by the qom-test, so we should decrease the size of the output - which can be done easily by not printing the path for each property, since the path has already been logged at the beginning of each node that we handle here. However, if we omit the path, we should make sure to not recurse into child nodes in between, so that it is clear to which node each property belongs. Thus store the children and links in a temporary list and recurse only at the end of each node, when all properties have already been printed. Signed-off-by: Thomas Huth Reviewed-by: Stefan Hajnoczi --- See e.g. here for a log that got too big: https://gitlab.com/qemu-project/qemu/-/jobs/3355901224 tests/qtest/qom-test.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c index 7b871b2a31..13510bc349 100644 --- a/tests/qtest/qom-test.c +++ b/tests/qtest/qom-test.c @@ -20,6 +20,7 @@ static void test_properties(QTestState *qts, const char *= path, bool recurse) QDict *response, *tuple, *tmp; QList *list; QListEntry *entry; + GSList *children =3D NULL, *links =3D NULL; =20 g_test_message("Obtaining properties of %s", path); response =3D qtest_qmp(qts, "{ 'execute': 'qom-list'," @@ -41,11 +42,14 @@ static void test_properties(QTestState *qts, const char= *path, bool recurse) if (is_child || is_link) { child_path =3D g_strdup_printf("%s/%s", path, qdict_get_str(tuple, "name"= )); - test_properties(qts, child_path, is_child); - g_free(child_path); + if (is_child) { + children =3D g_slist_prepend(children, child_path); + } else { + links =3D g_slist_prepend(links, child_path); + } } else { const char *prop =3D qdict_get_str(tuple, "name"); - g_test_message("Testing property %s.%s", path, prop); + g_test_message("-> %s", prop); tmp =3D qtest_qmp(qts, "{ 'execute': 'qom-get'," " 'arguments': { 'path': %s, 'property': %s }= }", @@ -55,6 +59,18 @@ static void test_properties(QTestState *qts, const char = *path, bool recurse) qobject_unref(tmp); } } + + while (links) { + test_properties(qts, links->data, false); + g_free(links->data); + links =3D g_slist_delete_link(links, links); + } + while (children) { + test_properties(qts, children->data, true); + g_free(children->data); + children =3D g_slist_delete_link(children, children); + } + qobject_unref(response); } =20 --=20 2.31.1