From patchwork Thu Jul 9 17:48:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 138838 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 31BAF4BA2E07 for ; Thu, 9 Jul 2026 17:50:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31BAF4BA2E07 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=LR4Uk7Ad X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by sourceware.org (Postfix) with ESMTPS id 158204BA23D0 for ; Thu, 9 Jul 2026 17:50:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 158204BA23D0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 158204BA23D0 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1036 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783619410; cv=none; b=xVG8KZsbbDg9bCjnp5vRD0Kd/U55PSHMBxzf/KO3bWkE7lBcKvglYHFh+vtqImfjqIwEnKd6OUtKb7sIl758L/XUgCJkpittJHrihY5iZQXo2i0ZbcbUUd4nZQNd8d40xRhv4EyxzQ37Ri26czm3cDvDwlT5hoBxp5bk4vnMhds= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783619410; c=relaxed/simple; bh=/uxyqHY/jCEotZRz6zXSHPaYvl5KMofK0FRCEWs+RtI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=MelCc+YJEAkT0nVCgm7Z7jZe/ns7mgf22WfuE0u0fY2infB5bvjckbF28uTBKY8n8z/pyDyV+gYzXM+AEgDSitumwdcG/N13NLz8/hHqTYQDqHQetUAMZRXbCLqMIen9Zus/3gDiyBLc2gsTmNhrzYyXEmP7GRkX/30N3lWC2WQ= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=LR4Uk7Ad DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 158204BA23D0 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-38759bcd877so145427a91.2 for ; Thu, 09 Jul 2026 10:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783619409; x=1784224209; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=nd+3JD+B0WBVcr/jDndKxkDvg20E16cPB7s8AAFXOpg=; b=LR4Uk7Ad7LO0eNUUeEyoYvmCyo6ZIU7lpSpPg8obTb6jrpmTC4HsBj3ClSTh9rVhAe 42icGbl8R6Ajz/Zi567LucyydRKtP4Wc+ilYUY77Eo0Dc7tBLwPRyKwKhU3n6q4wqFKs WXTxfnKi0VDxruRALECy3dg2TlPUosH07dRyFbgIyLeBHFsOP7MItbSn1zdv8K5m0IWL gjJLfmVBtzj0H1WNj8NOuu8n8XF+brSqXjzD18zt4YCBwGBlptK8EOuDlJBIjsSQCKpl kY8BBqeNMPwuXWnDfwrNC5uD7S+eGCGuikgjlE2QmWtD2gSamtthL0eBuF7khLiYy+Zm VnUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783619409; x=1784224209; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=nd+3JD+B0WBVcr/jDndKxkDvg20E16cPB7s8AAFXOpg=; b=pwc+t089h8eYNl+8SKARhaC6MxMHNOIAqq6HoO1IhA7oq19GAfjrL5SXT2mlTIvoHX I0wfMrnR25kTzo2ImxjS8l6Zv2WCOXshxsb2biRcUVFs3kBDn11IPaGOvy4OzuTO5Yrs hBZ46XCf/cfqhRwHXezcP3aiWOzt9eiDhTVdwACz4oLVOK/bV0Cy+esDdxHwI71cUsmf XhArb5Q53my/WwhXGHpCmnFSIezkryrGnFG5xvNKSwQ8DyBKZdhvUlZhhkfekAZgtW3n PIQmMB4OUnBieP9wqr/S7UmUeSs4JV84h545gUuceF4kHd1WGFPjbBRrDiXja81POz8c 6iYg== X-Gm-Message-State: AOJu0YxwLiLWzsf9g831uFhIYdaNQDkRCoUqeba5OBY1kVqPg/Rnc78X V+tIOd+NYq70N7QBk2FAH1bhC+6b7TAGDgzypnXWac1Yz1vplfIo0THwd5wKnJCuceL/md3oCWH 3T4Cw X-Gm-Gg: AfdE7ck2dZ6WUqWpbpZkzG9qtbOGRJdnnVV3s1T7Fbi+wmDWWAFDREY36EaNejjuF2j wg1+rfBUeM8ScLe/hjy9bUt09Us7ZAPZlMAwWJHCkEsPqieZuJyQ6CGzH35I56tnJKT1+lhKEsn jywp4CgstwjwbFyIRp1tCpxaRZyRkBFI3W4+O8B4NmG0hQI/Ie6oPuXRv0ibBUkJA07kd2+Eo6S GHvKzfMHOPD6mzXUh2gT5ZCUZHiftuUn7MQzLSLqIuF6LgNwCODEgqffNxbeUHbRpBqGZH6PeK4 VK/1baWQ3KQ2+ZX0HCtCBVJEYeDv3ElRkT7K/WeFBb6hk1Kd15RnPqZrZiqAZGmonTjgKms0uM1 f2sx8/6Wqz7/oAEhn5ZgTSqaueyvTbg1+4qxuMxGQO4EryjllXNIvVZCgeOS6znUU/POoRYtVM8 qj6osM/Y6DVWLsylWOZiOlrRa5xGJ/kf6ILRc= X-Received: by 2002:a17:90b:2f88:b0:36a:c4b:76cf with SMTP id 98e67ed59e1d1-38941acc562mr9085521a91.23.1783619408908; Thu, 09 Jul 2026 10:50:08 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c2:2485:88d2:edd6:52d6:462d]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311950eb930sm17377902eec.8.2026.07.09.10.50.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 10:50:08 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 5/6] resolv: Make tst-resolv-qtypes a regular test Date: Thu, 9 Jul 2026 14:48:18 -0300 Message-ID: <20260709174957.670741-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260709174957.670741-1-adhemerval.zanella@linaro.org> References: <20260709174957.670741-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org The record type is an opaque 16-bit value on the query path, so sweeping all 1..65535 values sent millions of packets with no added coverage over a representative sample. Test a curated set instead and move it out of xtests. --- resolv/Makefile | 4 +--- resolv/tst-resolv-qtypes.c | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/resolv/Makefile b/resolv/Makefile index 28f6ba6c3b5..73983eb13c3 100644 --- a/resolv/Makefile +++ b/resolv/Makefile @@ -123,6 +123,7 @@ tests += \ tst-resolv-noaaaa \ tst-resolv-noaaaa-vc \ tst-resolv-nondecimal \ + tst-resolv-qtypes \ tst-resolv-res_init-failure \ tst-resolv-res_init-multi \ tst-resolv-search \ @@ -184,9 +185,6 @@ ifeq ($(have-GLIBC_2.26)$(build-shared),yesyes) tests += tst-p_secstodate endif -# This test sends millions of packets and is rather slow. -xtests += tst-resolv-qtypes - # This test has dropped packet tests and runs for a long time. xtests += tst-resolv-rotate endif # $(have-thread-library) diff --git a/resolv/tst-resolv-qtypes.c b/resolv/tst-resolv-qtypes.c index f2f97a334ee..69588748afe 100644 --- a/resolv/tst-resolv-qtypes.c +++ b/resolv/tst-resolv-qtypes.c @@ -16,6 +16,7 @@ License along with the GNU C Library; if not, see . */ +#include #include #include #include @@ -29,6 +30,18 @@ over TCP instead of UDP. */ static volatile bool force_tcp; +/* The record type is an opaque 16-bit value on the query path, so this + representative sample (low values, well-known and meta record types, + and values around the 8-bit and 16-bit boundaries) exercises the same + code as the full 1..65535 range at a fraction of the cost. */ +static const int qtypes[] = + { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 28, 33, 35, 39, 41, 43, 46, 47, 48, 52, 99, 108, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 511, 512, 1000, 4096, 32767, 32768, + 32769, 65534, 65535, + }; + /* Send back a fake resource record matching the QTYPE. */ static void response (const struct resolv_response_context *ctx, @@ -133,8 +146,9 @@ test_function (const char *fname, for (int tcp = 0; tcp < 2; ++tcp) { force_tcp = tcp; - for (unsigned int type = 1; type <= 65535; ++type) + for (size_t i = 0; i < array_length (qtypes); ++i) { + unsigned int type = qtypes[i]; if (test_verbose) printf ("info: sending QTYPE %d with %s (tcp=%d)\n", type, fname, tcp); @@ -181,5 +195,4 @@ do_test (void) return 0; } -#define TIMEOUT 300 #include