public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: linux-rt-users <linux-rt-users@vger.kernel.org>
Cc: Clark Williams <williams@redhat.com>,
	"John B. Wyatt IV" <jwyatt@redhat.com>,
	"John B. Wyatt IV" <sageofredondo@gmail.com>,
	John Kacur <jkacur@redhat.com>
Subject: [PATCH 18/23] tuna: Remove broken testuna
Date: Fri,  7 Nov 2025 13:57:27 -0500	[thread overview]
Message-ID: <20251107185732.23992-19-jkacur@redhat.com> (raw)
In-Reply-To: <20251107185732.23992-1-jkacur@redhat.com>

From: "John B. Wyatt IV" <jwyatt@redhat.com>

This script relies on the older, incompatible Tuna syntax, and
rtctl which is no longer packaged for most distributions. No one
has complained so remove it since the changes to update it would
be extensive with no users.

Signed-off-by: John B. Wyatt IV <jwyatt@redhat.com>
Signed-off-by: John B. Wyatt IV <sageofredondo@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
 testuna | 230 --------------------------------------------------------
 1 file changed, 230 deletions(-)
 delete mode 100755 testuna

diff --git a/testuna b/testuna
deleted file mode 100755
index cb98640c0167..000000000000
--- a/testuna
+++ /dev/null
@@ -1,230 +0,0 @@
-#!/bin/bash
-# Regression tests for tuna
-# (c) 2008 Red Hat Inc.
-# Arnaldo Carvalho de Melo <acme@redhat.com>
-# SPDX-License-Identifier: GPL-2.0-only
-
-dprint() {
-	[ -n "$VERBOSE" ] && echo $1
-}
-
-ktpidof() {
-	echo $(ps ax -To pid,cmd | grep "\[$1.*\]" | head -1 | cut -d'[' -f 1)
-}
-
-get_rtprio() {
-	echo $(chrt -p $1 | grep priority | cut -d ':' -f 2)
-}
-
-get_policy() {
-	echo $(chrt -p $1 | grep policy | cut -d ':' -f 2)
-}
-
-get_affinity() {
-	echo $(taskset -p $1 | grep 'current affinity' | cut -d ':' -f 2)
-}
-
-get_nr_processors() {
-	echo $(grep -i "^processor.*: " /proc/cpuinfo | tail -1 | cut -d ':' -f 2)
-}
-
-get_nr_cpu_sockets() {
-	echo $(grep "^physical id" /proc/cpuinfo | cut -d: -f2 | sort -u | wc -l)
-}
-
-die() {
-	[ -z "$VERBOSE" ] && echo -n "$2: "
-	echo $1
-	rtctl --file $INITIAL reset
-	taskset -p $INITIAL_INIT_AFFINITY 1 > /dev/null
-	rm -rf $TESTUNA_DIR
-	exit 1
-}
-
-die_with_a_diff() {
-	[ -n "$VERBOSE" ] && diff -u $INITIAL $NEW
-	die "$1"
-}
-
-tuna_save() {
-	tuna --save $TEMPCONF
-	grep -v '^# rtctl --file ' $TEMPCONF > $1
-	rm -f $TEMPCONF
-}
-
-die_if_not_saved() {
-	dprint "$2"
-	tuna_save $NEW
-	(diff -u $INITIAL $NEW | diffstat | \
-	grep -q "[ \t]*1 file changed, $1 insertions*(+), $1 deletions*(-)") ||
-	die_with_a_diff 'FAILED!' "$2"
-}
-
-die_if_conf_changed() {
-	dprint "$1"
-	tuna_save $NEW
-	diff -qu $INITIAL $NEW > /dev/null || die_with_a_diff 'FAILED!' "$1":
-}
-
-die_if_zero() {
-	dprint "$2"
-	[ $1 -eq 0 ] && die 'FAILED!' "$2"
-}
-
-die_if_not_zero() {
-	dprint "$2"
-	[ $1 -ne 0 ] && die 'FAILED!' "$2"
-}
-
-die_if_not_equal() {
-	dprint "$3"
-	[ $1 -ne $2 ] && die 'FAILED!' "$3"
-}
-
-die_if_not_str_equal() {
-	dprint "$3"
-	[ $1 != $2 ] && die 'FAILED!' "$3"
-}
-
-TESTUNA_DIR=$(mktemp -d -t testuna.XXXXXX) || exit 1
-INITIAL=$TESTUNA_DIR/initial.tuna
-INITIAL_INIT_AFFINITY=$(get_affinity 1)
-TEMPCONF=$TESTUNA_DIR/tempnew.tuna
-NEW=$TESTUNA_DIR/new.tuna
-
-[ $# -eq 1 ] && VERBOSE=1
-
-dprint "Saving initial configuration"
-
-tuna_save $INITIAL
-
-TUNA_RPM_VERSION=$(rpm -q --qf "%{version}\n" tuna)
-TUNA_BIN_VERSION=$(tuna --version)
-die_if_not_str_equal "$TUNA_RPM_VERSION" "$TUNA_BIN_VERSION" \
-	"Verifying --version ($TUNA_BIN_VERSION) matches package version ($TUNA_RPM_VERSION)"
-
-rtctl --file $INITIAL reset
-
-die_if_conf_changed "Replaying initial config"
-
-PID=$(ktpidof "watchdog")
-RTPRIO=$(get_rtprio $PID)
-POLICY=$(get_policy $PID)
-POLICY=$(echo ${POLICY:6:1} | tr 'A-Z' 'a-z')
-chrt -$POLICY -p $((RTPRIO - 1)) $PID
-
-die_if_not_saved 1 'Saving changes to a kernel thread priority'
-
-chrt -$POLICY -p $RTPRIO $PID
-
-die_if_conf_changed 'Restoring kernel thread priority'
-
-new_policy=$(echo $POLICY | tr fr rf)
-
-chrt -$new_policy -p $RTPRIO $PID
-
-die_if_not_saved 1 'Changing kernel thread sched policy'
-
-chrt -$POLICY -p $RTPRIO $PID
-
-die_if_conf_changed 'Restoring kernel thread sched policy'
-
-PID=$(ktpidof "kthreadd")
-AFFINITY=$(get_affinity $PID)
-
-taskset -p 0x2 $PID > /dev/null
-
-die_if_not_saved 1 'Changing kernel thread SMP affinity mask'
-
-taskset -p $AFFINITY $PID > /dev/null
-
-die_if_conf_changed 'Restoring kernel thread SMP affinity mask'
-
-NR_PROCESSORS=$(get_nr_processors)
-for PROCESSOR in $(seq 0 $NR_PROCESSORS) ; do
-	taskset -p 0xff 1 > /dev/null
-
-	PROCESSOR_AFFINITY=$(printf "%#x\n" $((1 << PROCESSOR)))
-	tuna --cpu $PROCESSOR --isolate
-
-	AFFINITY=0x$(get_affinity 1)
-
-	die_if_not_zero $((AFFINITY & PROCESSOR_AFFINITY)) "Isolating CPU $PROCESSOR"
-
-	tuna --cpu $PROCESSOR --include
-
-	AFFINITY=0x$(get_affinity 1)
-
-	die_if_zero $((AFFINITY & PROCESSOR_AFFINITY)) "Including CPU $PROCESSOR"
-done
-
-NEW_AFFINITY=$((1 << NR_PROCESSORS | 1))
-
-if [ $NR_PROCESSORS -gt 2 ]; then
-	tuna --cpu=0,$NR_PROCESSORS --isolate
-
-	for PID in $(cd /proc; ls -d [0-9]*) ; do
-		[ -n "$(cat /proc/$PID/cmdline 2> /dev/null)" ] || continue
-		AFFINITY=0x$(get_affinity $PID) || continue
-
-		die_if_not_zero $((AFFINITY & NEW_AFFINITY)) \
-			"Verifying isolation of first and last processor for PID $PID"
-	done
-fi
-
-tuna --cpu=0,$NR_PROCESSORS --include
-
-AFFINITY=0x$(get_affinity 1)
-
-die_if_not_equal $((AFFINITY & NEW_AFFINITY)) $NEW_AFFINITY "Including first and last processor"
-
-taskset -p 0xff 1 > /dev/null
-
-NEW_AFFINITY=$((1 << NR_PROCESSORS | 1))
-
-tuna --cpu=0,$NR_PROCESSORS --thread 1 --move
-
-AFFINITY=0x$(get_affinity 1)
-
-die_if_not_equal $((AFFINITY & NEW_AFFINITY)) $NEW_AFFINITY "Moving init to just first and last processor"
-
-NR_CPU_SOCKETS=$(get_nr_cpu_sockets)
-if [ $NR_CPU_SOCKETS -ge 2 ]; then
-	CPU1_SIBLINGS=$(printf "%d" 0x$(cat /sys/devices/system/cpu/cpu1/topology/core_siblings | cut -d',' -f2))
-	CPU1_SOCKET=$(cat /sys/devices/system/cpu/cpu1/topology/physical_package_id)
-
-	tuna --sockets=$CPU1_SOCKET --isolate
-	AFFINITY=0x$(get_affinity 1)
-	die_if_not_zero $((AFFINITY & CPU1_SIBLINGS)) \
-		"Verifying isolation of socket $CPU1_SOCKET"
-
-	tuna --sockets=$CPU1_SOCKET --include
-	AFFINITY=0x$(get_affinity 1)
-	die_if_not_equal $((AFFINITY & CPU1_SIBLINGS)) $CPU1_SIBLINGS \
-		"Verifying inclusion of socket $CPU1_SOCKET"
-
-	tuna --sockets=$CPU1_SOCKET --isolate
-	tuna --sockets=$CPU1_SOCKET --thread 1 --move
-	AFFINITY=0x$(get_affinity 1)
-	die_if_not_equal $((AFFINITY & CPU1_SIBLINGS)) $CPU1_SIBLINGS "Moving init to CPU socket $CPU1_SOCKET"
-fi
-
-if [ $NR_PROCESSORS -gt 2 ]; then
-	THREAD_PREFIX="watchdog/"
-	PID=$(ps h -C ${THREAD_PREFIX}0 -o pid)
-	RTPRIO=$(get_rtprio $PID)
-	NEW_RTPRIO=$((RTPRIO - 1))
-	tuna -t $THREAD_PREFIX* -p $NEW_RTPRIO
-	for CPU in $(seq 0 $((NR_PROCESSORS - 1))); do
-		PID=$(ps h -C ${THREAD_PREFIX}$CPU -o pid)
-		RTPRIO=$(get_rtprio $PID)
-		die_if_not_equal $RTPRIO $NEW_RTPRIO "Using --thread globbing"
-	done
-fi
-
-taskset -p $INITIAL_INIT_AFFINITY 1 > /dev/null
-rtctl --file $INITIAL reset
-
-echo 'PASS: Healthy tuna, no lead found, eat!'
-
-exit 0
-- 
2.51.1


  parent reply	other threads:[~2025-11-07 18:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 18:57 [ANNOUNCE] tuna v0.20 John Kacur
2025-11-07 18:57 ` [PATCH 01/23] Add SPDX license identifiers John Kacur
2025-12-18  2:45   ` Kate Stewart
2025-11-07 18:57 ` [PATCH 02/23] tuna: Remove spec file from git John Kacur
2025-11-07 18:57 ` [PATCH 03/23] tuna: Don't start the gui if a display is not available John Kacur
2025-11-07 18:57 ` [PATCH 04/23] tuna: Fix string syntax warnings with raw strings John Kacur
2025-11-07 18:57 ` [PATCH 05/23] tuna: Fix help.py syntax warnings John Kacur
2025-11-07 18:57 ` [PATCH 06/23] tuna: help.py John Kacur
2025-11-07 18:57 ` [PATCH 07/23] tuna: extract common cpu and nics determination code into a utils.py file John Kacur
2025-11-07 18:57 ` [PATCH 08/23] tuna: Add idle_state control functionality John Kacur
2025-11-07 18:57 ` [PATCH 09/23] tuna: utils: A few tweaks John Kacur
2025-11-07 18:57 ` [PATCH 10/23] tuna: Add Pyright helper John Kacur
2025-11-07 18:57 ` [PATCH 11/23] tuna: Update man page with cpu_power command John Kacur
2025-11-07 18:57 ` [PATCH 12/23] tuna: Fix show_threads -t and show_irqs -q John Kacur
2025-11-07 18:57 ` [PATCH 13/23] tuna: Fix run command failing to apply BATCH policy John Kacur
2025-11-07 18:57 ` [PATCH 14/23] tuna: Add -U and -K to the move command John Kacur
2025-11-07 18:57 ` [PATCH 15/23] tuna: Add -U and -K to the spread command John Kacur
2025-11-07 18:57 ` [PATCH 16/23] tuna: replace match with if statements John Kacur
2025-11-07 18:57 ` [PATCH 17/23] tuna: Proofreading fixes John Kacur
2025-11-07 18:57 ` John Kacur [this message]
2025-11-07 18:57 ` [PATCH 19/23] tuna: Fix setting a realtime scheduling policy John Kacur
2025-11-07 18:57 ` [PATCH 20/23] tuna: Update setup.py with co-author and metadata improvements John Kacur
2025-11-07 18:57 ` [PATCH 21/23] tuna: Add pyproject.toml for modern Python packaging John Kacur
2025-11-07 18:57 ` [PATCH 22/23] tuna: Update version to 0.20 John Kacur
2025-11-07 18:57 ` [PATCH 23/23] tuna: Fix pyproject.toml build issues John Kacur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251107185732.23992-19-jkacur@redhat.com \
    --to=jkacur@redhat.com \
    --cc=jwyatt@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=sageofredondo@gmail.com \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox