Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2243972rbb; Tue, 27 Feb 2024 16:04:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVNT/HlHnK+vDnZZ2BE7jPYbaQg3S96Ej5Vuy5OPuJvmhYh4ymq/Wdx1IKJ1QMQ3EhE6F59xljhghoRFz3zfqfnVQLi5HPvw/KCjLIDPg== X-Google-Smtp-Source: AGHT+IHTYJ/c+HdXY3PBpaORHs7hMp3h/KE/YjJzmYAURuuL/zDoSYO6fb9gv3vcCKF2d59BVw/i X-Received: by 2002:a17:903:246:b0:1dc:1e7c:cd3 with SMTP id j6-20020a170903024600b001dc1e7c0cd3mr12768594plh.47.1709078655453; Tue, 27 Feb 2024 16:04:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709078655; cv=pass; d=google.com; s=arc-20160816; b=lDfwVmuWbBVmf4qmO9k3ADH5eauglDDnACpT/5Vb6qXXcoZ3NHdo+wtRmYeIonHL4U HOveGm1hUD0HTkVwFlpvUmZWOOBs6CHoezEdy5gF3KNQozdldQRkMh6oJkyrJj25AYt5 d6Yx7b7wog9wQCagdVGVBSLG0PuPKJt7lbxGMZYiBrGR8TRtCjgIDPMAMWRLiA0wrHRl AT8jwdbeKKPidiHXcUuYo9l1W1McYg/1/iA4Ddvmf4xIz5JomTO6LkmbwNTRc00HBKSv 59+Xz7clIfaxYTsj0odWUnZJ4mIqXiLGfyJCJyXh0GiT8Yagh/ZbR/whtEisuRNwvBbj nOVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=vrK0eALq3CiAPH0N0ru8YW+DX4foq/ClBC0Geu6EPXo=; fh=/XKxfMCCPOT6mHwj28PNH8WBP7Bz0/MsZlugwEpJGSU=; b=owofD5/Gc4uGNU8nTdi0hkXyiS7l7sLrfueVkXl0lE4E59v+dH+gnJZa0+cODOm70O EeJBv1Ze4A/WVlr+1aP6u0FsjSQOLHa1d/aqCin+mC42+BKdsRKxWJvOrquOp4BuixwR V9VUHMTeDf6RaLxD/qYq9jvxK4bU47+v4fscTpasSOUnuKRl0YR7LNN7f5KzdiHprM7y nQbFaIdPtcS/1hYnrB49PzcoD4YKL+ch/+fHCYfgnzWhtDygRUoTgdsEgJZenCy9x+hy XNDSrIIZlDJDX/S2x0lh7DEDQznhPVHe6VMzBhjpV7miP/HYJ25TfMHJ98JqsDA4dCnF C7vQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=faslrYAr; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-84253-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84253-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q10-20020a170902daca00b001dcc161bcccsi1268488plx.368.2024.02.27.16.04.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 16:04:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84253-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=faslrYAr; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-84253-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84253-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B56F62822A9 for ; Wed, 28 Feb 2024 00:03:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA7F53C3C; Wed, 28 Feb 2024 00:01:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="faslrYAr" Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E2A123BD for ; Wed, 28 Feb 2024 00:01:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709078515; cv=none; b=RMuPt3N5chDoLQ2NnDDski/XPIV+1NlvIKZfOJcGBWlUqzjVxzZrs+KYx1iUCXzKjPWqX2T8bscXb1qvxTOr12emq8qY/ZDFMLeq62w+l3/+q2aXeQaVaDXaHGYLEAwkGhdRT73mXWZEseZfVOB5Y0YorUOefLvLhOHb1o9LE20= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709078515; c=relaxed/simple; bh=rJMJ2JMyWN+ZP1wfxJ61M7N5IzMgg95FlXOlFyiqAPY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=C4Jxp6w2kKDHwkR5YIJ8yYjg7l0NTHZ0/jJbjr623EmzzWfY3vFZClKgUjqbJU4FBXE1vISYJ/pBMeymsjHSJheGsnxivXdOApFUFxDKjkZmsKCs4kMzLw7Qltdq7vleq2EGnrKapUXBPoARjkaADWg9GV/6fMK2Va9WfNQxIfo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=faslrYAr; arc=none smtp.client-ip=209.85.166.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-365b413549eso948165ab.1 for ; Tue, 27 Feb 2024 16:01:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1709078512; x=1709683312; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vrK0eALq3CiAPH0N0ru8YW+DX4foq/ClBC0Geu6EPXo=; b=faslrYArGMUqphsHkdlrHW/26xGTlMIR+96BZYXQhsldVZryx8KimdmxYD1Uoqs3eu Ny1xe1jgzny6QGwgH6ppwp1DGdyYGaZsb8iRKJh5KerpZUFCIsdCMrVq/n73IjpOEmB8 7M+V/fDIthXhle7+Bwyuxnqh+Z7XI5zJ7NMIo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709078512; x=1709683312; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vrK0eALq3CiAPH0N0ru8YW+DX4foq/ClBC0Geu6EPXo=; b=oGk6KaLA4Pn83Cr7xoGr5BfBwCus4GBZVKZ36n1isOMLCmhE38ean9queizWPvysfM e07rQglNdry+M//5AQUJUPutM/EGyBJ9aX3L93IYLmGS+Q8yn0m1oik4i4vQ6R5aR7Wz je7eJdJYPeE5knrIKJA0J74CVkMf6M3NQmlenAnxS1X6SjsrU4tMJWExUhknJNC2Vq2o nsi6J3WscEi+JH7w1TfPjWP4nKB+Bzc5b1OFiT9SzfScZjy5X40qF90LhAFZ3XcsgG// Jc7P2yBnCLJheAG49ip0izN9F0FioXmfysBqdg7CoeEcETo8MluFOO+xqmPGXrOGfCUG TsNg== X-Forwarded-Encrypted: i=1; AJvYcCUTdRq65cCv9sH2Pm/2kUt51LzUqJ2YlvMnfGEMxNwRibPptedkFZLidjcif0YuMFu77SARIgmRaUFKIcui9KUFF27KBVMJ+BaInE8b X-Gm-Message-State: AOJu0YwK7B/aNy7UL7k8w7izSRLaC61Iu4em9u3Ni2lUO8yhy00KaMTW xwwK9cI6Cm0uGiq6LNEa6yC5NPiqoGCaNgcZSSuhtrJUuzNwR1I+FHHsFsSg5A4= X-Received: by 2002:a6b:7e08:0:b0:7c7:f5ce:5d9b with SMTP id i8-20020a6b7e08000000b007c7f5ce5d9bmr797781iom.1.1709078512072; Tue, 27 Feb 2024 16:01:52 -0800 (PST) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id s9-20020a6bdc09000000b007c76a2d6a98sm1947667ioc.53.2024.02.27.16.01.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Feb 2024 16:01:51 -0800 (PST) Message-ID: <5df7d5b1-1387-41f5-a9e9-29c9aefa448e@linuxfoundation.org> Date: Tue, 27 Feb 2024 17:01:50 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] kselftest: Add basic test for probing the rust sample modules Content-Language: en-US To: Laura Nao , ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com, shuah@kernel.org Cc: usama.anjum@collabora.com, a.hindborg@samsung.com, aliceryhl@google.com, benno.lossin@proton.me, bjorn3_gh@protonmail.com, boqun.feng@gmail.com, gary@garyguo.net, kernel@collabora.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, rust-for-linux@vger.kernel.org, kernel@valentinobst.de, Sergio Gonzalez Collado , Shuah Khan References: <20240226101646.291337-1-laura.nao@collabora.com> From: Shuah Khan In-Reply-To: <20240226101646.291337-1-laura.nao@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Laura, On 2/26/24 03:16, Laura Nao wrote: > Add new basic kselftest that checks if the available rust sample modules > can be added and removed correctly. > > Signed-off-by: Laura Nao > Reviewed-by: Sergio Gonzalez Collado > Reviewed-by: Muhammad Usama Anjum > --- > Depends on: > - https://lore.kernel.org/all/20240102141528.169947-1-laura.nao@collabora.com/T/#u > - https://lore.kernel.org/all/20240131-ktap-sh-helpers-extend-v1-0-98ffb468712c@collabora.com/ > Changes in v4: > - Added config file > Changes in v3: > - Removed useless KSFT_PASS, KSFT_FAIL, KSFT_SKIP constants > - Used ktap_finished to print the results summary and handle the return code > Changes in v2: > - Added missing SPDX line > - Edited test_probe_samples.sh script to use the common KTAP helpers file > --- > MAINTAINERS | 1 + > tools/testing/selftests/Makefile | 1 + > tools/testing/selftests/rust/Makefile | 4 +++ > tools/testing/selftests/rust/config | 5 +++ > .../selftests/rust/test_probe_samples.sh | 34 +++++++++++++++++++ > 5 files changed, 45 insertions(+) > create mode 100644 tools/testing/selftests/rust/Makefile > create mode 100644 tools/testing/selftests/rust/config > create mode 100755 tools/testing/selftests/rust/test_probe_samples.sh > I ran test again and I still see the same. I would like to see the script to handle error conditions. > diff --git a/MAINTAINERS b/MAINTAINERS > > + > +DIR="$(dirname "$(readlink -f "$0")")" > + > +source "${DIR}"/../kselftest/ktap_helpers.sh It tries to source and keeps going. Why can't we test for the file to exist and skip gracefully without printing the following messages. ./test_probe_samples.sh: line 12: /linux/linux_6.8/tools/testing/selftests/rust/../kselftest/ktap_helpers.sh: No such file or director # ./test_probe_samples.sh: line 16: ktap_print_header: command not found # ./test_probe_samples.sh: line 18: ktap_set_plan: command not found # ./test_probe_samples.sh: line 22: ktap_test_skip: command not found # ./test_probe_samples.sh: line 22: ktap_test_skip: command not found # ./test_probe_samples.sh: line 34: ktap_finished: command not found not ok 1 selftests: rust: test_probe_samples.sh # exit=127 > + > +rust_sample_modules=("rust_minimal" "rust_print") > + > +ktap_print_header > + > +ktap_set_plan "${#rust_sample_modules[@]}" > + > +for sample in "${rust_sample_modules[@]}"; do > + if ! /sbin/modprobe -n -q "$sample"; then > + ktap_test_skip "module $sample is not found in /lib/modules/$(uname -r)" > + continue Why are we continuing here? Isn't this skip condition? > + fi > + > + if /sbin/modprobe -q "$sample"; then > + /sbin/modprobe -q -r "$sample" > + ktap_test_pass "$sample" > + else > + ktap_test_fail "$sample" > + fi > +done > + > +ktap_finished I would like to see the test exit with skip code when RUST isn't enabled. Please refer to existing tests that do this properly. thanks, -- Shuah