From e7157b6f20a1f1fc1248ab9cfa75b0e93a49d7be Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 11:43:47 -0500 Subject: [PATCH 01/27] Claude cleanup: Fix eval set --$opts to be eval set -- "$opts" --- convert_csv_to_txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert_csv_to_txt b/convert_csv_to_txt index 73dd460..9fdff71 100755 --- a/convert_csv_to_txt +++ b/convert_csv_to_txt @@ -53,7 +53,7 @@ if [ $? -ne 0 ]; then exit fi -eval set --$opts +eval set -- "$opts" field_seper="" field_size="" From f3c8e4a61564d0aced3e087e0616912461edf526 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 11:47:27 -0500 Subject: [PATCH 02/27] Replace field_seper with field_separator and fix issue claude found. --- convert_csv_to_txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/convert_csv_to_txt b/convert_csv_to_txt index 9fdff71..046f929 100755 --- a/convert_csv_to_txt +++ b/convert_csv_to_txt @@ -21,7 +21,7 @@ usage() { echo Usage $0 - echo " --field_seper : character separator" + echo " --field_separator : character separator, default is :" echo " --field_size : size of the fields in the output" echo " --results_in : file converting" echo " --results_out : file to output the results to." @@ -30,7 +30,7 @@ usage() ARGUMENT_LIST=( - "field_seper" + "field_separator" "field_size" "results_in" "results_out" @@ -55,15 +55,15 @@ fi eval set -- "$opts" -field_seper="" +field_separator=":" field_size="" results_in="" results_out="" while [[ $# -gt 0 ]]; do case "$1" in - --field_seper) - field_seper=$2 + --field_separator) + field_separator=$2 shift 2 ;; --field_size) @@ -98,11 +98,11 @@ done rm -rf $results_out while IFS= read -r line do - if [[ $line != *":"* ]]; then + if [[ $line != *"${field_separator}"* ]]; then echo $line >> $results_out continue fi - break_down=`echo $line | sed "s/ /_/g" | sed "s/${field_seper}/ /g"` + break_down=`echo $line | sed "s/ /_/g" | sed "s/${field_separator}/ /g"` for i in $break_down; do printf "%${field_size}s" $i >> $results_out done From a1e552d4dff9d53b70ebee4372b296613ddad3c1 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 11:48:59 -0500 Subject: [PATCH 03/27] Claude: found issue with rm -rf, fixed. --- convert_csv_to_txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/convert_csv_to_txt b/convert_csv_to_txt index 046f929..cd01672 100755 --- a/convert_csv_to_txt +++ b/convert_csv_to_txt @@ -95,7 +95,9 @@ while [[ $# -gt 0 ]]; do esac done -rm -rf $results_out +if [[ $results_out -ne "" ]]; then + rm -rf $results_out +fi while IFS= read -r line do if [[ $line != *"${field_separator}"* ]]; then From 0c1d18141c03c1778eec03c17cff5e54871e1df8 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 11:50:49 -0500 Subject: [PATCH 04/27] Claude issue: Pointed out 3 variable locations that should be in qoutes. --- convert_csv_to_txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/convert_csv_to_txt b/convert_csv_to_txt index cd01672..281afb8 100755 --- a/convert_csv_to_txt +++ b/convert_csv_to_txt @@ -100,13 +100,13 @@ if [[ $results_out -ne "" ]]; then fi while IFS= read -r line do - if [[ $line != *"${field_separator}"* ]]; then + if [[ "$line" != *"${field_separator}"* ]]; then echo $line >> $results_out continue fi - break_down=`echo $line | sed "s/ /_/g" | sed "s/${field_separator}/ /g"` + break_down=`echo "$line" | sed "s/ /_/g" | sed "s/${field_separator}/ /g"` for i in $break_down; do - printf "%${field_size}s" $i >> $results_out + printf "%${field_size}s" "$i" >> $results_out done printf "\n" >> $results_out done < "$results_in" From d52172e0ee739fcd6e3d6ce80ea6958fbf7efed1 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 11:55:01 -0500 Subject: [PATCH 05/27] Claude Review: finish up remaining issues found by claude. --- convert_csv_to_txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/convert_csv_to_txt b/convert_csv_to_txt index 281afb8..3fa0b29 100755 --- a/convert_csv_to_txt +++ b/convert_csv_to_txt @@ -20,7 +20,6 @@ usage() { - echo Usage $0 echo " --field_separator : character separator, default is :" echo " --field_size : size of the fields in the output" echo " --results_in : file converting" @@ -82,7 +81,7 @@ while [[ $# -gt 0 ]]; do usage ;; -h) - usage "0" + usage shift 1 ;; --) @@ -95,6 +94,10 @@ while [[ $# -gt 0 ]]; do esac done +if [[ $field_size == "" ]] || [[ $results_in == "" ]] || [[ $results_out == "" ]]; then + echo Error: one or more fields are not set, field_size, results_in or results_out. + exit 1 +fi if [[ $results_out -ne "" ]]; then rm -rf $results_out fi @@ -110,3 +113,4 @@ do done printf "\n" >> $results_out done < "$results_in" +exit 0 From e5935045f9365b96ca84e187244e5031d262a9ba Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 12:54:46 -0500 Subject: [PATCH 06/27] Do not modify lines that are comments (start with #) --- convert_csv_to_txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert_csv_to_txt b/convert_csv_to_txt index 3fa0b29..6e55d47 100755 --- a/convert_csv_to_txt +++ b/convert_csv_to_txt @@ -103,7 +103,7 @@ if [[ $results_out -ne "" ]]; then fi while IFS= read -r line do - if [[ "$line" != *"${field_separator}"* ]]; then + if [[ "$line" == "#"* ]] || [[ "$line" != *"${field_separator}"* ]]; then echo $line >> $results_out continue fi From 02abcfa796afadf3160424066791bc508369c9e7 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 13:00:26 -0500 Subject: [PATCH 07/27] Claude bugs: Fix issues pointed out by claude. --- convert_val | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/convert_val b/convert_val index cafe7bc..8169242 100755 --- a/convert_val +++ b/convert_val @@ -79,7 +79,7 @@ opts=$(getopt \ -- "$@" ) -eval set --$opts +eval set -- "$opts" if [ $? -ne 0 ]; then exit 1 @@ -150,7 +150,7 @@ cnvt_to_bytes() if [[ $lunit == "B" ]] || [[ $lunit == "b" ]]; then base_value=1 else - if [[ $lunit =~ [K,M,G,T] ]] && [[ $lunit != *"i"* ]]; then + if [[ $lunit =~ [KMGT] ]] && [[ $lunit != *"i"* ]]; then base_value=`numfmt --from=si 1${lunit}` if [[ $? -ne 0 ]]; then echo Error: Invalid unit $lunit From 99d4093b478138a011b3be17e44789725a11e612 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 13:01:50 -0500 Subject: [PATCH 08/27] Update usage value. --- convert_val | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert_val b/convert_val index 8169242..901d6cd 100755 --- a/convert_val +++ b/convert_val @@ -45,7 +45,7 @@ usage() echo "$ $1 --from_unit Mi --value 1024 --to_unit Gi" echo "1Gi" echo "$ $1 --from_unit Mi" - echo "1000000B" + echo "1048576B" echo "$ $1 --time_val --from_unit s --value 10 --to_unit ms" echo "10000ms" echo "$ $1 --time_val --from_unit s --value 60 --to_unit m" From 91fc24fd738057814530d92ba4e6748ff9be7e6a Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 13:08:06 -0500 Subject: [PATCH 09/27] Calude updates: Correct issues claude pointed out in create_filesystem --- create_filesystem | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/create_filesystem b/create_filesystem index e2cfa16..7c5cae6 100755 --- a/create_filesystem +++ b/create_filesystem @@ -44,11 +44,11 @@ validate_data() echo Designated device, $device_to_use, does not exist exit 1 fi - if [[ mount_pnt = "" ]]; then + if [[ $mount_pnt = "" ]]; then echo You need to designate a mount point. exit 1 fi - if [[ fs_type = "" ]]; then + if [[ $fs_type = "" ]]; then echo You need to designate a filesys type. exit 1 fi @@ -79,7 +79,7 @@ opts=$(getopt \ if [ $? -ne 0 ]; then exit fi -eval set --$opts +eval set -- "$opts" while [[ $# -gt 0 ]]; do case "$1" in @@ -93,7 +93,7 @@ while [[ $# -gt 0 ]]; do ;; --mount_dir) mount_pnt=${2} - mkdir -p $mount_pnt + mkdir -p "$mount_pnt" shift 2 ;; --usage) @@ -134,7 +134,7 @@ case $fs_type in MKFS_OPS="-f" ;; *) - echo Error, $1 unknown filesystem type + echo Error, $fs_type unknown filesystem type exit 1 ;; esac @@ -143,7 +143,7 @@ mkfs -t ${fs_type} ${MKFS_OPS} ${device_to_use} if [ $? -ne 0 ]; then exit 1 fi -mount ${device_to_use} ${mount_pnt} +mount ${device_to_use} "${mount_pnt} " if [ $? -ne 0 ]; then exit 1 fi From af6443e5765f3e73436900c4967416bd9b1db7b0 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 14:47:44 -0500 Subject: [PATCH 10/27] Remove space in mount line. --- create_filesystem | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_filesystem b/create_filesystem index 7c5cae6..a3c9d83 100755 --- a/create_filesystem +++ b/create_filesystem @@ -143,7 +143,7 @@ mkfs -t ${fs_type} ${MKFS_OPS} ${device_to_use} if [ $? -ne 0 ]; then exit 1 fi -mount ${device_to_use} "${mount_pnt} " +mount ${device_to_use} "${mount_pnt}" if [ $? -ne 0 ]; then exit 1 fi From 80c3bfccd8329d4c022ef7058e539edd74f4f9c4 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 15:20:01 -0500 Subject: [PATCH 11/27] Claude: clear out issues pointed out by claude. --- detect_numa | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/detect_numa b/detect_numa index ec31c7c..26c523f 100755 --- a/detect_numa +++ b/detect_numa @@ -68,7 +68,7 @@ fetch_cpus() { local node_count=`get_num_nodes` local prefix="NUMA node" - if [ `has_numa` -eq 0 ]; then # Return all syste + if [ `has_numa` -eq 0 ]; then # Return all system CPUs. prefix="On-line CPU\(s\) list:" node="" elif [ -z "$node" ]; then # Used to filter out "NUMA node(s)" line @@ -112,7 +112,7 @@ if [ $? -ne 0 ]; then exit 1 fi -eval set --$opts +eval set -- "$opts" while [[ $# -gt 0 ]]; do case "$1" in @@ -121,16 +121,13 @@ while [[ $# -gt 0 ]]; do ;; -n | --node) node=$2 + get_nodes=1 shift 2 ;; --list-cpu | --cpu-list) get_cpus=1 shift 1 ;; - -n | --node-count) - get_nodes=1 - shift 1 - ;; -i | --input) lscpu_command=$2 shift 2 @@ -143,7 +140,7 @@ while [[ $# -gt 0 ]]; do break ;; *) - echo_stderr Unknown option $1 + echo Unknown option $1 >&2 exit 1 ;; esac From e9943eeef88718e278a11e78d469c18b3d04b15d Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 15:36:09 -0500 Subject: [PATCH 12/27] Claude: Fix issues uncovered when claude was asked to find bugs in detect_os. --- detect_os | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/detect_os b/detect_os index 6d18336..07ded44 100755 --- a/detect_os +++ b/detect_os @@ -54,7 +54,6 @@ echo_stderr() parse_os_release() { source $os_release_file - has_major_minor=0 if [[ $get_version -eq 1 ]]; then if [[ "$VERSION_ID" == *"${vers_sep}"* ]]; then major_version=$(echo $VERSION_ID | cut -d${vers_sep} -f1) @@ -105,7 +104,7 @@ if [ $? -ne 0 ]; then exit 1 fi -eval set --$opts +eval set -- "$opts" flag_set=0 From 26d6a44bfa675294d4be3c3971c9004c5223181d Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 15:42:00 -0500 Subject: [PATCH 13/27] Claude: Fix bug claude found when asked to look for bugs. --- gather_data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gather_data b/gather_data index e5d5601..de49e3a 100755 --- a/gather_data +++ b/gather_data @@ -24,7 +24,7 @@ echo ============================================== echo General information echo ============================================== echo system name: `hostname` -echo release: `cat /etc/*release | grep PRETTY_NAME | cut -d'"' -f 2`a `uname -a | cut -d ' ' -f 3` +echo release: `grep PRETTY_NAME /etc/*release | cut -d'"' -f 2` # # Hardware information # From 9e4131b287bfd42277dcc5d142865c76b718d367 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 15:59:06 -0500 Subject: [PATCH 14/27] Claude review: Clean up issues claude found when asked to look for bugs. --- general_setup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/general_setup b/general_setup index e722c64..31ef637 100755 --- a/general_setup +++ b/general_setup @@ -126,10 +126,12 @@ do shift 2 ;; --iteration_default) + i=$((i + 2)) iteration_default=$value shift 2 ;; --no_pkg_install) + i=$((i + 1)) to_no_pkg_install=1 shift 1 ;; @@ -235,7 +237,7 @@ which tuned-adm >> /dev/null 2>&1 if [[ $? -ne 0 ]]; then echo tuned-adm not available > ~/tuned_before else - tuned-adm active | cut -d: -f 2 | sed "s/ //g" > ~/tuned_before + tuned-adm active | cut -d: -f 2 | sed "s/ //g" > ~/tuned_before fi if [[ $to_test_verify_file != "" ]]; then From f715512341b83d93aa60b493e796e414453c3f74 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 16:09:26 -0500 Subject: [PATCH 15/27] Claude review: Clean up bugs found when asked to review code. --- generate_intervals | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_intervals b/generate_intervals index 0ae84bf..fac3ae1 100755 --- a/generate_intervals +++ b/generate_intervals @@ -59,7 +59,7 @@ if [ $? -ne 0 ]; then exit 1 fi -eval set --$opts +eval set -- "$opts" while [[ $# -gt 0 ]]; do case "$1" in @@ -102,7 +102,7 @@ if [[ $interval -gt $max_value ]]; then fi # -# If only one interval requested, it is 1,$max_valuem +# If only one interval requested, it is 1,$max_value # else calculate the intervals. # if [[ $interval -ne 1 ]]; then From 670747c47c4f2f14aeff602351036803c770f2c7 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 6 Nov 2025 16:28:54 -0500 Subject: [PATCH 16/27] Claude review: Fix issues that claude found when asked to look for bugs. --- general_setup | 3 +++ grab_disks | 15 ++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/general_setup b/general_setup index 31ef637..b6863ab 100755 --- a/general_setup +++ b/general_setup @@ -74,6 +74,7 @@ gs_usage_info() to_test_verify_file="" to_sys_type=`hostname` +to_sys_env="local" to_configuration=`hostname` to_home_root=`echo $HOME | rev | cut -d'/' -f 2- | rev` if [[ $to_home_root == "" ]]; then @@ -108,6 +109,7 @@ do --sys_type) i=$((i + 2)) to_sys_type=$value + to_sys_env=$value shift 2 ;; --home_parent) @@ -220,6 +222,7 @@ do ;; esac done +export to_sys_env if [[ ! -d $TOOLS_BIN ]]; then TOOLS_BIN=${to_home_root}/${to_user}/test_tools fi diff --git a/grab_disks b/grab_disks index f1a727b..6449445 100755 --- a/grab_disks +++ b/grab_disks @@ -21,7 +21,7 @@ disks_passed=$1 disks="" numb_disks=0 -seper="" +separator="" build_disks_list() { @@ -29,11 +29,11 @@ build_disks_list() for i in $disk_list; do let "numb_disks=$numb_disks + 1" if [[ $i == "/dev/"* ]]; then - disks=${disks}${seper}${i} + disks=${disks}${separator}${i} else - disks=${disks}${seper}/dev/${i} + disks=${disks}${separator}/dev/${i} fi - seper=" " + separator=" " done } @@ -45,7 +45,6 @@ grab_disks() ALLSTG=$(mktemp /tmp/allstgdsk.XXXXX) USEDDSK=$(mktemp /tmp/useddsk.XXXXX) ALLDSK=$(mktemp /tmp/alldsk.XXXXX) - MNTDDSK=$(mktemp /tmp/mntddsk.XXXXX) lsblk -l > ${ALLSTG} rootdisk=$(grep -e "part /$" -e boot$ ${ALLSTG} | awk '{print $1}') @@ -57,7 +56,7 @@ grab_disks() # # Now the mounted disks # - for i in `df | grep /dev | cut -d' ' -f1 | grep /` + for i in `df --output=source | grep /dev` do echo ${i##*/} >> $USEDDSK done @@ -65,12 +64,14 @@ grab_disks() grep disk ${ALLSTG} | awk '{print $1}' | sort | uniq > ${ALLDSK} disks_temp=`echo $(grep -F -x -v -f ${USEDDSK} ${ALLDSK})` echo "$disks_temp" | awk '{ for (i=NF; i > 1; i--) printf("%s ",$i); print $1; }' > disks + rm -f $ALLSTG $USEDDSK $ALLDSK fi build_disks_list "`cat disks`" + rm -f disks } if [[ $disks_passed == *"none"* ]]; then - if [[ $sys_type == "local" ]]; then + if [[ $to_sys_env == "local" ]]; then echo Unable to continue. non cloud systems require a disk to be designated. exit 1 fi From 68081e3d0ee42eef3fe2085a1745140343ceca15 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 7 Nov 2025 07:56:13 -0500 Subject: [PATCH 17/27] Calude review: Update invoke_test with issues reported by claude. --- invoke_test | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/invoke_test b/invoke_test index 6f579c2..ee508ac 100755 --- a/invoke_test +++ b/invoke_test @@ -18,6 +18,15 @@ # +usage() +{ + echo Usage ${1}: + echo "--command : Command executing." + echo "--options : Options we are to past to the command." + echo "--test_name : name of test executing." + exit 0 +} + ARGUMENT_LIST=( "command" "options" @@ -39,7 +48,7 @@ if [ $? -ne 0 ]; then usage $0 fi -eval set --$opts +eval set -- "$opts" command="" options="" @@ -93,7 +102,7 @@ if [ $tuned_active -eq 1 ]; then if [ $? -eq 0 ]; then echo "Warning: Tuned was active now it isn't, restarting tuned" >> /tmp/${test_name}_tuned.status systemctl enable --now tuned - tuned-adm profile $start_active + tuned-adm profile $start_active_tuned fi fi From 6e82acba1ab5575735ea313d7474b71d767be0fc Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 7 Nov 2025 08:09:31 -0500 Subject: [PATCH 18/27] Claude review udates: Make updates based on on asking claude to find bugs. --- lvm_create | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/lvm_create b/lvm_create index 97782b7..92b5468 100755 --- a/lvm_create +++ b/lvm_create @@ -24,7 +24,13 @@ devices_to_use="" devices_list="" lvm_vol="" lvm_grp="" -wipefs="" +wipefs=0 + +error_out() +{ + echo $1 + exit $2 +} usage() { @@ -42,22 +48,18 @@ usage() validate_data() { if [[ $lvm_vol = "" ]]; then - echo Need to designate an lvm_vol name. - exit -1 + error_out "Need to designate an lvm_vol name." 1 fi if [[ $lvm_grp = "" ]]; then - echo Need to designate an lvm_grp name. - exit -1 + error_out "Need to designate an lvm_grp name." 1 fi if [[ $devices_to_use = "" ]]; then - echo Need to designate an lvm_grp name. - exit -1 + error_out "Need to designate at least one device to use." 1 fi for i in $devices_to_use; do if [[ ! -e $i ]]; then - echo Error, device $i not found. - exit -1 + error_out "Error, device $i not found." 1 fi done } @@ -86,9 +88,9 @@ opts=$(getopt \ ) if [ $? -ne 0 ]; then - exit + exit 0 fi -eval set --$opts +eval set -- "$opts" while [[ $# -gt 0 ]]; do case "$1" in @@ -130,7 +132,7 @@ validate_data seper="" for i in $devices_to_use; do lv_disks=${i}${seper}${lv_disks} - size=`fdisk -l $i | grep bytes | grep Disk | cut -d' ' -f 5` + size=`lsblk -b -d -n -o SIZE $i` gb=`echo "$size/(1024*1024*1024)" | bc` let "lv_total_size=$lv_total_size+$gb" let "lv_disk_count=$lv_disk_count+1" @@ -145,20 +147,17 @@ vgremove -f $lvm_vol let "total_size=$lv_total_size-200" pvcreate -ff $lv_disks if [ $? -ne 0 ]; then - echo pvcreate -ff $lv_disks failed. - exit -1 + error_out "pvcreate -ff $lv_disks failed." 1 fi sleep 60 vgcreate $lvm_vol $lv_disks if [ $? -ne 0 ]; then - echo vgcreate $lvm_vol $lv_disks failed - exit -1 + error_out "vgcreate $lvm_vol $lv_disks failed" 1 fi sleep 60 -echo y | lvcreate -Zy -Wy --yes -i $lv_disk_count -L ${total_size}G -n $lvm_vol $lvm_grp +lvcreate -Zy -Wy --yes -i $lv_disk_count -L ${total_size}G -n $lvm_vol $lvm_grp if [ $? -ne 0 ]; then - echo lvcreate -Zy -Wy --yes -i $lv_disk_count -L ${total_size}G -n $lvm_vol $lvm_grp failed. - exit -1 + error_out "lvcreate -Zy -Wy --yes -i $lv_disk_count -L ${total_size}G -n $lvm_vol $lvm_grp failed." 1 fi wipefs -f /dev/$lvm_vol/$lvm_grp - +exit 0 From bcabe4fb9bcbf764ecb7bc24f2f2df549d2e7d55 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 7 Nov 2025 08:12:16 -0500 Subject: [PATCH 19/27] Claude review: Make suggested updates from asking claude to find bugs. --- lvm_delete | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lvm_delete b/lvm_delete index 4bc6095..171b1cf 100755 --- a/lvm_delete +++ b/lvm_delete @@ -57,7 +57,7 @@ opts=$(getopt \ if [ $? -ne 0 ]; then exit fi -eval set --$opts +eval set -- "$opts" while [[ $# -gt 0 ]]; do case "$1" in From 9e69d4f80cfb8a2d2b0ee1ff168e31123d800316 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 7 Nov 2025 09:03:12 -0500 Subject: [PATCH 20/27] Claude review: Fix issues in package_tool that claude reported when asked to find bugs. --- package_tool | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package_tool b/package_tool index 358cbd3..79f2939 100755 --- a/package_tool +++ b/package_tool @@ -9,7 +9,7 @@ usage() echo " --update: Update the system." echo " --usage: This usage message." echo " --pip_packages: comma separated list of pip modules to install" - echo " --python_exec: path to python intrepreter to install pip modules for (default \"python3\"), will require installation of relevant packages to install pip" + echo " --python_exec: path to python interpreter to install pip modules for (default \"python3\"), will require installation of relevant packages to install pip" exit 1 } @@ -138,7 +138,7 @@ opts=$(getopt \ -- "$@" ) -eval set --$opts +eval set -- "$opts" while [[ $# -gt 0 ]]; do case "$1" in @@ -214,15 +214,15 @@ if [[ $install_cmd == "" ]]; then fi if [[ $is_installed != "" ]]; then - $install_cmd list installed | grep -q php-cli.x86_64 + $install_cmd list installed | grep -q $is_installed exit $? fi if [[ $remove_packages != "" ]]; then pkgs_rm=`echo $remove_packages | sed "s/,/ /g"` - $install_cmd remove -y $remove_packages + $install_cmd remove -y $pkg_rm if [ $? -ne 0 ]; then - exit_out "Failed to remove $packages" 1 + exit_out "Failed: Was unable to remove some or all of the package(s) $remoove_packages" 1 fi fi From 57989ca1cb1a2ecf82746cac17a945b2a4e10328 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 7 Nov 2025 09:25:48 -0500 Subject: [PATCH 21/27] Claude review: Updates for code issues claude found when asked to look for bugs. --- save_results | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/save_results b/save_results index 4c10c3e..b950a8f 100755 --- a/save_results +++ b/save_results @@ -90,7 +90,7 @@ opts=$(getopt \ -- "$@" ) -eval set --$opts +eval set -- "$opts" if [[ $? -ne 0 ]] || [[ $# -eq 1 ]]; then usage $0 @@ -158,7 +158,7 @@ if [[ $curdir == "" ]]; then curdir=`pwd` fi if [[ $user == "" ]] && [[ $home_root == "" ]]; then - $home_root=$curdir + home_root=$curdir fi export_results="$home_root/$user/export_results" if [[ ! -d $export_results ]]; then @@ -176,11 +176,11 @@ which tuned-adm >> /dev/null 2>&1 if [[ $? -ne 0 ]]; then echo tuned-adm not available > ~/tuned_after else - tuned-adm active | cut -d: -f 2 | sed "s/ //g" > ~/tuned_after + tuned-adm active | cut -d: -f 2 | sed "s/ //g" > ~/tuned_after fi diff ~/tuned_before ~/tuned_after > $RESULTS_PATH/tuned_setting -if [[ $? -ne -0 ]]; then +if [[ $? -ne 0 ]]; then echo 'Tuned settings have changed!!!!' echo Start of run cat ~/tuned_before @@ -200,9 +200,9 @@ if [[ $other_files != "" ]]; then fi if [[ $tar_file != "" ]]; then - pushd $RESULTS_PATH + pushd $RESULTS_PATH > /dev/null tar xf $tar_file - popd + popd > /dev/null fi if [[ $copy_dir != "" ]]; then cp -R $copy_dir $RESULTS_PATH @@ -228,8 +228,8 @@ cd /tmp # # Provide a common pull for Zathra. # -if [[ -f test_wrapper_results_${test}.zip ]]; then - rm test_wrapper_results_${test}.zip test_wrapper_results_pbench_${test}.zip +if [[ -f test_wrapper_results_${test_name}.zip ]]; then + rm test_wrapper_results_${test_name}.zip fi zip results_${test_name}.zip results_${test_name}_${tuned_setting}.tar link_files results_${test_name}.zip results_pbench_${test_name}.zip From 3c737f2b12eb3b8e6da7df6680ce15ccec917312 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 7 Nov 2025 09:36:42 -0500 Subject: [PATCH 22/27] Claude review: Fix issues in test_header_info that claude uncovered. --- test_header_info | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/test_header_info b/test_header_info index 80acf10..5dc73c1 100755 --- a/test_header_info +++ b/test_header_info @@ -53,7 +53,7 @@ print_general_header_info() printf "# Number cpus: " >> $out_file lscpu | grep "CPU(s):" | grep -v NUMA | cut -d':' -f2 | awk '{$1=$1;print}' >> $out_file printf "# Memory: " >> $out_file - cat /proc/meminfo | grep MemTotal: | awk '{print $2 $3}' >> $out_file + grep MemTotal: /proc/meminfo | awk '{print $2 $3}' >> $out_file echo "# Test general meta end" >> $out_file } # @@ -62,10 +62,8 @@ print_general_header_info() print_test_meta() { out_file=$1 - tdir=$2 - fields="$3" - op=$4 - size=$5 + tdir="" + fields="" echo "# Test meta data start" >> $out_file # @@ -75,7 +73,7 @@ print_test_meta() printf "$passed_meta" >> $out_file fi # - # Only if the dir nameis provided. + # Only if the dir name is provided. # if [[ $info_in_dir_name != "" ]]; then tdir=`echo "$info_in_dir_name" | cut -d' ' -f1` @@ -91,12 +89,12 @@ print_test_meta() usage() { echo "Usage: $0" - echo "--field_separ : the field separator character in the directgory used" + echo "--field_separ : the field separator character in the directory used" echo " by --info_in_dir_name. Default is '_'" echo "--front_matter: Place system info in the results file" echo "--info_in_dir_name \" \": If directory contains info on test" echo " parameters, then we want to pull that info from the directory. Expected" - echo " field seperator is '_'. Example" + echo " field separator is '_'. Example" echo " dir=fio_ndisks_1_disksize_1.95_TiB_njobs_1_ioengine_libaio_iodepth_1_2024.08.23T11.38.53" echo " --info_in_dir_name \"\$dir 2,3 4,5,6 7,8 9,10\"" echo "--meta_output : String to place in meta section" @@ -131,7 +129,7 @@ opts=$(getopt \ -- "$@" ) -eval set --$opts +eval set -- "$opts" separ="" while [[ $# -gt 0 ]]; do From 2c5108ec8973a708187f914b9fa3cca08fc39d3a Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 7 Nov 2025 09:43:31 -0500 Subject: [PATCH 23/27] Claude review: umount_filesystems, clean out bugs claude pointed to. --- umount_filesystems | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/umount_filesystems b/umount_filesystems index 061a7d6..5180991 100755 --- a/umount_filesystems +++ b/umount_filesystems @@ -51,9 +51,9 @@ opts=$(getopt \ ) if [ $? -ne 0 ]; then - exit + exit 1 fi -eval set --$opts +eval set -- "$opts" while [[ $# -gt 0 ]]; do case "$1" in @@ -83,11 +83,11 @@ done if [[ $mount_pnt == "" ]]; then echo Need to designate mount point prefix - usage + usage $0 fi if [[ $number_mount_pnts == "" ]]; then echo Need to designate the number of mount points - usage + usage $0 fi let "number_mount_pnts=$number_mount_pnts-1" From d0c8cba6973b321139e1cb15715de130b320d0aa Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 7 Nov 2025 15:38:47 -0500 Subject: [PATCH 24/27] Add back in delete code. --- detect_numa | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/detect_numa b/detect_numa index 26c523f..bc14914 100755 --- a/detect_numa +++ b/detect_numa @@ -128,6 +128,10 @@ while [[ $# -gt 0 ]]; do get_cpus=1 shift 1 ;; + -n | --node-count) + get_nodes=1 + shift 1 + ;; -i | --input) lscpu_command=$2 shift 2 From 561d5fcb7ad83822adf934614f00e0fb1e84bf87 Mon Sep 17 00:00:00 2001 From: David Valin Date: Tue, 11 Nov 2025 10:05:43 -0500 Subject: [PATCH 25/27] Fix misspelling of remove --- package_tool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_tool b/package_tool index 79f2939..a998d08 100755 --- a/package_tool +++ b/package_tool @@ -222,7 +222,7 @@ if [[ $remove_packages != "" ]]; then pkgs_rm=`echo $remove_packages | sed "s/,/ /g"` $install_cmd remove -y $pkg_rm if [ $? -ne 0 ]; then - exit_out "Failed: Was unable to remove some or all of the package(s) $remoove_packages" 1 + exit_out "Failed: Was unable to remove some or all of the package(s) $remove_packages" 1 fi fi From 6dbd9ac41d97c709149cd300913880a9c620bc80 Mon Sep 17 00:00:00 2001 From: David Valin Date: Wed, 12 Nov 2025 10:17:28 -0500 Subject: [PATCH 26/27] Code review updates. --- detect_numa | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/detect_numa b/detect_numa index bc14914..e2c4cbf 100755 --- a/detect_numa +++ b/detect_numa @@ -121,14 +121,13 @@ while [[ $# -gt 0 ]]; do ;; -n | --node) node=$2 - get_nodes=1 shift 2 ;; --list-cpu | --cpu-list) get_cpus=1 shift 1 ;; - -n | --node-count) + --node-count) get_nodes=1 shift 1 ;; From 7706ba51d4f4c8c7fa3acbb37e1cabfd81d38957 Mon Sep 17 00:00:00 2001 From: David Valin Date: Mon, 17 Nov 2025 10:43:56 -0500 Subject: [PATCH 27/27] Remove dup line --- package_tool | 1 - 1 file changed, 1 deletion(-) diff --git a/package_tool b/package_tool index b0c24c0..055861a 100755 --- a/package_tool +++ b/package_tool @@ -11,7 +11,6 @@ usage() echo " --pip_packages: comma separated list of pip modules to install" echo " --python_exec: path to python interpreter to install pip modules for (default \"python3\"), will require installation of relevant packages to install pip" echo " --update_cache: Update package cache before install/updating packages, 1 (default) updates cache, 0 skips cache update" - echo " --python_exec: path to python intrepreter to install pip modules for (default \"python3\"), will require installation of relevant packages to install pip" exit 1 }