Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3286936rwb; Fri, 30 Sep 2022 01:02:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7t+dnAS3LIHMoNBPaOUgBl3kPNhmGuB9cGt+vDn2Qa5AlDzE+FEqTIub+V778d+g9oKKga X-Received: by 2002:a05:6402:524a:b0:450:bab6:cd5f with SMTP id t10-20020a056402524a00b00450bab6cd5fmr6922888edd.233.1664524953322; Fri, 30 Sep 2022 01:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664524953; cv=none; d=google.com; s=arc-20160816; b=AuI9L/7Lf+PajiDiUfub5ig8YcSrGqyWg8S+vPacENs/7wleSHRqsEyFeXykTtET4Z XJICBMF0x5XE6oikJZ9o7gCOxf0JhF22PxAQGrbREs0zcPadw2B8YkRQfnVoYpSq2qP4 40BUZF7Yh909sQ8mbkI6Q4ZrAbWrErPuujKS1Tj5EiMXEyWc0/cHwgKhp0QMfMIZLZ3R ia3k4IMBzngrQ6Z99vronbfTY8dPqXsiAQ2xsGKr8ch1ESzGO3dFVCGttr95Bnzd0bhF IYIBssVnR6njdV6B/iXPOr7xt6oXcMnH+jIDlYDQGF11qr+Pjzs9xdgHyKYMxX8Di+kM fmEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=NYn9c0t4GADZN7/1RI3vCT6AjLSvRbYKK8wBSQfkVCY=; b=vhrC/ktwgJL1N1ZaKmoWtOE7d64Kh7vOLGNxrIxEvNc398nfbfC6apGh12/CoWbiR8 ryHfkoS8Ql1+flg4OQGJZmRQ8IGdyYplxg68/MXsouAJMs/GazGBEMS7tPCWbfx96qko DGxY9i2MpFq8P9BJlEBmiQkwb4i+4smNvcjlbntZkZUeXVhhfJX2G4kg7qLGIZsKGbXp PMY5TlR5lb/BlUs2QxvFvJNofuM0jBO4eihyoVSOmq3sKRa+RuS5MOlLPaP58bjYs/2F PQ9tiplou3Ckj58rtxZYGS3eCQBKEOVaH/JvsfLb1yCCjwmgurIeyzK96vSrFn7bTdrF AjhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=mvhUc4ij; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a25-20020aa7cf19000000b00456f77e98acsi1517715edy.76.2022.09.30.01.02.06; Fri, 30 Sep 2022 01:02:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=mvhUc4ij; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230042AbiI3Gu7 (ORCPT + 99 others); Fri, 30 Sep 2022 02:50:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbiI3Gu4 (ORCPT ); Fri, 30 Sep 2022 02:50:56 -0400 Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52559BC456 for ; Thu, 29 Sep 2022 23:50:55 -0700 (PDT) Received: by mail-vk1-xa35.google.com with SMTP id e5so1797556vkg.6 for ; Thu, 29 Sep 2022 23:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=NYn9c0t4GADZN7/1RI3vCT6AjLSvRbYKK8wBSQfkVCY=; b=mvhUc4ijDrs0INQ4wl+zdmDxVbcAYxqCLhJ3w2MK4ZlbiGYWV9tRJT+ZBJAzxFjUnO zsieNRJ/3gXn0den4PnMqTp9dJ2LptlO+N75bH4LIcgRpHYw10pAgo1beJXaZMawr2rd UvMedNlytj0bNW9U3IOyI6YBmmCr2p34MoQrhZ+3MuR6QVGUL6KBAUwxkK7t7F5nl5bc crlRfdxYoByopF0jbV/nNoHynmly7sm7H7p5OMM9RIxStA0NGoKbBv1q5s9Ltsugnpvz gRFyowUx8wV0wZJWTQMoccG9u7FQMT/4QfxXCOsO8BfQovz6n/IvhdzBz9m4HrhF66XW wFPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=NYn9c0t4GADZN7/1RI3vCT6AjLSvRbYKK8wBSQfkVCY=; b=7qvT88WVNgVm6xTlMx4BwDzcfSpeBvLmCBf9o9fYcDjF+QaxyukPqMHKxslHIukyE8 QxUXEirlLNKuLo5hZsCTSkBAXYSJ9kZNwYdbn9OYgFJ0PIzve5lfQBsOxCUDQT4t3bdR YIHgoB0Yh6CGm3vj02n5pgNgm0pygYIXbrDhcD64fqHy7zgZScpPAMCvyD9a1gEVzK/h uaaZHlL0WOSzOrHUV1rWSbpU7Pd2fL/gPG7MvmEv+VdmIQeO2yHfGxl0DPNI9ug9LUeK DDpFQHv4gLa3zh5e9fB9FVV2sLakbyWLRnLFqaGCbGsQu74nFRVROttsqELpMoFMkk3y jGmw== X-Gm-Message-State: ACrzQf22kq4KDkEpOkzd7fn/EjRMbV5HsoPUVWDmRbefSDZzKNlnv56O Pdg/R6X9Hs5M8S2SbJvoa4pdHcfp0HXjNvQRvzKV7g== X-Received: by 2002:a1f:a788:0:b0:3a1:e690:a2a3 with SMTP id q130-20020a1fa788000000b003a1e690a2a3mr3625477vke.4.1664520654348; Thu, 29 Sep 2022 23:50:54 -0700 (PDT) MIME-Version: 1.0 References: <20220927221206.55930-1-mcanal@igalia.com> <20220927221206.55930-2-mcanal@igalia.com> <20220929223333.vh6wy45mfx6kccds@nostramo> In-Reply-To: <20220929223333.vh6wy45mfx6kccds@nostramo> From: David Gow Date: Fri, 30 Sep 2022 14:50:43 +0800 Message-ID: Subject: Re: [PATCH v2 2/2] drm/tests: Split drm_test_dp_mst_sideband_msg_req_decode into parameterized tests To: =?UTF-8?Q?Micha=C5=82_Winiarski?= Cc: =?UTF-8?B?TWHDrXJhIENhbmFs?= , David Airlie , Daniel Vetter , Melissa Wen , =?UTF-8?Q?Andr=C3=A9_Almeida?= , Javier Martinez Canillas , Daniel Latypov , Arthur Grillo , Isabella Basso , magalilemes00@gmail.com, Tales Aparecida , dri-devel@lists.freedesktop.org, Linux Kernel Mailing List Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000057b24105e9df6aba" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000057b24105e9df6aba Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Sep 30, 2022 at 6:33 AM Micha=C5=82 Winiarski wrote: > > On Tue, Sep 27, 2022 at 07:12:06PM -0300, Ma=C3=ADra Canal wrote: > > The drm_test_dp_mst_sideband_msg_req_decode repeats the same test > > structure with different parameters. This could be better represented > > by parameterized tests, provided by KUnit. > > > > In order to convert the tests to parameterized tests, the test case for > > the client ID was changed: instead of using get_random_bytes to generat= e > > the client ID, the client ID is now hardcoded in the test case. > > Generally "random" usage is not incompatible with parameterized tests, we= can > create parameterized tests that use random data. > The idea is to pass a function that generates the actual param (where we = have a > pointer to function as one of the members in "params" struct). > > For example, see "random_dp_query_enc_client_id" usage here: > https://lore.kernel.org/dri-devel/20220117232259.180459-7-michal.winiarsk= i@intel.com/ > > In this case, we just compare data going in with data going out (and the = data > itself is not transformed in any way), so it doesn't really matter for co= verage > and we can hardcode. > > -Micha=C5=82 FWIW, while the uses of randomness in DRM tests so far haven't concerned me much, I think we'll eventually want to have some way of ensuring the inputs to tests are deterministic. My thoughts are that (at some point) we'll add a kunit_random() function or similar, which will use a pseudorandom number generator which can be set to a deterministic seed before each test case. That way, there'd be a way to reproduce an error easily if it occurred. (Of course, there'd be a way of setting different or random seeds to preserve the extra coverage you'd otherwise get.) I don't think this is something worth holding up or changing existing tests at the moment, but having tests behave deterministically is definitely desirable, so +1 to avoiding get_random_bytes() if it's not giving you any real benefit. We've also had a few requests in the past for being able to pass in a custom set of parameters from userspace, which opens up some other interesting possibilities, though it's not a priority at the moment. Cheers, -- David --00000000000057b24105e9df6aba Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIPnwYJKoZIhvcNAQcCoIIPkDCCD4wCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg ggz5MIIEtjCCA56gAwIBAgIQeAMYYHb81ngUVR0WyMTzqzANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBE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