From patchwork Thu May 23 16:45:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13672056 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C0882C6B6; Thu, 23 May 2024 16:44:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716482698; cv=none; b=aGGY4gtKE2BsPs0yOjE2Zsie3DDjubwofm3VmEQYzdfCgUD1CFiNNFPkGKw1FgX9ro1C4o/Mg+f9CTiXXxji8Q/ByMucbZwwEXNs+XfR1cP0/vY+g25Bk1L1ukKPqKT9qrovfvGyryDDgvkBKfE4A7ED3KLTN+jN58HncCKsumo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716482698; c=relaxed/simple; bh=0tqQovrxEuibLPAzpAH/w232rjaoPyNb6yIOFTFXaY0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=O2MCZwGXKF1jS7cASbNTYKcZMIOGLuxLV3Zy95RDFlD/PMDRc6QelCcLSU16ToloIgirQDm0mvQ1JhtVVkTUOddoyTymEmxmNQalAi99QoNVgNxhY0iCAVrHP7OHjMT9rcttFzruXgLkV7z0mtXf3Y8L790ELy+Rtxe+RUH5AV4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CDC2C32782; Thu, 23 May 2024 16:44:56 +0000 (UTC) Date: Thu, 23 May 2024 12:45:41 -0400 From: Steven Rostedt To: LKML , Linux Trace Kernel Cc: Masami Hiramatsu , Mathieu Desnoyers , Ali Zahraee , Shuah Khan , Shuah Khan , linux-kselftest@vger.kernel.org, Linus Torvalds Subject: [PATCH] tracing/selftests: Run the ownership test twice Message-ID: <20240523124541.7dd4cca9@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Steven Rostedt (Google)" A regression happened where running the ownership test passes on the first iteration but fails running it a second time. This was caught and fixed, but a later change brought it back. The regression was missed because the automated tests only run the tests once per boot. Change the ownership test to iterate through the tests twice, as this will catch the regression with a single run. Signed-off-by: Steven Rostedt (Google) Acked-by: Masami Hiramatsu (Google) --- .../ftrace/test.d/00basic/test_ownership.tc | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc index c45094d1e1d2..71e43a92352a 100644 --- a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc +++ b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc @@ -83,32 +83,38 @@ run_tests() { done } -mount -o remount,"$new_options" . +# Run the tests twice as leftovers can cause issues +for loop in 1 2 ; do -run_tests + echo "Running iteration $loop" -mount -o remount,"$mount_options" . + mount -o remount,"$new_options" . -for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do - test "$d" $original_group -done + run_tests + + mount -o remount,"$mount_options" . + + for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do + test "$d" $original_group + done # check instances as well -chgrp $other_group instances + chgrp $other_group instances -instance="$(mktemp -u test-XXXXXX)" + instance="$(mktemp -u test-XXXXXX)" -mkdir instances/$instance + mkdir instances/$instance -cd instances/$instance + cd instances/$instance -run_tests + run_tests -cd ../.. + cd ../.. -rmdir instances/$instance + rmdir instances/$instance -chgrp $original_group instances + chgrp $original_group instances +done exit 0