From patchwork Thu Mar 6 21:34:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 14005368 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 69244151990 for ; Thu, 6 Mar 2025 21:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741297167; cv=none; b=FyoQB2hQf3Wxg05V0kJdguve+kNHCN3YwKDREk0ak2LANJSAi35lYHA3KzQ4NI6ijEkJnwYC8iCyqeMOt8bGb4ACg8nTvLqEmrLWKUrtfeFtPrs1dZFLb4XdxyJgy0k7+OhuR7N8QHrJtBffcL+ulfdzqshNBMni6lzuabQmNdY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741297167; c=relaxed/simple; bh=N7pfLHtnj8VS+Z8BEQ8qt7JrTABrQLbQ2NnNRIgQNfo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OyTNeo8z3tfFKZQCRWNKjXj7xLu3dajZKc1VWDnD9hQYFxDPalP1Cl2IrtSOI07ZtRmFaV/2iOxD5iZVG2Quhq+xX1W+LSx2G1XCfSCOqgNRuMfB+aVAeje8MOcxadXlKdiDd6CkZV5D3gWJ6ornTdPhuRph4yjui5KuUDQFJnQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=RRr7UrJM; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="RRr7UrJM" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-22409077c06so25386215ad.1 for ; Thu, 06 Mar 2025 13:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1741297165; x=1741901965; darn=vger.kernel.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; bh=s2KJUvO1UZidGcYTguXEMcrYZBS90tfoZ3c0LWkq5wI=; b=RRr7UrJMp98nXKw1EGwn2yxLC5OsGfqPU+lH2DqQPmaKljal/Nny+agJ25pc1RcrEF gYVF2xBVSIzYLTcpwT9bVnA3vqZIXy78E6ci8iHI3Hyom6zc2+30U1zPWzqkNIazQTSd SyreE2r/EH0YZGRJsCX8Um3+fyOoUe5vrolwekbyvrnSFnGAM/9oGVUiW37vgeJ0Rylp N4p+OGPoaUsMgYf5FJeB/vQMp3pxMhuzW+Bpcn4NFhlrM6YHdZum92GWVwaIxWneBugf drmP5HH9P7xSmoZviWFYwToqHfJP5u5p19px18oScOcnj3mtXoyKxHkUiw+FNMX1ye+g 4LHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741297165; x=1741901965; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s2KJUvO1UZidGcYTguXEMcrYZBS90tfoZ3c0LWkq5wI=; b=kZrNAofV7+TKypANfL/3g2fKVuscz+gxFigd1nvEN1jJQloCDVTjzghBbTEo2wTjAe zw1t+rsrgbh9MeL5tuKDcNKxoeiH3t5Rd9NFZuCdg4El/utLaykZX2QcCXcZ/bhpAeq5 E6I0dt5Gdho1eZepMzB71SXU0dHw/zlguo1/QA0qlV9KtVVILdy5i+anFIpBq4/ttPrU 7foZy724KHkli95dRD8JPq5vOuKwVP1O0B0ls+mueJzSoZW9TKqapYZbMIJnI9SPfPFx qwdDDSLZrfs8cJF06pAUg4V2ou+nVxCyRyuUQw/iIIxr/rruY/U8NHhGhQREw6h85HOn 8oWQ== X-Gm-Message-State: AOJu0YwunK2N8M4hZkythdCzKcEFcRSt97rXfQ6umWAAfM6/FNtZJX7a 4Wiz92GIfwVMJMwZGMi1pGEAJyS8cBr9UpovHy+bdDRYS7rfzgfPLLN9CbTU8FBn++wX7gzmWms 7 X-Gm-Gg: ASbGncsxHdjFB822mXJn09ZGSf8gtsbfH6SW2wFyFvsiTuBtQlqAJJ9g9wCAgQSVmM6 92Ue/FcvTnoNChjH3XMjPjuB2sVIN4LtZNRykFMiEQB2NryvDf4IfRAA2uYan0Ec1KWR909zHf4 VW3G5FCCjjR/hzThsABTfQ9rT5bed7r00WoB6NR1qHUv+8xFp8LD/ll/1gGZvMYpTaCza5RyHoo mbfAwPshFPQI4rEOOuFiKKE2tHDZwXp/z2A44LKD4A744Cbuxt2cOC5cmwQltCFhGK3+BBCWp8b nCWPcFDwfhkPOhR2ivo2yMFf/VMge4SjaJf22/+ztTCY5SO2TjPSdZ2XQqhk7hKPG+oh2fOiPcO sA8Aehz0ZMytCTlBNqPw= X-Google-Smtp-Source: AGHT+IEUdQfpbuND3N71Q+VrXfe+yInGIWQZTsp8ILqNf1gsBYdQzr2JB8+VSRgolICS13yPrkb4EQ== X-Received: by 2002:a05:6a20:9185:b0:1f3:20aa:4224 with SMTP id adf61e73a8af0-1f544aef367mr1714834637.15.1741297165642; Thu, 06 Mar 2025 13:39:25 -0800 (PST) Received: from dread.disaster.area (pa49-186-89-135.pa.vic.optusnet.com.au. [49.186.89.135]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-af2810c1cbcsm1478651a12.35.2025.03.06.13.39.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 13:39:25 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tqIw6-00000009lRW-27DF for fstests@vger.kernel.org; Fri, 07 Mar 2025 08:39:22 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tqIw6-0000000FvrJ-2xit for fstests@vger.kernel.org; Fri, 07 Mar 2025 08:39:22 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 1/5] fstests: remove setup script Date: Fri, 7 Mar 2025 08:34:46 +1100 Message-ID: <20250306213921.3769440-2-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250306213921.3769440-1-david@fromorbit.com> References: <20250306213921.3769440-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner THere is a script that will echo the current setup of the fstests directory. This is largely the same output as running 'check -n' to do a dry-run outputs. Hence this script is redundant, not likely to be widely used and is easily replaced with check itself. Remove it. Signed-off-by: Dave Chinner --- setup | 81 ----------------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100755 setup diff --git a/setup b/setup deleted file mode 100755 index 375a54c98..000000000 --- a/setup +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2003-2004 Silicon Graphics, Inc. All Rights Reserved. -# -usage() -{ - - echo "Usage: $0 [options]"' - - -s section run only specified section(s) from config file - -S section exclude the specified section from the config file -' - exit 0 -} - -while [ $# -gt 0 ]; do - case "$1" in - -\? | -h | --help) usage ;; - -s) RUN_SECTION="$RUN_SECTION $2"; shift ;; - -S) EXCLUDE_SECTION="$EXCLUDE_SECTION $2"; shift ;; - *) usage ;; - esac - shift -done - -if ! . ./common/config -then - echo "check: failed to source common/config" - exit 1 -fi - -for section in $HOST_OPTIONS_SECTIONS; do - OLD_FSTYP=$FSTYP - OLD_MOUNT_OPTIONS=$MOUNT_OPTIONS - get_next_config $section - - # Do we need to run only some sections ? - if [ ! -z "$RUN_SECTION" ]; then - skip=true - for s in $RUN_SECTION; do - if [ $section == $s ]; then - skip=false - break; - fi - done - if $skip; then - continue - fi - fi - - # Did this section get excluded? - if [ ! -z "$EXCLUDE_SECTION" ]; then - skip=false - for s in $EXCLUDE_SECTION; do - if [ $section == $s ]; then - skip=true - break; - fi - done - if $skip; then - continue - fi - fi - - [ "$USE_EXTERNAL" = yes ] || USE_EXTERNAL=no - [ "$USE_LBD_PATCH" = yes ] || USE_LBD_PATCH=no - [ "$LARGE_SCRATCH_DEV" = yes ] || LARGE_SCRATCH_DEV=no - [ "$USE_ATTR_SECURE" = yes ] || USE_ATTR_SECURE=no - [ -z "$FSTYP" ] && FSTYP="xfs" - - cat < X-Patchwork-Id: 14005369 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (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 D98A120012D for ; Thu, 6 Mar 2025 21:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741297168; cv=none; b=prF/jL0YDhL7GqmsCIc6wT3AxQ2mDdfR7WdgTTV6rdbYkDk6w+1gAvsIgCoTpXbyMovgaXkMEpKKwodtsjWBOnkma0lCf5W3YiuHfyuRD9ItpdNadjEpH/AshY0lIUwwvMc/tvJeYkPMeN2C8KWQ/hwPhO1MQdjGj+kuhsKko84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741297168; c=relaxed/simple; bh=cDjSM/x+0s80493NvDcxRGMVRpj2GTq6LY6C26I+RfU=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P6SLb7awz4IvbwltVaTWF3/vnrg36bsZXALuect0IKCs7DIDkKJbfGZ3vgbCEXn1jhcnIfxkrb5vjt6DxAoJMFbxZFEIJSyOmE+oWvarQOingEu3Tbc6ZDpo2uqVGDb1LBbTWSRa+YgiZBfE519MDDCUnVK/2te+E2P0w1MGUAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=l3Ub71Es; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="l3Ub71Es" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2f9d3d0f55dso1941843a91.1 for ; Thu, 06 Mar 2025 13:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1741297166; x=1741901966; darn=vger.kernel.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; bh=AJ3h2Dq8/mMbPj4S1vGWnkFIqlROJaesBD/We3N4cPI=; b=l3Ub71EsYTwNRCJsI9Fkwp6xWxA+JgzGTjiIZeti9YZY7NLje+AYqiBlcIi6V1vrLT 2uJ+tsHzQFFvw85Y3LMqKSXMfiIv66hHFpUho1iIcyDfPfLrLKXnBBCIMEI95OC2WDY4 kJCadHH4eq2nAm5Nbc+0HEoO50JuscGDr1doDhll+fL/CBj1nkfa8S/ubLwgEDj9KQza uWXQ6oJzWX7SsjA4CKqLgVhfNetwwl+pIPtpMN0Lj/ElAfh7+O46HgDxfTZWGK6mOnrJ /b+GRCpdGwHxJHaL/aCtyLSFm+Ihu/DJH+y8SoVv2xuAoEMzsvxqBfrKiOScXo7d+VIG wJEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741297166; x=1741901966; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AJ3h2Dq8/mMbPj4S1vGWnkFIqlROJaesBD/We3N4cPI=; b=hQnkaIUMg7ZucdwuKugu+e6vAEJdmRZZxHJbGcdOL/GaS5lgWW/LXLJB5byifDVHa0 Ze2OismejueohADF4N0dBaxcJ6pB6ZsZzo2iK7x/Qo6Ow1F8JKke34NWsuL1W5yeNPnI B4Iv4GqZGLZK3NaR91aGjjOlGxQ8RQmdKexU/eVuA6ah4ClCHUVPZdhfVRfBZvb/VnMv pkfnTovE3WMrkRMjh2nD15vlt75+qYo9rRKRD36Juy4o9FkzuifK5zV3lztvVR2OjfXf DFxUIDSMADoEKkCE/ARApp3PZFE0zKK/NqeOBm6mTQA0WxToFlgGOhQuj7PK6dio4Nmu Ztdw== X-Gm-Message-State: AOJu0YwRIIuYEJsRT3O1jogOo83E01hLDWKVs4p2ZDYHeRS5OeMiuI3O lE17mbl2XQsftOq+fs6CFBIZBsCfwJ/37r6kLqjxiq1hSL+/kvAYjEtQAhQwOfgsa5vgk57Ng8E B X-Gm-Gg: ASbGncv6u980quiG79BbZfjiTFW4YtJfVYyIApx0hIVBVjJdHygFqBoEb1WDtazqXfd 9426BNmnPbkSTLaBHn1xUD51o5UIUkp1mA4TfbXTNnRck8/UXs8xVlt2m3JSM1y+o0k+NKWDkmw yAJ2FzcjIvk/NP7QklQNCpXwuaxDa/GaxIRbkeumylfslw7ZGR6WtNW0WQd0X/90wvYDSEBjALV 2CcaWziB2B16Zo++v3el0n2yZRz5aI+lnHlNjcFeCZUeDuDe/l/783oXiJ2YD6IUVT/pQrQRZMb LouVVf+daHY3zDRkjphg9OU8I1Ye/89Nq3eAtrR/C1RcyTFwmGp7cvfDxVQnLkGZCjXpO88qf9C jFulvEWOsQpyLFYyyCVM= X-Google-Smtp-Source: AGHT+IGVvrMGqKKXv1eXwpJ3RAUiw4YaAd2L9hzuPKpZ1n/n78YAXVlcGsu2/HVnILOGvyUGcz4wZA== X-Received: by 2002:a17:90b:4f8f:b0:2fe:b937:2a51 with SMTP id 98e67ed59e1d1-2ff7cf3e3f7mr1363798a91.33.1741297165930; Thu, 06 Mar 2025 13:39:25 -0800 (PST) Received: from dread.disaster.area (pa49-186-89-135.pa.vic.optusnet.com.au. [49.186.89.135]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ff4e7ff96esm3641699a91.35.2025.03.06.13.39.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 13:39:25 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tqIw6-00000009lRX-2Al7 for fstests@vger.kernel.org; Fri, 07 Mar 2025 08:39:22 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tqIw6-0000000FvrN-36RC for fstests@vger.kernel.org; Fri, 07 Mar 2025 08:39:22 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 2/5] fstests: remove old soak script Date: Fri, 7 Mar 2025 08:34:47 +1100 Message-ID: <20250306213921.3769440-3-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250306213921.3769440-1-david@fromorbit.com> References: <20250306213921.3769440-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner There is an old script for soak testing using check in the source tree called "soak". All it does is run fsstress in a loop on the scratch device, but to do that it needs to include the entire fstests config/setup scripts. These days we have much better soak testing capabilities (e.g. the soak and stress groups, with controllable iterations, durations, load, etc) so there's no point in keeping old scripts like this around that add weird dependencies to the core infrastructure. Remove it. Signed-off-by: Dave Chinner --- soak | 121 ----------------------------------------------------------- 1 file changed, 121 deletions(-) delete mode 100755 soak diff --git a/soak b/soak deleted file mode 100755 index d5c4229ad..000000000 --- a/soak +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. -# - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter - -tmp=/tmp/$$ -seq=soak -status=1 # failure is the default! - -_cleanup() -{ - echo " *** umount" - _scratch_unmount >/dev/null 2>&1 -} - -trap "_cleanup; exit \$status" 0 1 2 3 15 - -ROOT="." -LOG="$ROOT/soak.log" -FULL="$ROOT/soak.full" - -_log() -{ - echo "$*" 1>&2 - echo "$*" >>$LOG - echo "$*" >>$FULL -} - -_logp() -{ - tee -a $FULL -} - -_fail() -{ - _log "$*" - status=1 - exit 1 -} - -_require_scratch - -passes=-1 -stress=100000 -proc=1 - -if [ $# -gt 0 ] -then - passes=$1 - if [ $# -gt 1 ] - then - stress=$2 - if [ $# -gt 2 ] - then - proc=$3 - fi - fi -fi - -echo "" >$FULL -echo "" >$LOG -_log "*** soak test started (passes=$passes, stress=$stress, proc=$proc)" -_log "*** (`date`)" - - -_log " *** init" -_log " *** unmounting scratch device" - -_scratch_unmount 2>&1 >>$FULL - -_log " *** clean scratch device" - -mkfs_xfs -f $SCRATCH_DEV 2>&1 >>$FULL \ - || _fail " !!! failed to mkfs SCRATCH_DEV" - -pass=1 - -while [ $pass -le $passes -o $passes -lt 0 ] -do - _log " *** pass $pass (`date`)" - - _log " *** check" - _check_scratch_fs - - _log " *** mounting scratch device" - - if ! _scratch_mount 2>&1 | _logp - then - _fail " !!! failed to mount" - fi - - if [ $pass != 1 ] - then - _log " *** cleanup" - rm -rf $SCRATCH_MNT/soak_test \ - || _fail " !!! couldn't delete old dir" - - _log " *** check" - _check_scratch_fs - fi - - _log " *** mkdir" - mkdir $SCRATCH_MNT/soak_test \ - || _fail " !!! couldn't delete old dir" - - _log " *** stress" - ltp/fsstress -d $SCRATCH_MNT/soak_test -p $proc -n $stress $FSSTRESS_AVOID 2>&1 | \ - >>$FULL - - _log " *** unmounting scratch device" - - _scratch_unmount 2>&1 | _logp \ - || _fail " !!! failed to umount" - - let "pass = pass + 1" -done - From patchwork Thu Mar 6 21:34:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 14005371 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 55D9B207A34 for ; Thu, 6 Mar 2025 21:39:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741297169; cv=none; b=Wm6FXs5hZuh8OUsv+GFrVM6+za8DwQYGB4t+dbnwALtxhogp+CHPLRzH/p865wPfzQwf5eYu/9aOyVtQI1sLAEDrZURJU8QZe7Oyf0CBVVFj5DgSi0ZEym1PbbEXqJDWyFh8E5Bk5irdB+R4FuOJj8zrrM17tnYl3HjRKtsNL58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741297169; c=relaxed/simple; bh=iTAkiLhTD7dez0IwrMWxK/DH6Vu6yQhssj3zV0uSpAY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GIktZdfkf2O0+rb0AZBtGBqkONOvGAuMnh0uWPMS8nFeNfBK9E+NCBDy2Xv292PGkouP9DXPlz2xWn9aGgkV7hKafHZTVMFBjMhlShU5yYJhKUzL4Y4kyqU/n9BQHkLylpiJj6RCf20wQhKvVa60SNqguw2FOZ8U5+ab+PjJQEI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=1OtHxjsj; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="1OtHxjsj" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-224100e9a5cso21837435ad.2 for ; Thu, 06 Mar 2025 13:39:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1741297166; x=1741901966; darn=vger.kernel.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; bh=dHQAScpZJLW0kW4Qb3/VRaYbP43fdtprpyU3J1+tFKs=; b=1OtHxjsjgDjrTEDAHlJoOYAESFF5Y24pnNyQx2DQd+kaXrSLnjVAmQaPwva8NL0ICD T8jCh1Oq9O5H1ErW+4s1yXm4VaT1gLMHO02wHNMR1zEEFe+/fVQz3IGB9dWP7M9ndMKG S2ROOWyCFi+HRURLzPPw28eamDPwEW0pZX/iWPHZUNiSQprTSXTfW/2Rn7lzlPqyjaOH JF6xOw/sqBI6ZP8/FKBCAN4tt5YqyKBbqzTdonFaRtB47NhHp2aopxH6YQmwS1lRHzpb yoDxm5rzuegYX8odgcgyuRvIX829j5cxUaQWgFJTJnxHNwdPdOqoBoT4qF1BP1bomNeF dwTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741297166; x=1741901966; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dHQAScpZJLW0kW4Qb3/VRaYbP43fdtprpyU3J1+tFKs=; b=dB1r3cmTVh62v7zDc9PbTizO3EaouIULslkaJgk6nQMhhUryxqzMiNBNRiriFlm99j 2lXknwQnQEVtxT9SB01UEahF4N65QwqhG3byGZyvOUwdJQ0/60SsjqEkL1HZGsmo16m7 CqB/i2SoQWZED+FJu00Ezcr40RK/ICpqfkSRob381rlCAp8W/ydjVjJ+R6jvE+bszJ73 KyvxOjG8ZQ3G325ZkS41vb76q+EnuHx0uRtcedxebeT/Edg19ps7RhSf8AdKe0CoR+tk NvECiqYPMnunGW4y9Qhx45JD8ldNn7qMCB2rR8c0AdfM5LeRmGgoW6QcDbFOyEkjumTp /Hqg== X-Gm-Message-State: AOJu0Yyajr5EgpPM481k7dSw2sZLtzAwU8s6X0me+q5hkvHtOTcN7E5B raYd1VIrbxi3ETrRYcfmsUHJkMAPK1qyVVfW3cBOGL5vsH4ZmcbppwGe0SZNrnogVIA7Z8tN/AI o X-Gm-Gg: ASbGncuMuWYU8RLd9d5WwPkSCb4Go3fq081Mc4qVXetvvvtg1lkepuRBsGbgfGjyQek vBxmrpOltU9cCysOUbWJ97BJFo/luNVbTvyBhzsvGu6ItevGWL4qf/pzp48bs+ATPqxh0AhNuUV GbKu0Os4LzirvLSqU2Fk0AGGVZ0K/9vc4MpUUaUILNKEORDt1jjMOsSd/DCGXtGIyGERN9vFcx6 owxh7hRJts5YsyP9vfjmNI+UoxasxK2NRjmjQeCl7CYORTCy/xwSPeXm/RBf4B06oH4WLzMBhuP UYJNP5CQgP0i1bmXAq0wRLYVTD1S1+z8jm50GMWbl4fYXAdb/A0po2bvbK4WU5Vd1d1BcmrQCvZ WG1AsBZesrMS2pMbEt4Y= X-Google-Smtp-Source: AGHT+IF4RtH7bdrWXrAvFPHazT2iNjkpQ5u2/zh5zTnVC8JfcsyNBfoiOmZp2rMsecZP1tXSnBAdzw== X-Received: by 2002:a05:6a00:4b4a:b0:736:6ac4:d1ff with SMTP id d2e1a72fcca58-736aa9e7154mr1673484b3a.3.1741297166262; Thu, 06 Mar 2025 13:39:26 -0800 (PST) Received: from dread.disaster.area (pa49-186-89-135.pa.vic.optusnet.com.au. [49.186.89.135]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-736984f7115sm1904388b3a.105.2025.03.06.13.39.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 13:39:25 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tqIw6-00000009lRc-2T6O for fstests@vger.kernel.org; Fri, 07 Mar 2025 08:39:22 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tqIw6-0000000FvrR-3Fvh for fstests@vger.kernel.org; Fri, 07 Mar 2025 08:39:22 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 3/5] fstests: remove crash script Date: Fri, 7 Mar 2025 08:34:48 +1100 Message-ID: <20250306213921.3769440-4-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250306213921.3769440-1-david@fromorbit.com> References: <20250306213921.3769440-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner This is an old, early 2000s SGI era script for crash and recovery testing XFS filesystems. We have much better ways of doing this today with tools like dm-error, dm-flakey, etc. Nobody has been using this script for years, so remove it. Signed-off-by: Dave Chinner --- crash/README | 151 -------------- crash/rc.sysinit | 46 ----- crash/xfscrash | 506 ----------------------------------------------- 3 files changed, 703 deletions(-) delete mode 100644 crash/README delete mode 100644 crash/rc.sysinit delete mode 100755 crash/xfscrash diff --git a/crash/README b/crash/README deleted file mode 100644 index 36f2ec65e..000000000 --- a/crash/README +++ /dev/null @@ -1,151 +0,0 @@ -############ -# xfscrash # crash testing setup for XFS -############ - -*** disclaimers *** - - work-in-progress, buyer-beware, your-mileage-may-vary, this-is-a-hack - -*** what xfscrash does *** - - xfscrash allows realistic testing of XFS log recovery and XFS check/repair - by generating log activity on an XFS partition, then rebooting the machine - at a random point. When the machine comes back up, xfscrash is restarted - and then tests either the log recovery or xfs_repair on the dirtied - filesystem. All going well the process continues. - -*** getting ready for crash testing *** - - Most filesystems (ext2 included) can't withstand having the machine - they're running on rebooted while they're active. So the crash test - machine needs to have all filesystems other than the test FS mounted - read-only so they won't get trashed when the machine reboots. - -*** mouting FSes read-only *** - - Following is a recipe for making a redhat linux (6.2) machine with a single - ext2 FS mounted on root able to be booted read-only. Your Mileage May - Vary - don't try this on an important machine. - - The idea is to move anything that needs to be r/w into the /initrd_init - directory, replacing the moved directories with links to the moved ones. - That way the /initrd_init directory may be copied to a ramdisk, and - mounted over /initrd on the root FS which never gets remounted r/w. - - # go to single user - init 1 - - # make a mount point for the ramdisk - mkdir /initrd - - # link across to the /initrd_init directory for when - # the ramdisk isn't mounted - ln -s /initrd_init/dev . - ln -s /initrd_init/etc . - ln -s /initrd_init/proc . - ln -s /initrd_init/sbin . - ln -s /initrd_init/tmp . - ln -s /initrd_init/var . - - # make the /initrd_init directory - mkdir /initrd_init - cd /initrd_init - - - # move /dev - mv /dev . - ln -s /dev /initrd/dev - - # move /etc - mv /etc . - ln -s /etc /initrd/etc - - # make proc mount - mkdir proc - - # move /tmp - mkdir tmp - rm -rf /tmp - ln -s /tmp /initrd/tmp - - # link /sbin - ln -s /sbin . - - # setup a tree for parts of /var - mkdir var var/cache var/lock var/lock/console var/lock/subsys - mkdir var/log var/preserve var/run - - touch /var/run/utmp /var/log/utmp /var/log/wtmp - - # move parts of /var - rm -rf /var/cache /var/lock /var/log /var/preserve /var/run - ln -s /initrd/var/cache /var/cache - ln -s /initrd/var/lock /var/lock - ln -s /initrd/var/log /var/log - ln -s /initrd/var/preserve /var/preserve - ln -s /initrd/var/run /var/run - - # make a mount for /var/shm - mkdir var/shm - ln -s /var/shm /initrd/var/shm - - # move /var/spool - mkdir var/spool - mkdir var/spool/mail var/spool/anacron var/spool/at var/spool/lpd - mkdir var/spool/rwho var/spool/mqueue var/spool/cron - rm -rf /var/spool - ln -s /var/spool /initrd/var/spool - - # move /var/tmp - mkdir var/tmp - rm -rf /var/tmp - ln -s /var/tmp /initrd/var/tmp - - # trim /dev - too many inodes here - remove anything you don't need - # (small ramdisk has a small number of inodes) - rm -rf /initrd/dev/<....> - - All going well, all the directories you've made should link through - /initrd and into /initrd_init, and the machine should come back up - if you restart it. - - You want to keep the contents of /initrd_init to a minimum because - this stuff has to fit into the ramdisk. - -*** getting the ramdisk going *** - - See the rc.sysinit file for some details of what to do to get the - ro-root/ramdisk up and running. - - Once everything is going, the root FS should never be remounted to - r/w on boot and should be in r/o mode when the machine comes up. - - All going well, any open files have been redirected through the - symlinks onto the ramdisk, so you should be able to remount the - root FS to r/w and then remount it back to r/o. - - Since there's no r/w filesystems mounted, it should be ok to - reboot the machine with 'reboot -fn' and everything should come - back without dirty filesystems and without having to fsck. - -*** starting xfscrash *** - - The simplest way to restart xfscrash on reboot is to start it - in the background from rc.local. The script logs to /dev/tty1, - /dev/console & a logfile by default, so the output should be - easy to find. - - Link the xfscrash directory off an NFS mounted FS so you can make - changes while the machine is rebooting and so you can touch the - 'stop' and 'start' control files. - - To configure the system, change the parameters in the configuration - section of the 'xfscrash' script. - - To start the system, touch the 'start' control file and then either - reboot or manually run the 'xfscrash' script. - - To stop the system, touch the 'stop' control file and wait for the - next cycle to start when the control file will be checked and - the test terminated. - diff --git a/crash/rc.sysinit b/crash/rc.sysinit deleted file mode 100644 index 0f0781a79..000000000 --- a/crash/rc.sysinit +++ /dev/null @@ -1,46 +0,0 @@ -# -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. -# -# xfscrash - control the XFS crash tests -# - -# this is an example of what to add to rc.sysinit on a redhat linux -# system to get the ro-root/ramdisk system up and running - -if [ -f /initrd.active ] -then - echo "*** MAKE RAMDISK ***" - dd if=/dev/zero of=/dev/ram0 bs=1024k count=4 - mkfs -i 1024 /dev/ram0 4096 - echo "*** MOUNT RAMDISK ***" - mount -n -w /dev/ram0 /mnt - echo "*** INIT RAMDISK ***" - cp -a /initrd_init/* /mnt - rm -f /mnt/00_INITRD_REAL - touch /mnt/00_INITRD_RAMDISK - umount -n /mnt - echo "*** REMOUNT RAMDISK ***" - mount -n /dev/ram0 /initrd - - echo "*** FIX MTAB ***" - >/etc/mtab - rm -f /etc/mtab~ /etc/mtab~~ - mount -f -o ro / - mount -f -o rw /dev/ram0 /initrd -else - # old code - - # Remount the root filesystem read-write. - action "Remounting root filesystem in read-write mode" mount -n -o remount,rw / - - # Clear mtab - >/etc/mtab - - # Remove stale backups - rm -f /etc/mtab~ /etc/mtab~~ - - # Enter root and /proc into mtab. - mount -f / - mount -f /proc - -fi diff --git a/crash/xfscrash b/crash/xfscrash deleted file mode 100755 index 037b3df1e..000000000 --- a/crash/xfscrash +++ /dev/null @@ -1,506 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. -# -# xfscrash - control the XFS crash tests -# - - ####################### -### configuration stuff ######################################################## - ####################### - -# remount, repair or corrupt -MODE=remount -# where to find xfscrash -XFSCRASH=/xfscrash -# put log files here -LOG=$XFSCRASH -# put output to these places -OUTPUT="$LOG/xfscrash.log /dev/tty1 /dev/console" -# awk... -AWK_PROG=gawk -# clear FS if >= this percent full at start of run. 100 is a good -# number - only used on corrupt test so far -FULL_LIMIT=80 - -case `hostname -s` -in - leesa) - # mount test partition here - TEST_MNT=/mnt/arch0 - # build test partition here - TEST_DEV=/dev/hda6 - # backup test partition to here (or empty) - BACKUP_DEV=/dev/hda8 - # backup block size for dd - BACKUP_BS=1024k - # base stress time - STRESS_TIME=60 - # stress random time - STRESS_RANDOM=60 - ;; - lumpy) - # mount test partition here - TEST_MNT=/mnt/scratch_0 - # build test partition here - TEST_DEV=/dev/sdc5 - # backup test partition to here (or empty) - BACKUP_DEV= ;#/dev/sdc6 - # backup block size for dd - BACKUP_BS=10240k - # base stress time - STRESS_TIME=360 - # stress random time - STRESS_RANDOM=360 - ;; - *) - echo "!!! no configuration data for host `hostname -s`" - exit 1 - ;; -esac - -# avoid stress - -AVOID="-f resvsp=0 -f unresvsp=0" - -# DIY stress command -STRESS="/usr/local/bin/fsstress -d $TEST_MNT/stress -n 10000000 -p 1 $AVOID" -#STRESS="/usr/local/bin/randholes -l 10000000 -c 100000 -b 512 $TEST_MNT/stress/holes" - -# stress command for the corrupt test -CORRUPT_STRESS="/usr/local/bin/fsstress -d $TEST_MNT/stress -n 10000 -p 1 $AVOID" - -########################################################################### - -reboot=-1 - -_log() -{ - tee -a $OUTPUT > /dev/null -} - -_echo() -{ - echo "$*" | _log -} - -_mount() -{ - _echo " *** Mounting $TEST_DEV on $TEST_MNT" - if ! mount -t xfs $TEST_DEV $TEST_MNT - then - _echo " !!! unable to mount" - exit 1 - fi -} - -_unmount() -{ - _echo " *** Unmounting $TEST_DEV" - if ! umount $TEST_DEV &> /dev/null - then - _echo " !!! unable to unmount" - exit 1 - fi -} - -_check() -{ - expect=$1 - fail=0 - - if [ $expect -eq 0 ] - then - _echo " *** xfs_repair -n ($LOG/repair_clean.out)" - xfs_repair -n $TEST_DEV &> $LOG/repair_clean.out || fail=1 - fi - - if [ $fail -eq 0 ] - then - _echo " *** FS checks ok" - else - if [ $expect -eq 0 ] - then - _echo " !!! FS check failed - inconsistent FS" - _echo " !!! (see $LOG/*.out for details)" - exit 1 - else - _echo " *** inconsistent fs (as expected)" - fi - fi -} - -_check_core() -{ - if [ -e core ] - then - _echo " !!! core file found!" - exit 1 - fi -} - -_repair() -{ - rm -f core - _echo " *** repair" - _echo " *** repair pass 1 (RO)" - xfs_repair -n $TEST_DEV &> $LOG/repair_1.out \ - && _echo " !!! no errors found (eh?)" \ - || _echo " *** errors found (expected)" - - _check_core - - _echo " *** repair pass 2 (RW)" - - if xfs_repair $TEST_DEV &> $LOG/repair_2.out - then - _echo " *** FS checks ok (now)" - else - _echo " !!! xfs_repair returned error code" - _echo " !!! (see $LOG/repair_*.out for details)" - exit 1 - fi - - _check_core - - _echo " *** repair pass 3 (RO)" - if xfs_repair -n $TEST_DEV &> $LOG/repair_3.out - then - _echo " *** FS checks ok" - else - _echo " !!! errors found after repair (unexpected)" - _echo " !!! (see $LOG/repair_*.out for details)" - exit 1 - fi - - _check_core -} - -_cleanup() -{ - rm -f $XFSCRASH/counter $XFSCRASH/start $XFSCRASH/stop $XFSCRASH/active - - if [ $reboot != -1 ] - then - kill $reboot - fi - -} - -_random() -{ - od -tu -N 4 /dev/random | gawk -v v=$1 'NR==1 { print $2 % v }' -} - -_backup() -{ - if [ $count -ne 1 -a "$BACKUP_DEV" != "" ] - then - _echo " *** Backing up $TEST_DEV to $BACKUP_DEV" - if ! dd if=$TEST_DEV of=$BACKUP_DEV bs=$BACKUP_BS &> $LOG/dd.out - then - _echo " !!! unable to backup fs" - _echo " !!! (see $LOG/dd.out)" - exit 1 - fi - else - _echo " *** skipping back up step" - fi -} - -_logprint() -{ - _echo " *** dumping log to $LOG/logprint.out" - rm -f core - xfs_logprint $TEST_DEV &> $LOG/logprint.out - if [ -e core ] - then - _echo " !!! xfs_logprint dumped core" - echo "" >> $LOG/logprint.out - echo "*** CORE DUMPED ***" >> $LOG/logprint.out - echo "" >> $LOG/logprint.out - fi - - _echo " *** dumping log (-t -i) to $LOG/logprint_inode.out" - - rm -f core - xfs_logprint -t -i $TEST_DEV &> $LOG/logprint_inode.out - if [ -e core ] - then - _echo " !!! xfs_logprint dumped core" - echo "" >> $LOG/logprint_inode.out - echo "*** CORE DUMPED ***" >> $LOG/logprint_inode.out - echo "" >> $LOG/logprint_inode.out - fi - - _echo " *** dumping log (-t -b) to $LOG/logprint_buf.out" - - rm -f core - xfs_logprint -t -b $TEST_DEV &> $LOG/logprint_buf.out - if [ -e core ] - then - _echo " !!! xfs_logprint dumped core" - echo "" >> $LOG/logprint_buf.out - echo "*** CORE DUMPED ***" >> $LOG/logprint_buf.out - echo "" >> $LOG/logprint_buf.out - fi -} -# -# _df_device : get an IRIX style df line for a given device -# -# - returns "" if not mounted -# - returns fs type in field two (ala IRIX) -# - joins line together if split by fancy df formatting -# - strips header etc -# - -_df_device() -{ - if [ $# -ne 1 ] - then - echo "Usage: _df_device device" >&2 - exit 1 - fi - - df -T 2> /dev/null | $AWK_PROG -v what=$1 ' - match($1,what) && NF==1 { - v=$1 - getline - print v, $0 - exit - } - match($1,what) { - print - exit - } - ' -} - -# -# _df_dir : get an IRIX style df line for device where a directory resides -# -# - returns fs type in field two (ala IRIX) -# - joins line together if split by fancy df formatting -# - strips header etc -# - -_df_dir() -{ - if [ $# -ne 1 ] - then - echo "Usage: _df_dir device" >&2 - exit 1 - fi - - df -T $1 2> /dev/null | $AWK_PROG -v what=$1 ' - NR == 2 && NF==1 { - v=$1 - getline - print v, $0; - exit 0 - } - NR == 2 { - print; - exit 0 - } - {} - ' - # otherwise, nada -} - -# return percentage used disk space for mounted device - -_used() -{ - if [ $# -ne 1 ] - then - echo "Usage: _used device" >&2 - exit 1 - fi - - _df_device $1 | $AWK_PROG '{ sub("%", "") ; print $6 }' -} - -_check_free() -{ - used=`_used $TEST_DEV` - - if [ $used -ge $FULL_LIMIT ] - then - _echo " *** $used % used on $TEST_DEV - deleting files" - rm -rf $TEST_MNT/stress - fi -} - -# loop, stressing, unounting and checking -# no (expected) rebooting... -_corrupt() -{ - count=0 - - # don't want to restart if we reboot... - _cleanup - - while true - do - - if [ -e $XFSCRASH/stop ] - then - _echo "### XFS Crash stopped " - exit 0 - fi - - _echo "*** run $count" - let "count = count + 1" - - _check 0 - _mount - - _check_free - - $CORRUPT_STRESS | _log - - _unmount - done -} - -########################################################################### - -_echo "" -_echo "" -echo "XFSCRASH [output to $OUTPUT]" -_echo "" - -if [ "$1" = "start" ] -then - touch $XFSCRASH/start -fi - -if [ "$1" = "stop" ] -then - touch $XFSCRASH/stop -fi - - -trap "_cleanup; exit \$status" 0 1 2 3 15 - - -if [ -e $XFSCRASH/stop ] -then - _echo "### XFS Crash stopped " - exit 0 -fi - -if [ -e $XFSCRASH/start ] -then - _echo "### XFS Crash started " - _cleanup - rm -f $LOG/*.out $LOG/*.log core - - touch $XFSCRASH/active - - _echo " *** Building fresh XFS FS" - umount $TEST_DEV &> /dev/null - if ! mkfs -t xfs -f $TEST_DEV &> $LOG/mkfs.out - then - _echo " !!! unable to mkfs" - _echo " !!! (see $LOG/mkfs.out)" - exit 1 - fi -fi - -if [ ! -e $XFSCRASH/active ] -then - _echo "### XFS Crash inactive " - exit 0 -fi - - -if [ -r $XFSCRASH/counter ] -then - count=`cat $XFSCRASH/counter` -else - count=0 -fi -_echo "### Crash test run $count (mode=$MODE, log=$LOG/{*.out,*.log})" - -let "count = count +1" -echo $count > $XFSCRASH/counter - -# real test starts here - -_echo " *** Checking for R/O root" -if ! mount | grep "on / type" | grep -q "(ro)" -then - _echo " !!! root not mounted readonly" - exit 1 -fi - -_echo " *** Loading XFS modules" -if ! modprobe xfs -then - _echo " !!! unable to modprobe xfs" - exit 1 -fi - -_echo " *** Unmounting $TEST_DEV" -umount $TEST_DEV &> /dev/null - -_logprint -if [ $MODE != "corrupt" ] -then - _backup -fi - -case $MODE -in - remount) - _check 1 # expect errors - _mount - _unmount - ;; - repair) - _repair - ;; - corrupt) - _corrupt - exit 0 - ;; - *) - _echo "xfscrash: MODE must be remount or repair" - exit 1 - ;; -esac - -_check 0 # don't expect errors -_mount - -_echo " *** Cleaning XFS FS" -if ! rm -rf $TEST_MNT/stress $TEST_MNT/lost+found &> $LOG/clean.out -then - _echo " !!! unable to clean XFS FS" - _echo " !!! (see $LOG/clean.out)" - exit 1 -fi - -_echo " *** Making stress directory" -if ! mkdir $TEST_MNT/stress -then - _echo " !!! unable to mkdir stress" - exit 1 -fi - -let "bang = STRESS_TIME + `_random $STRESS_RANDOM`" - -_echo " *** Preparing random reboot (in $bang seconds)" -( - sleep $bang - _echo " *** BANG ****" - reboot -fn -) & -reboot=$! - -_echo " *** Causing stress & waiting for the inevitable" -$STRESS | _log - -exit 0 From patchwork Thu Mar 6 21:34:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 14005373 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 81DFC2135A3 for ; Thu, 6 Mar 2025 21:39:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741297170; cv=none; b=iUK9pobMgR/yUgfJgL45/QsScwFZe/SfKtYRPkMPPTXUdxveaTvC/AWth6dmOyNXu4a93QlQQpogmb8oAfit7SGHCvvgQRg/SKMR1ft5M81mwkt0Axbns24Kha8HarDqSZaWSXYH/gNsQY8nlhmtaVkg5HVvUEtLzrmzTAil06E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741297170; c=relaxed/simple; bh=eCntKfcnKcAoTACNRtfbYRoUkJYxKPLidqc8ENdI7vs=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IOQzq6mp9AyReIePH7RXtRU36v969cODME2RV0jDTi36qDlYelSaYfP4nGXIA93TQWYfBr3VMoecVpzj5Ci6T03qxaKOswmIiFT2rFm2EIrOfwT0qmgyHq+tY/HuvG7cYbDpjeJZvEN9qQ0lg/ppX1YAbom84wbYNDcwJT0vLlA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=UW5A4r1A; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="UW5A4r1A" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2234e4b079cso21307365ad.1 for ; Thu, 06 Mar 2025 13:39:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1741297167; x=1741901967; darn=vger.kernel.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; bh=NTPSLjVBQ+MFaQOuOxS6Bl/h8Mkm+ykxeSkcWemwpLs=; b=UW5A4r1AqIbbicwsAa6d3CKpL1gH2ytj9CfhXb92C5N2+CfkDW5007k5onCh1kYH0V YKeSAMlFRoumYQNrTtDdTU3sWxV9E786V2I42wvbnrmGo7l4miB7kilYUXnX0985Unw7 8KFGm3bTXvZus2bRIZ9TVvaKFd8GuahSkIfXnYMtTn4n9j6v/3jpRCtAewjoODbydtqL lli0QKznDkYrKlzYtReuzUPzGtxREAiuitpDW23mJB2HzrCc3/7iBKe8JRt+ZpK5bWGA rRoRrUZVTo+DAEKcxOVF8M6fvJHFKasC+TdMzTqksLtZzoG74imIKdVyFG8jS24mijJM I4CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741297167; x=1741901967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NTPSLjVBQ+MFaQOuOxS6Bl/h8Mkm+ykxeSkcWemwpLs=; b=DWkP4kwKaXkmcxAq/ZV8MDOZ53AKs6XR9A+1C8Tx7IQy6G/UfVxbJMyU36OYRoX7MY QdpUDzT/Wmr5e3H7sgMcrBW2TwP4RtE4Dsj4BazEp4Bvf1Mam5jT3uHrw//X/KXqDOHE SDliKCKoyg+mQacDLwcqNbkOEfV936hlpFK83HE4vbi2UUoI1A9jxVwZSKNcg1u/wWY4 AdDXPU/5pPeJs8M1IRz7hn5v9VKdafFVSWn9lK/o+T1xlgPIzt+TudeQ5MwcH2DcGL4h D4YqLO+RkvMfSe+NVwTQqIp1MudumHWRKu8JjQumLbbSGkK9zJvX9ybMxO+EbFml4WC5 E7pQ== X-Gm-Message-State: AOJu0YyqTBk5Wmi6L0ifYANWVURH8m+XmJrh+5rh/TGs+aQwyJmPvnBm cEt27qM9mmLC7dunBsDtgWrukTwB2NIQwVmtzy25qXdcsybXSuiH1JvFRmN+3HGGoDdV9B+va6j 6 X-Gm-Gg: ASbGnctYFTKUvnZfUMhem7Rd43quJ11CxMGUMfOEX1CCXEB2BVC6MiyGeIY76m7qJOc 7T6+MEa+W8NP8PJottXoevUnG01CnBNYwrWbccwt/wn93mNdz/9IaQm9hsKF558PBAMnUVA7ymd LpMcIWvwH4pZKiEjvNd3P3EY1P7t1KHqKcHtIRG64WEeSZ/h55jNj2Zy54qHX20xAE+GjZ2PRKR 12b9OcZC4V/perTHV9ca6BZLctzHX9TBFqLlTaFKMqArOEc2qoCOA0E3dGly91jlZ2OCS6NAdne VHERDTuen7RGwdpcqbzNw5kVqq34tqVILNe5+10CXgWVzputqBOSON3jM3pRsWBaJE7mwxe0zoU NMneTtNA5H09vTXM3V9U= X-Google-Smtp-Source: AGHT+IEt+E+y2Pi6CQ317tY2I70l062g5qieFWw0vfA4SVn5Z6YgSAuZScuIoQxj/VoXmobd69smhw== X-Received: by 2002:a05:6a00:1812:b0:736:8c0f:7758 with SMTP id d2e1a72fcca58-736aa9e954amr1160889b3a.10.1741297166615; Thu, 06 Mar 2025 13:39:26 -0800 (PST) Received: from dread.disaster.area (pa49-186-89-135.pa.vic.optusnet.com.au. [49.186.89.135]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73698243fcbsm1916459b3a.57.2025.03.06.13.39.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 13:39:25 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tqIw6-00000009lRd-2ZYf for fstests@vger.kernel.org; Fri, 07 Mar 2025 08:39:22 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tqIw6-0000000FvrX-3SEF for fstests@vger.kernel.org; Fri, 07 Mar 2025 08:39:22 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 4/5] fstests: remove tools/auto-qa Date: Fri, 7 Mar 2025 08:34:49 +1100 Message-ID: <20250306213921.3769440-5-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250306213921.3769440-1-david@fromorbit.com> References: <20250306213921.3769440-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner This is a 2000s era SGI test script that no-one uses anymore. It likely doesn't even work because it is dependent on CVS and/or the SGI proprietary ptools revision control system for source control. Hence it clearly hasn't been used for years, so remove it. Signed-off-by: Dave Chinner --- tools/auto-qa | 568 -------------------------------------------------- 1 file changed, 568 deletions(-) delete mode 100755 tools/auto-qa diff --git a/tools/auto-qa b/tools/auto-qa deleted file mode 100755 index 1beb28359..000000000 --- a/tools/auto-qa +++ /dev/null @@ -1,568 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. -# -# automatic qa system. 31/08/00 dxm@sgi.com -# -# Usage: auto_qa start-state [stop-state] -# Do auto_qa from start-state up to stop-state inclusive -# or if no stop-state given then do it until reach "done" state. -# - -_log() -{ - echo "$*" >&2 - echo "$*" >> $LOG - sync -} - -_fail() -{ - if [ "$started" = "1" ] - then - echo "auto-qa stopped" | wall - started=0 - fi - - _log "$*" - - # send special email if a cron'd qa run fails - case $state - in - cron*) - mail -s "XFS QA status report" $EMAIL < $LOG 2>&1 - ;; - esac - - status=1 - exit 1 -} - -_get_kernel_version() -{ - [ -x "$KWORKAREA" ] || return - [ -r "$KWORKAREA/Makefile" ] \ - || _fail "can't read kernel makefile $KWORKAREA/Makefile" - - eval `awk ' - BEGIN { FS = "[ \t=]+" } - /^VERSION =/ { a=$2 } - /^PATCHLEVEL =/ { b=$2 } - /^SUBLEVEL =/ { c=$2 } - /^EXTRAVERSION =/ { d=$2 } - END { - print "VERSION=" a "." b "." c d " ; SVERSION=" a "." b "." c - } - ' < $KWORKAREA/Makefile` -} - -# this should be constant - -ROOT="$HOME/qa" -HOST=`hostname -s` -if [ ! -z "$CVSROOT" ]; then - export WORKAREA="$ROOT/xfs-cmds" -else - [ -z "$WORKAREA" ] && export WORKAREA="$ROOT/xfs-cmds" -fi - - -export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin/ptools:/usr/local/bin" -STATE=$ROOT/qa.state -QADIR="$WORKAREA/xfstests" -SUDO="su -c" -CONFIG="$ROOT/$HOST.config" -COMMON_CONFIG="$QADIR/common/config" -SH="/bin/sh" -LOG="$ROOT/qa.log" - -# do some cleanup on exit - -_cleanup() -{ - umount $SCRATCH_DEV &> /dev/null - umount $TEST_DEV &> /dev/null - if [ "$started" = 1 ] - then - echo "auto-qa stopped" | wall - started=0 - fi -} -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# clean exit - -_success() -{ - status=0 - exit 0 -} - -_get_state() -{ - state=`cat $STATE` -} - -_set_state() -{ - echo $1 > $STATE - _get_state -} - -_change_state() -{ - new=$1 - - # if have state XXXX-state then preserve XXXX-newstate - - case $state - in - *-*) - case $new - in - *-*) - _set_state $new - ;; - *) - _set_state `echo $state | sed "s/-.*$/-$new/"` - ;; - esac - ;; - *) - _set_state $new - ;; - esac -} - -_sudo() -{ - $ROOT/su -c "$*" < /dev/null ;# HACK - we need a hacked su at the mo -} - -_restart() -{ - exec $ROOT/su -c "(shutdown -r now \"auto-qa rebooting\" )&" < /dev/null -} - -_update_workarea() -{ - if [ -z "$CVSROOT" ]; then - _log " *** p_tupdate" - cd "$1" - WORKAREA="$1" p_tupdate 2>&1 \ - || _fail " !!! p_tupdate failed" - - _log " *** non-trunk files" - cd "$1" - WORKAREA="$1" p_list -c 2>&1 \ - || _fail " !!! p_list failed" - else - _log " *** cvs update" - cd "$1" - cvs -z3 update -d - fi -} - -_test_mkfs_xfs() -{ - TEST_OPTIONS="" - [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ] && \ - TEST_OPTIONS="$TEST_OPTIONS -rrtdev=$TEST_RTDEV" - [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \ - TEST_OPTIONS="$TEST_OPTIONS -llogdev=$TEST_LOGDEV" - _sudo /sbin/mkfs.xfs -f $TEST_OPTIONS $MKFS_OPTIONS $* $TEST_DEV - mkfs_status=$? - if [ "$USE_BIG_LOOPFS" = yes ]; then - [ -z "$RETAIN_AG_BYTES" ] && RETAIN_AG_BYTES=0 - _sudo $QADIR/tools/ag-wipe -q -r $RETAIN_AG_BYTES $TEST_DEV - fi - return $mkfs_status -} - -_test_mount() -{ - TEST_OPTIONS="" - [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ] && \ - TEST_OPTIONS="$TEST_OPTIONS -ortdev=$TEST_RTDEV" - [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \ - TEST_OPTIONS="$TEST_OPTIONS -ologdev=$TEST_LOGDEV" - _sudo mount -t xfs $TEST_OPTIONS $MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR -} - -_i386_install() -{ - _sudo cp -f "$KWORKAREA/arch/i386/boot/bzImage" "$IMAGE" 2>&1 \ - || _fail " !!! install kernel failed" - _sudo cp -f "$KWORKAREA/System.map" "$SYSTEMMAP" 2>&1 \ - || _fail " !!! install kernel failed" - if [ -z "$KMODULES" -o "$KMODULES" = yes ]; then - _sudo make EXTRAVERSION=-$EXTRA modules_install 2>&1 \ - || _fail " !!! install modules failed" - fi - - - if [ -z "$KINSTALL" -o "$KINSTALL" = lilo ]; then - _log " *** reinit lilo" - _sudo /sbin/lilo 2>&1 \ - || _fail " !!! reinit lilo failed" - fi -} - -_i386_restart() -{ - if [ -z "$KINSTALL" -o "$KINSTALL" = lilo ]; then - _sudo /sbin/lilo -R $EXTRA $KERNEL_OPTIONS 2>&1 \ - || _fail " !!! lilo failed" - fi -} - -_ia64_install() -{ - echo not yet implemented -} - -_ia64_restart() -{ - echo not yet implemented -} - -_check_kernel() -{ - [ -d "$KWORKAREA" ] || _fail " !!! QA kernel workarea \"$KWORKAREA\" not found" - [ -r "$CONFIG" ] || _fail " !!! Can't read config file $CONFIG" -} - - -_log "*** XFS QA (`date`)" - -_get_state - -# check preconditions for starting state -case $1 -in - cron-init) - case $state - in - *done) - ;; - *) - _fail " !!! cron-init while not in \"*done\" state" - ;; - esac - ;; - cron-restarted) - # we don't auto restart after reboot, but cron the restart - # to happen a bit later - it's much easier and safer that way - if [ "$state" != "cron-restarted" ] - then - _fail " !!! cron-restarted while not in \"cron-restarted\" state" - fi - ;; -esac - -[ -n "$1" ] && _set_state $1 -[ -n "$2" ] && stop_state=$2 - -[ "$UID" -eq 0 ] && _fail " !!! QA most be run as a normal user" -[ -d "$ROOT" ] || _fail " !!! QA root \"$ROOT\" not found" -[ -d "$WORKAREA" ] || _fail " !!! QA workarea \"$WORKAREA\" not found" -cd $QADIR -. "$COMMON_CONFIG" || _fail " !!! Couldn't source $COMMON_CONFIG" - -_get_kernel_version -IMAGE="$BOOT/vmlinuz-$EXTRA" -SYSTEMMAP="$BOOT/System.map-$VERSION-$EXTRA" -MODULES="/lib/modules/$SVERSION" - -cd $ROOT - -started=1 -echo "auto-qa started" | wall - -while true -do - _get_state - - _log " *** state $state start (`date`)" - _log " (user=$USER, host=$HOST)" - new_state="" - - start_state=$state - - case $state - in - *init) - echo "" > $ROOT/qa.log - echo "" > $ROOT/qa.full - _log "******************************************************" - _log "QA init $VERSION (`date`)" - _log "******************************************************" - new_state="updatetools" - ;; - - *updatetools) - _update_workarea "$WORKAREA" - new_state="cleantools" - ;; - - *cleantools) - # we need to configure or else we might fail to clean - for pkg in attr acl xfsprogs xfsdump xfstests - do - [ -d $WORKAREA/$pkg ] || continue - cd $WORKAREA/$pkg - _log " *** clean $pkg tools" - make realclean 2>&1 \ - || _fail " !!! clean $pkg failed" - done - new_state="buildtools" - ;; - - *buildtools) - _log " *** build and install tools" - for pkg in attr acl xfsprogs xfsdump xfstests - do - [ -d $WORKAREA/$pkg ] || continue - cd $WORKAREA/$pkg - - make configure 2>&1 \ - || _fail " !!! configure $pkg failed" - make default 2>&1 \ - || _fail " !!! build $pkg failed" - - _sudo make install install-dev 2>&1 \ - || _fail " !!! install $pkg failed" - - # attr and acl now have install-lib targets as well - [ "$pkg" = "attr" -o "$pkg" = "acl" ] || continue - _sudo make install-lib 2>&1 \ - || _fail " !!! install $pkg failed" - done - - new_state="updatekernel" - ;; - - *updatekernel) - _check_kernel - _update_workarea "$KWORKAREA" - new_state="cleankernel" - ;; - - *cleankernel) - _check_kernel - _log " *** clean kernel" - cd "$KWORKAREA" - make mrproper 2>&1 \ - || _fail " !!! clean kernel failed" - - _log " *** install configuration file" - cp -f $CONFIG "$KWORKAREA/.config" 2>&1 \ - || _fail " !!! failed to install config" - - _log " *** remove version file" - rm -f include/linux/version.h 2>&1 \ - || _fail " !!! failed to clean version" - - new_state="reconfig" - ;; - - *reconfig) - _check_kernel - _log " *** reconfig kernel" - - # we better start from scratch if this fails - _change_state "cleankernel" - - cd "$KWORKAREA" - # we want to use default options for any new config options. - echo -e "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" | \ - make EXTRAVERSION=-$EXTRA oldconfig 2>&1 \ - || _fail " !!! reconfig oldconfig failed" - make EXTRAVERSION=-$EXTRA dep 2>&1 \ - || _fail " !!! reconfig dep failed" - - new_state="buildkernel" - ;; - - *buildkernel) - _check_kernel - _log " *** build kernel" - _log " --- kernel ($IMAGE)" - [ -z "$KMODULES" -o "$KMODULES" = yes ] && \ - _log " --- modules ($MODULES)" - - _change_state "cleankernel" ; # we better start from scratch if this fails - - cd "$KWORKAREA" - [ -z "$KTARGET" ] && KTARGET=bzImage - [ -z "$KMODULES" -o "$KMODULES" = yes ] && \ - KTARGET="$KTARGET modules" - make -j4 EXTRAVERSION=-$EXTRA $KTARGET 2>&1 \ - || _fail " !!! build $KTARGET failed" - new_state="install" - ;; - - *install) - _check_kernel - _log " *** blat old modules" - _sudo rm -rf $MODULES - - _log " *** install kernel" - cd "$KWORKAREA" - case `uname -m` - in - i386|i686) _i386_install ;; - ia64) _ia64_install ;; - esac - - new_state="restart" - ;; - - *restart) - _log " *** select qa kernel" - case `uname -m` - in - i386|i686) _i386_restart ;; - ia64) _ia64_restart ;; - esac - - _log " *** prepare to restart" - _change_state "restarted" - - _log " *** restarting" - - _restart # doesn't return - ;; - - *restarted) - _log " *** QA reentered after restart" - - new_state="check" - ;; - - *check) - uname=`uname -a` - _log " *** uname $uname" - - if [ "$MODULAR" -eq 0 ]; then - new_state="reset" - else - new_state="probe" - fi - ;; - - *probe) - _log " *** modules dependencies" - _sudo depmod -a 2>&1 \ - || _fail " !!! failed to depmod -a" - - _log " *** unmounting XFS mounts" - _sudo umount -a -t xfs 2>&1 - - _log " *** removing modules" - for m in xfsidbg xfs kdbm_pg kdbm_vm - do - _sudo rmmod $m 2> /dev/null - done - - _log " *** installing modules" - _sudo modprobe xfs 2>&1 \ - || _fail " !!! failed to modprobe xfs" - - new_state="reset" - ;; - - *reset) - - _log " *** unmounting TEST_DEV" - _sudo umount $TEST_DEV 2>&1 - - _log " *** unmounting SCRATCH_DEV" - _sudo umount $SCRATCH_DEV 2>&1 - - _log " *** clean TEST_DEV" - _test_mkfs_xfs 2>&1 \ - || _fail " !!! failed to mkfs TEST_DEV" - - _log " *** mounting TEST_DEV" - _test_mount 2>&1 \ - || _fail " !!! failed to mount" - - new_state="run" - ;; - - soak-run) - cd $QADIR - - _log " *** run soak test" - _sudo ./soak $SOAK_PASSES $SOAK_STRESS $SOAK_PROC \ - || _fail " !!! failed to run soak test" - - new_state="done" - ;; - - bench-run) - cd $QADIR - - # $BENCHMARK is typically unset, which equates to "all" - # - _log " *** run benchmarks" - _sudo ./bench $BENCH_PASSES `id -nu && id -ng` $BENCHMARK \ - || _fail " !!! failed to run benchmarks" - - _log "" - _log " *** send results mail" - mail -s "XFS QA benchmark results" $EMAIL < $QADIR/bench.out 2>&1 - - new_state="done" - ;; - - *run) - cd $QADIR - - _log " *** run tests ($CHECK_OPTIONS)" - _sudo ./check -l $CHECK_OPTIONS 2>&1 | tee $ROOT/qa.out - - _log "" - _log " *** send status mail" - mail -s "XFS QA status report" $EMAIL < $ROOT/qa.out 2>&1 - - new_state="done" - ;; - - *done) - _log "*** requested QA state transitions complete" - - _success - ;; - - *nothing) - new_state="done" - _log " *** do nothing" - ;; - - *) - _fail " !!! unknown state $state" - ;; - esac - - _log " *** state $state done (`date`)" - [ "$new_state" = "" ] && _fail " !!! no new state set" - - if [ -n "$stop_state" ] - then - # remove hyphen prefixes - s1=`echo $start_state | sed 's/.*-//'` - s2=`echo $stop_state | sed 's/.*-//'` - - if [ $s1 = $s2 ] - then - # we have been requested to stop here and not go on - new_state="done" - fi - fi - - _change_state $new_state - -done From patchwork Thu Mar 6 21:34:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 14005372 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 4D3EE151990 for ; Thu, 6 Mar 2025 21:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741297170; cv=none; b=fz96+WtLaudnZM2o3mLaYeiPV7qAyv5AqaTwn1OvUDjUwnN9sBpdJdoH7llPC70jFyYQ7bl5OGhVyQ36PjaXER78kvMW5lcd+HjhIx7tAIAYNuFi4NZreZ1l96qKRcjeYpib7KXODY9Lc9zn0XpE21D+EN2pjtk1paXzrEsGcDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741297170; c=relaxed/simple; bh=gRnYCy3DvomvqWbtKnCfD6lpOqN/3Vy6waQ7ojnGeTk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R2/ihzO+ilt87jiIubWhtkUgexzIZVLO6LuDmGiGR77XwxrhuCjUyjEKVH8SubOxGI4MGYq15w5yt4kYQB6sdStHYu7dR2XaZYTimayHTO20NU9VsJkfIo1AJNV7yRNHPPoh83FrOpUB2xujxl7t0XRT/qlhvxNNfvZhD2PcDU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=3a3E4A9j; arc=none smtp.client-ip=209.85.216.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="3a3E4A9j" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2fea47bcb51so2530333a91.2 for ; Thu, 06 Mar 2025 13:39:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1741297167; x=1741901967; darn=vger.kernel.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; bh=l3wE2ibZn5SufygRU4N/xIesL05h8ucm7NvbROm039k=; b=3a3E4A9jLbpQoXXAtX0FvC05M3eAEIXEExLV7FsiCSMKIrypZTvY7XIsU6OVqaTbm7 CKTrzFHN5vUSzrdAfU0nqLgow41DH2QE+gWva5TP0cR8PhhhVkz7/IzPdTz6VDnNbz7U lP7cYfij4Za3NQbX8rVzEMxiUOYiwmI29URLObvF0KykWnmX5UNyoX9gcfujdNG3H1ho aysU98pZ+ggATlEQ73VOWZ5zUQ2xVZ5CwBLARD8lECQmBLzBEahF/8a/SRmmHyFPwdJE /A7RSCaCNalOYkW5hhV6k2jr8iMzONle+Y2BlIR7D54VUxWm04GHMtrsTXmcxdKIHWMW L25g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741297167; x=1741901967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l3wE2ibZn5SufygRU4N/xIesL05h8ucm7NvbROm039k=; b=xQfoPG2eI0LpJLHBh7TlPCddxjvLkYsGtCleZTh5JTnnzr+JKFFWldO0ZaCBKZEsL7 MrmfLiU6WWZr5Yh4w/6dpeI/BT6omoKgUytRD/lWb+YsGfrjUv+n9EAoJV4ERtRgs7gC Il7JM3rge94MH2a7ecXCdx+3P46j7R4jFiSIbsE91QShnzQIXzP77fNmuSdXOVtCsMNT RLBccR0nW2SPfHMenaiqUng9Gk0ouzNuiCoPHlrSNinUvzY4aNj3w+TE1G5QqLJ89d9k OnePdtZo1pMEBknqG1vijBywwz2lCfxH9TJX/cUg9ch03+wUpcc2WYUh7oqwMOmlfsE7 NhEw== X-Gm-Message-State: AOJu0YwbeDU8DCY4h3a/5wWhMZGJDLbkvdOrME3XfMPZWi6K11yp5nfD sizKdnAiNy/Sb9jSosFGyZkuxtVPxoLzuOk2xjfR3kN/LGeSK31XMl9lZDhiOxAqbVay11d4deW N X-Gm-Gg: ASbGncvnDzuq3FHCWOaEUuHb46suZDINqcWy5ncI+LmJAm7hvJhfwaoCwZEpvz9ZY/q aQDNsiz4apD5o8jW9ZVJTjJmN/btvHQPWntbbZLSc87QtiYxABz/l+rxq2Q/FXNFUZulcKslCWr 9id3BNvDnWvY2z0ocdRhYkL7ZLn//t/lCFBUM77xQXTSokvklQDV2wuUxyCXjaJqiLKZKJ4Fgdd PEpyyU/E6b+W/HcqSdY0T6M/u20PZ95hHrZzKKeSCUMrYbQyqP1GFxjo9NJLEyijjbKvKKbD1DZ wHtdpAhThjCkCTv21VoTdUcAemoJJs9OawFOnKLDWWSgwn1QviFUgRGvpszVrGdAj1nGFL6ZXDp d1xWWLdlVSHCve/YC/rI= X-Google-Smtp-Source: AGHT+IEUjcxwI6mG0oWTYzVwb51HUiLOUegszjHpEdbR5hciEfJuNmVvJvl9vK/fU5UVdfa5Nj7QAQ== X-Received: by 2002:a17:90b:1b0b:b0:2fc:c262:ef4b with SMTP id 98e67ed59e1d1-2ff7cea9a99mr1489556a91.18.1741297167421; Thu, 06 Mar 2025 13:39:27 -0800 (PST) Received: from dread.disaster.area (pa49-186-89-135.pa.vic.optusnet.com.au. [49.186.89.135]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ff693e75ccsm1738812a91.32.2025.03.06.13.39.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 13:39:27 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tqIw6-00000009lRh-2hKy for fstests@vger.kernel.org; Fri, 07 Mar 2025 08:39:22 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tqIw6-0000000Fvrc-3anL for fstests@vger.kernel.org; Fri, 07 Mar 2025 08:39:22 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 5/5] fstests: remove old tools from tools directory Date: Fri, 7 Mar 2025 08:34:50 +1100 Message-ID: <20250306213921.3769440-6-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250306213921.3769440-1-david@fromorbit.com> References: <20250306213921.3769440-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner ag-wipe, db-walk, fs-walk and interop are all old 2000s era SGI QA scripts that are either not usable anymore of have been superceded by much more recent functionality. interop only runs on machines with the host named "bruce" or "whack", requires NFS mounts from a machine named "snort" and access to a specific user's home dir. I know what all these were; they were test and build machines in SGI's engineering office in Melbourne, Australia. That went away in ~2009.... ag-wipe is unused and has been superceded by multiple different sets of functionality (e.g. ./check --large-fs). db-walk is unused by fstests and now is native xfs_db functionality. fs-walk is dumping the md5sum and stat info of every file in a directory heirachy and only used by the interop script.... Remove them all. Signed-off-by: Dave Chinner --- tools/ag-wipe | 171 ------------------------------------------------ tools/db-walk | 178 -------------------------------------------------- tools/fs-walk | 85 ------------------------ tools/interop | 101 ---------------------------- 4 files changed, 535 deletions(-) delete mode 100755 tools/ag-wipe delete mode 100755 tools/db-walk delete mode 100755 tools/fs-walk delete mode 100755 tools/interop diff --git a/tools/ag-wipe b/tools/ag-wipe deleted file mode 100755 index 52acf0f80..000000000 --- a/tools/ag-wipe +++ /dev/null @@ -1,171 +0,0 @@ -#!/usr/bin/perl -w -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2003-2004 Silicon Graphics, Inc. All Rights Reserved. -# -use strict; -use IO::File; -use Getopt::Std; -# -# -# Modify a filesystem's superblock and AGF metadata structures -# so that only a subset of the allocation groups will be used. -# Intended use is in testing large virtual devices (eg. loop) -# with extremely large filesystems, where we want to ensure -# high allocation groups are used as much as possible (where -# the block addresses are large). -# - -my %opt; -getopts('cf:l:qr:v', \%opt); - -die "Usage: $0 [-f AG] [-l AG] [-r bytes] [-cqv] device\n" unless (@ARGV == 1); -my $device = shift @ARGV; -die "$device: no such file\n" unless (-e $device); - -my $clearall = defined($opt{'c'}) ? 1 : 0; -my $retain = defined($opt{'r'}) ? $opt{'r'} : -1; -my $quiet = defined($opt{'q'}) ? 1 : 0; -my $verbose = defined($opt{'v'}) ? 1 : 0; -my $nagfirst = defined($opt{'f'}) ? $opt{'f'} : 0; -my $naglast = defined($opt{'l'}) ? $opt{'l'} : 0; - -# -# "clearall" means clear everything barring the final AG. -# "retain" means clearall and retain a specified amount in the -# second-from-last AG as well (value is the number of bytes). -# [NB: retain with a value of zero is now the same as clearall]. -# -if ($retain >= 0) { - $clearall = 1; -} - -sub xfs_db { - my $xfsdb = 'xfs_db -x'; - my %hash; - - foreach (@_) { - $xfsdb .= ' -c ' . $_; - } - print $xfsdb, ' ', $device, "\n" if ($verbose); - - die unless open(DB, "$xfsdb $device 2>/dev/null |"); - while () { - if (/^(\S+) = (.*)$/) { - print if ($verbose); - $hash{$1} = $2; - } - } - return %hash; -} - - -# -# Stage 1: Get control information from the superblock -# - -my @sbprint = ( '"print fdblocks"', '"print agcount"', '"print blocksize"' ); -my @agffree = ( '"print freeblks"' ); - -my %sb = xfs_db 'sb', @sbprint; -print "=== Initially ", $sb{'fdblocks'}, " blocks free across ", - $sb{'agcount'}, " AGs\n" unless $quiet; -if ($clearall && ($nagfirst || $naglast)) { - print STDERR " o Clearall/retain specified with first/last AG\n"; - exit(1); -} -if ($nagfirst >= $sb{'agcount'}) { - print STDERR " o First AG number is too large\n"; - exit(1); -} -if ($naglast >= $sb{'agcount'}) { - print STDERR " o Last AG number is too large\n"; - exit(1); -} -if ($naglast - $nagfirst < 0) { - print STDERR " o No AGs to clear\n"; - exit(1); -} -if ($clearall) { - $naglast = $sb{'agcount'} - 2; - if ($retain > 0) { - my %check; - - $naglast--; - $retain /= $sb{'blocksize'}; # convert to fsblocks - %check = xfs_db "'agf $naglast'", @agffree; - if ($check{'freeblks'} < $retain) { - print STDERR " o Insufficient space to retain\n"; - exit(1); - } - } -} - - -# -# Stage 2: Wipe out all completely masked allocation groups. -# - -my @agfprint = ( '"print freeblks"', '"print flcount"' ); -my @agfcommands = ( '"write freeblks 0"', - '"write longest 0"', '"write flcount 0"', - '"write bnolevel 1"', '"write cntlevel 1"', - '"write flfirst 0"', '"write fllast 0"' ); -my @bnoprint = ( '"addr bnoroot"', '"print numrecs"' ); -my @bnocommands = ( '"addr bnoroot"', '"write numrecs 0"', - '"write leftsib -1"', '"write rightsib -1"' ); -my @cntprint = ( '"addr cntroot"', '"print numrecs"' ); -my @cntcommands = ( '"addr cntroot"', '"write numrecs 0"', - '"write leftsib -1"', '"write rightsib -1"' ); - -print "=== Wiping ", $naglast - $nagfirst + 1, - " AGs starting from AG #", $nagfirst, "\n" unless $quiet; - -my $ag = $nagfirst; -while ($ag <= $naglast) { - print " o AG#", $ag, " AGF fields\n" unless $quiet; - - my %agf = xfs_db "'agf $ag'", @agfprint; - xfs_db "'agf $ag'", @agfcommands; - - my $blockcnt = $agf{'freeblks'} + $agf{'flcount'}; - $sb{'fdblocks'} -= $blockcnt; - print " cleared ", $blockcnt, " blocks from AG#", $ag, "\n" - unless $quiet; - - my %btree = xfs_db "'agf $ag'", @bnoprint; - xfs_db "'agf $ag'", @bnocommands, "'agf $ag'", @cntcommands; - print " cleared ", $btree{'numrecs'}, " BNO/CNT btree recs in AG#", - $ag, "\n" unless $quiet; - - $ag++; -} - - -# -# Stage 3: Wipe out any partially masked allocation group. -# - -if ($retain > 0) { - print " o AG#", $ag, " AGF fields (partial)\n" unless $quiet; - - my %ragf = xfs_db "'agf $ag'", '"print freeblks"', - '"addr bnoroot"', '"print recs[1].startblock"'; - my $maskblks = $ragf{'freeblks'} - $retain; - my $newstart = $ragf{'recs[1].startblock'} + $maskblks; - xfs_db "'agf $ag'", - "'write freeblks $retain'", "'write longest $retain'", - "'agf $ag'", '"addr bnoroot"', - "'write recs[1].startblock $newstart'", - "'write recs[1].blockcount $retain'", - "'agf $ag'", '"addr cntroot"', - "'write recs[1].startblock $newstart'", - "'write recs[1].blockcount $retain'"; - - $sb{'fdblocks'} -= $maskblks; - print " cleared ", $maskblks, " blocks from AG#", $ag, "\n" - unless $quiet; -} - -print "=== Updating final freespace count, ", $sb{'fdblocks'}, " blocks\n" - unless $quiet; -xfs_db "'sb 0'", "'write fdblocks $sb{'fdblocks'}'" diff --git a/tools/db-walk b/tools/db-walk deleted file mode 100755 index e09920559..000000000 --- a/tools/db-walk +++ /dev/null @@ -1,178 +0,0 @@ -#!/usr/bin/perl -w -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. -# -# use db to try to traverse the entire filesystem starting at the root -# -my $device; -my $rootino; -my $agcount; -my $versionnum; -my $dir_version; -my @dir_inodes; -my @bmap_blocks; -my @block_inodes; -my $mode; - -sub db($) -{ - my ($args)=@_; - my ($ret); - - $ret=`xfs_db -r $args $device 2> /dev/null`; - die "ERROR executing xfs_db -r $args $device" if ($?); - - return $ret; -} - -sub fmt($) -{ - my ($text)=@_; - my $c=0; - print " "; - foreach (split("\n",$text)) { - s/^core\.//; - - if ($c+length($_) >= 70) { - $c=0; - print ",\n "; - } - if ($c) { - print ", "; - $c+=2; - } - print "$_"; - $c+=length($_)+2; - } - print "\n"; -} - -sub inode($) -{ - my ($num)=@_; - my ($t); - - @dir_inodes=(); - - $t=db("-c \"inode $num\" -c \"print\""); - print " *** Inode $num\n"; - fmt($t); - - ($mode)= $t=~ /^core.mode = (\d+)$/m; - - if ($t=~ /a\.bmx/m) { - bmap("inode $num","attr"); - foreach (@bmap_blocks) { - attr_block($_); - } - } - if (eval "$mode & 040000") { - if ( $t=~ /sfdir/m) { - while ($t=~ /inumber(?:\.i[48])? = (\d+)$/mg) { - push(@dir_inodes,$1); - } - } - if ( $t=~ /u\.bmx/m) { - bmap("inode $num","dir"); - foreach (@bmap_blocks) { - dir_block($_); - push(@dir_inodes,@block_inodes); - } - } - } else { - bmap("inode $num","file") if ( $t=~ /u\.bmx/m); - } -} - -sub bmap($$) -{ - my ($cmd,$type)=@_; - my ($t); - - @bmap_blocks=(); - - $flag=($type eq "attr")?"-a":""; - - $t=db("-c \"$cmd\" -c \"bmap $flag\""); - print " *** bmap $type $cmd\n"; - fmt($t); - - if ($type eq "dir" || $type eq "attr") { - while ($t=~ /startblock (\d+) \(.+\) count (\d+)/mg) { - for ($b=$1;$b<$1+$2;$b++) { - push(@bmap_blocks,$b); - } - } - } -} - -sub dir_block($) -{ - my ($num)=@_; - my ($t); - - @block_inodes=(); - - $type=($dir_version==2)?"dir2":"dir"; - - $t=db("-c \"fsblock $num\" -c \"type $type\" -c \"print\""); - print " *** $type block $num\n"; - # need to drop . and .. - ($self)= $t=~ /\[(\d+)\].name = \"\.\"/m; - ($parent)= $t=~ /\[(\d+)\].name = \"\.\.\"/m; - fmt($t); - - - while ($t=~ /\[(\d+)\].inumber = (\d+)/mg) { - next if (defined $self && $1 == $self); - next if (defined $parent && $1 == $parent); - push(@block_inodes, $2); - } -} - -sub attr_block($) -{ - my ($num)=@_; - my ($t); - - $t=db("-c \"fsblock $num\" -c \"type attr\" -c \"print\""); - print " *** attr block $num\n"; - - fmt($t); -} - -sub sb($) -{ - my ($num)=@_; - my ($t); - - $t=db("-c \"sb $num\" -c \"print\""); - print " *** SB $num\n"; - fmt($t); - - ($rootino)= $t=~ /^rootino = (\d+)$/m; - ($agcount)= $t=~ /^agcount = (\d+)$/m; - ($versionnum)= $t=~ /^versionnum = (0x[\da-f]+)$/m; - $dir_version = (eval "$versionnum & 0x2000")?2:1; -} - -die "Usage: $0 \n" unless (@ARGV == 1); - -$device=shift @ARGV; -die "can't read $device\n" unless (-r $device); -die "$device is not a block device\n" unless (-b _); - -chomp($HOST = `hostname -s`); - -print "*** db-walk host $HOST device $device\n"; - -sb(0); -for ($ag=1;$ag<$agcount;$ag++) { - sb($ag); -} - -@inodes=($rootino); -while ($_ = shift @inodes) { - inode($_); - push(@inodes,@dir_inodes); -} diff --git a/tools/fs-walk b/tools/fs-walk deleted file mode 100755 index 918e1ad67..000000000 --- a/tools/fs-walk +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/perl -w -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. -# -# traverse the entire filesystem dumping info. -# -use MD5; -use Getopt::Std; - -my %opt; - -sub scan($) -{ - my ($file)=@_; - my ($md5)=new MD5; - my (@stat); - - unless (@stat=lstat("$file")) { - printf("%-" . ($opt{v}?65:32) . "s $file\n", "!!! could not lstat"); - return; - } - - $stat[0]=$stat[8]=""; # wipe the device and access time - $md5->reset; - $md5->add(join(" ",@stat)); - - print join(" ",@stat), "\n"; - - if ($opt{v}) { - print $md5->hexdigest . " "; - $md5->reset; - } - - if (-l "$file") { - if (!defined($link = readlink $file)) { - printf("%-32s $file\n", "!!! could not readlink"); - return; - } - $md5->add($link); - } elsif (-f "$file") { - if (!open(FILE, "$file")) { - printf("%-32s $file\n", "!!! could not read"); - return; - } - $md5->addfile(FILE); - close (FILE); - } - print $md5->hexdigest . " $file\n"; -} - -getopts('vs', \%opt); - -die "Usage: $0 \n" unless (@ARGV == 1); - -$dir=shift @ARGV; -die "can't read $dir\n" unless (-r $dir); -die "$dir is not a directory\n" unless (-d _); - -chomp($HOST = `hostname -s`); - -print "*** fs-walk host $HOST dir $dir\n"; - -@todo=$dir; -while ($dir = shift @todo) { - scan($dir); - unless (opendir(DIR,$dir)) { - printf("%-" . ($opt{v}?65:32) . "s $dir\n", "!!! could not opendir"); - next; - } - unless (@all=readdir(DIR)) { - printf("%-" . ($opt{v}?65:32) . "s $dir\n", "!!! could not readdir"); - next; - } - closedir(DIR); - @dirs=grep(-d "$dir/$_" && !-l "$dir/$_", @all); - foreach (@all) { - next if /^\.\.?$/; - scan("$dir/$_"); - } - - foreach (grep(!/^\.\.?$/, @dirs)) { - push (@todo,"$dir/$_"); - } -} - diff --git a/tools/interop b/tools/interop deleted file mode 100755 index dc1652c2b..000000000 --- a/tools/interop +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/sbin/perl -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2001 Silicon Graphics, Inc. All Rights Reserved. -# -sub setup() -{ - $PATH="$PATH:/usr/local/bin/ptools:/sbin:/usr/sbin"; - $DISPLAY="clouds:0"; - - if ("$HOST" eq "bruce") { - $TOOLS="/home/dxm/isms/slinx-xfs/cmd/xfs/tools"; - $SCRATCH_DEV="/dev/sdf1"; - $SCRATCH_MNT="/mnt/xfs3"; - $MKFS="/sbin/mkfs -t xfs -f"; - $SUDO="/home/dxm/su -c"; - $MOUNT="/bin/mount -t xfs"; - $UMOUNT="/bin/umount"; - $MKFS_EXTRA="-f"; - } elsif ("$HOST" eq "whack") { - $TOOLS="/hosts/snort/build1/people/dxm/isms/slinx-xfs/cmd/xfs/tools"; - $SCRATCH_DEV="/dev/dsk/20000080e5114459/lun2s0/c2p1"; - $SCRATCH_MNT="/lun2"; - $MKFS="/sbin/mkfs"; - $SUDO="su root -c"; - $MOUNT="/sbin/mount -t xfs"; - $UMOUNT="/sbin/umount"; - $MKFS_EXTRA=""; - } else { - die "unconfigured host \"$HOST\"\n" - } -} - -sub run_no_check(@) -{ - system(@_); -} - -sub run(@) -{ - system(@_) == 0 - || die "ERROR \"" . join(" ",@_) . "\" returned error\n"; -} - -sub run_expect_fail(@) -{ - system(@_) == 0 - && die "ERROR \"" . join(" ",@_) . "\" returned non-error\n"; -} - -sub umount_no_check() -{ - run_no_check("umount $SCRATCH_DEV"); -} - -sub umount() -{ - run("umount $SCRATCH_DEV"); -} - -sub mount($) -{ - my ($ops)=@_; - run("mount -t xfs $ops $SCRATCH_DEV $SCRATCH_MNT"); -} - -chomp($HOST=`hostname -s`); - -die "usage: $ARGV0 [parameters]\n" unless (scalar(@ARGV)); -print "*** $HOST: Interop started\n"; -print " *** ", join(" ", @ARGV), "\n"; - -setup(); - -$op=shift(@ARGV); - -umount_no_check(); - -if ($op eq "init") { - - run("mkfs -t xfs $MKFS_EXTRA $SCRATCH_DEV"); - -} elsif ($op eq "test") { - - run("xfs_repair -n $SCRATCH_DEV"); - -} elsif ($op eq "easy") { - - mount(""); - system("mount"); - mkdir("$SCRATCH_MNT/fish",0777); - -} elsif ($op eq "check") { - - mount("-o ro"); - system("cd $SCRATCH_MNT ; $TOOLS/fs-walk ."); - -} else { - die "unknown operation \"$op\"\n"; -} - -umount_no_check();