From 18b21751bb00e6186774d3484cc868da8dcdbba1 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Mon, 18 Aug 2025 13:37:18 -0400 Subject: [PATCH 01/13] feat(csv): Add basic csv to JSON conversion This adds a script `csv_to_json` which is essentially a wrapper for `csvjson` found in the python3-csvkit package. This is the first step for JSON results in Zathras, but for now this is intended to convert the current CSV files to a results JSON (metadata is stripped) so we can easily verify those results. Co-developed-by: Cursor --- csv_to_json | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100755 csv_to_json diff --git a/csv_to_json b/csv_to_json new file mode 100755 index 0000000..ce62153 --- /dev/null +++ b/csv_to_json @@ -0,0 +1,98 @@ +#!/bin/bash + +# +# License +# +# Copyright (C) 2025 Keith Valin kvalin@redhat.com +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Convert CSV files to JSON. + +usage() +{ + echo "usage $1" >&2 + echo -e "\t-h --help --usage: This help message" >&2 + echo -e "\t--csv_file : CSV file to convert to JSON." >&2 + echo -e "\t--output_file : file to write output to, default is stdout." >&2 + echo -e "\t--json_skip: Skip conversion process, effectively turns this into a noop" >&2 +} + +ARGUMENT_LIST=( + "csv_file" + "output_file" +) + +NO_ARGUMENTS=( + "usage" + "h" + "help" +) + +# read arguments +opts=$(getopt \ + --longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")" \ + --longoptions "$(printf "%s," "${NO_ARGUMENTS[@]}")" \ + --name "$(basename "$0")" \ + --options "h" \ + -- "$@" +) + +if [ $? -ne 0 ]; then + exit +fi +eval set --$opts + +while [[ $# -gt 0 ]]; do + case "$1" in + --csv_file) + csv_file=${2} + shift 2 + ;; + --output_file) + output_file=${2} + shift 2 + ;; + --usage | -h | --help) + usage $0 + exit 0 + ;; + --json_skip) + exit 0 + ;; + --) + break; + ;; + *) + echo option not found $1 >&2 + usage $0 + exit 1 + ;; + esac +done + +if ! command -v csvjson &> /dev/null; then + echo "csvjson could not be found, please install python3-csvkit" >&2 + exit 1 +fi + +# grep commands are used to remove the metadata lines +# these lines are not valid CSV and will cause problems +# all metadata lines start with a # character +if [ -z "$csv_file" ]; then + grep -v '^#' $csv_file | csvjson +else + grep -v '^#' $csv_file | csvjson > $output_file +fi From a32eedaca9d5f889cfb2562448e08a66043ec56f Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Mon, 18 Aug 2025 13:57:25 -0400 Subject: [PATCH 02/13] Feat: Add pydantic-based results verification script This adds `verify_results` which uses the pydantic python module to verify if results match certain constraints, akin to JSON schemas. This script dynamically imports a passed script and a passed class then verifies if the JSON file/input matches. Co-developed-by: Cursor --- verify_results | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 verify_results diff --git a/verify_results b/verify_results new file mode 100755 index 0000000..e5900b7 --- /dev/null +++ b/verify_results @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 + +import sys +import json +from typing import TextIO + +try: + from pydantic import BaseModel, TypeAdapter, ValidationError +except ImportError as e: + print("Could not import pydantic, please install it using pip3 install pydantic", file=sys.stderr) + sys.exit(1) + +def verify_schema(file: TextIO, class_name: BaseModel): + data = json.load(file) + try: + TypeAdapter(list[class_name]).validate_python(data) + except ValidationError as e: + print("Could not verify schema, see below for details", file=sys.stderr) + print(e, file=sys.stderr) + sys.exit(1) + + print("Results verified") + +if __name__ == "__main__": + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("--file", type=str, default=None, help="JSON file to verify, default is to read from stdin") + parser.add_argument("--schema_file", type=str, help="Schema file used to validate JSON file") + parser.add_argument("--class_name", type=str, help="Class name used to validate JSON file", default="Results") + parser.add_argument("--usage", action="store_true", help="Show usage") + parser.add_argument("--verify_skip", action="store_true", help="Skip verification process") + args = parser.parse_args() + + if args.usage: + parser.print_help() + sys.exit(0) + + if args.verify_skip: + sys.exit(0) + + if args.file is None: + args.file = sys.stdin + else: + args.file = open(args.file, "r") + + try: + importedClass = __import__(args.schema_file.replace(".py", ""), fromlist=[args.class_name]) + baseModel = getattr(importedClass, args.class_name) + except ImportError as e: + print(f"Could not read schema file {args.schema_file}", file=sys.stderr) + print(f"Error: {e}", file=sys.stderr) + sys.exit(1) + except AttributeError: + print(f"Class {args.class_name} not found in {args.schema_file}", file=sys.stderr) + sys.exit(1) + except Exception as e: + print(f"Error: {e}", file=sys.stderr) + sys.exit(1) + + verify_schema(args.file, baseModel) \ No newline at end of file From 860fc03da608a6382e786642f44b732274c36ff0 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Mon, 18 Aug 2025 14:05:08 -0400 Subject: [PATCH 03/13] feat: Add flags for json and verification tools This adds `--verify_skip` and `--json_skip` which skips the verification step and json conversion step respectively. This is placed inside of general_setup so the scripts can simply pass $to_json_flags and $to_verify_flags to avoid having to manage an ever-growing pile of flags in the future. Co-developed-by: Cursor --- general_setup | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/general_setup b/general_setup index ecf4f4e..0b1ed9a 100755 --- a/general_setup +++ b/general_setup @@ -90,7 +90,8 @@ to_user=`whoami` to_sysname=`hostname` to_pstats="default" to_no_pkg_install=0 - +to_verify_flags="" +to_json_flags="" to_tuned_setting="" i=1 @@ -195,6 +196,14 @@ do --usage) gs_usage_info ;; + --verify_skip) + to_verify_flags="$1" + shift 1 + ;; + --json_skip) + to_json_flags="$1" + shift 1 + ;; --) break; ;; From 2b584305bb31557efc377b057e73f75e2f23a21e Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Mon, 18 Aug 2025 14:20:23 -0400 Subject: [PATCH 04/13] Feat: Add to_script_dir for convience This adds `$to_script_dir` so it is easy for running scripts to fetch the directory that the script lives in. This will make verification scripts a lot easier to manage. Co-developed-by: Cursor --- general_setup | 1 + 1 file changed, 1 insertion(+) diff --git a/general_setup b/general_setup index 0b1ed9a..39940f5 100755 --- a/general_setup +++ b/general_setup @@ -75,6 +75,7 @@ to_test_verify_file="" to_sys_type=`hostname` to_configuration=`hostname` to_home_root=`echo $HOME | rev | cut -d'/' -f 2- | rev` +to_script_dir=`dirname $(realpath $0)` if [[ $to_home_root == "" ]]; then to_home_root="/" fi From 173ee165d82a8e05431716b38083324290f9b099 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Tue, 19 Aug 2025 09:54:09 -0400 Subject: [PATCH 05/13] fix(verify): Fix absolute path bugging out verfiy_results Previously the `verify_results` script could not handle absolute paths causing import errors and validation to fail. This changes the import logic so we can import a file from anywhere on a system and load the relevant class we need. Co-developed-by: Cursor --- verify_results | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/verify_results b/verify_results index e5900b7..14fa2fa 100755 --- a/verify_results +++ b/verify_results @@ -23,6 +23,9 @@ def verify_schema(file: TextIO, class_name: BaseModel): if __name__ == "__main__": import argparse + import importlib.util + import re + parser = argparse.ArgumentParser() parser.add_argument("--file", type=str, default=None, help="JSON file to verify, default is to read from stdin") parser.add_argument("--schema_file", type=str, help="Schema file used to validate JSON file") @@ -44,14 +47,19 @@ if __name__ == "__main__": args.file = open(args.file, "r") try: - importedClass = __import__(args.schema_file.replace(".py", ""), fromlist=[args.class_name]) + # Get the file name (minus the extension), since it is the module name + module_name = re.sub(r".py$", "", args.schema_file).split("/")[-1] + + # Import the class from the schema file + spec = importlib.util.spec_from_file_location(module_name, args.schema_file) + importedClass = importlib.util.module_from_spec(spec) + spec.loader.exec_module(importedClass) + baseModel = getattr(importedClass, args.class_name) - except ImportError as e: - print(f"Could not read schema file {args.schema_file}", file=sys.stderr) - print(f"Error: {e}", file=sys.stderr) - sys.exit(1) - except AttributeError: + # Handle file issues and if the class is not found (attribute error) + except (FileNotFoundError, AttributeError) as e: print(f"Class {args.class_name} not found in {args.schema_file}", file=sys.stderr) + print(f"Error: {e}", file=sys.stderr) sys.exit(1) except Exception as e: print(f"Error: {e}", file=sys.stderr) From 6648581642554d083485f49b675d72470ad1f60e Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Mon, 25 Aug 2025 13:48:08 -0400 Subject: [PATCH 06/13] refactor(csv_to_json): Change to using Pandas for CSV to JSON conversion Previously we used csvkit to convert the csv files to JSON, but csvkit does not keep integer fields as integers. It will convert integers to floats, which will fail validation processes. The change to pandas will respect data types. Co-developed-by: Cursor --- csv_to_json | 106 +++++++++++++++------------------------------------- 1 file changed, 30 insertions(+), 76 deletions(-) diff --git a/csv_to_json b/csv_to_json index ce62153..f437aaf 100755 --- a/csv_to_json +++ b/csv_to_json @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env python3 # # License @@ -21,78 +21,32 @@ # # Convert CSV files to JSON. -usage() -{ - echo "usage $1" >&2 - echo -e "\t-h --help --usage: This help message" >&2 - echo -e "\t--csv_file : CSV file to convert to JSON." >&2 - echo -e "\t--output_file : file to write output to, default is stdout." >&2 - echo -e "\t--json_skip: Skip conversion process, effectively turns this into a noop" >&2 -} - -ARGUMENT_LIST=( - "csv_file" - "output_file" -) - -NO_ARGUMENTS=( - "usage" - "h" - "help" -) - -# read arguments -opts=$(getopt \ - --longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")" \ - --longoptions "$(printf "%s," "${NO_ARGUMENTS[@]}")" \ - --name "$(basename "$0")" \ - --options "h" \ - -- "$@" -) - -if [ $? -ne 0 ]; then - exit -fi -eval set --$opts - -while [[ $# -gt 0 ]]; do - case "$1" in - --csv_file) - csv_file=${2} - shift 2 - ;; - --output_file) - output_file=${2} - shift 2 - ;; - --usage | -h | --help) - usage $0 - exit 0 - ;; - --json_skip) - exit 0 - ;; - --) - break; - ;; - *) - echo option not found $1 >&2 - usage $0 - exit 1 - ;; - esac -done - -if ! command -v csvjson &> /dev/null; then - echo "csvjson could not be found, please install python3-csvkit" >&2 - exit 1 -fi - -# grep commands are used to remove the metadata lines -# these lines are not valid CSV and will cause problems -# all metadata lines start with a # character -if [ -z "$csv_file" ]; then - grep -v '^#' $csv_file | csvjson -else - grep -v '^#' $csv_file | csvjson > $output_file -fi +import argparse +import sys +from typing import TextIO + +def main(csv_file: TextIO, output: TextIO, separator: str): + """ + Convert a CSV file to JSON. + """ + import pandas as pd + df = pd.read_csv(csv_file, sep=separator) + df.to_json(output, orient='records', lines=False, indent=4) + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Convert CSV files to JSON') + parser.add_argument('--csv_file', type=str, help='The CSV file to convert', default="") + parser.add_argument('--output_file', type=str, help='The JSON file to write', default="") + parser.add_argument('--json_skip', action='store_true', help='Skip processing the CSV to JSON, effectively makes this a no-op') + + # Colon is used as the default separator since most wrappers use it. + parser.add_argument('--separator', type=str, help='The separator to use for the CSV file', default=":") + args = parser.parse_args() + + if args.json_skip: + sys.exit(0) + + args.csv_file = open(args.csv_file, 'r') if args.csv_file else sys.stdin + args.output = open(args.output, 'w') if args.output else sys.stdout + + main(args.csv_file, args.output, args.separator) \ No newline at end of file From 055b3bd126c6a444522de28910b0b495d5af7374 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Mon, 25 Aug 2025 14:33:21 -0400 Subject: [PATCH 07/13] fix(csv_to_json): Fix argument typos Change args.output to args.output_file, since I updated the arg at one point and forgot to do it everywhere else, d'oh Co-developed-by: Cursor --- csv_to_json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csv_to_json b/csv_to_json index f437aaf..7cc4ede 100755 --- a/csv_to_json +++ b/csv_to_json @@ -47,6 +47,6 @@ if __name__ == "__main__": sys.exit(0) args.csv_file = open(args.csv_file, 'r') if args.csv_file else sys.stdin - args.output = open(args.output, 'w') if args.output else sys.stdout + args.output = open(args.output_file, 'w') if args.output_file else sys.stdout - main(args.csv_file, args.output, args.separator) \ No newline at end of file + main(args.csv_file, args.output_file, args.separator) \ No newline at end of file From 85dce68a51a5e1c200156c1f9c07c1ef07bb5e1d Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Mon, 25 Aug 2025 14:48:39 -0400 Subject: [PATCH 08/13] Fix(csv_to_json): Ignore comments/metadata This lets pandas know that a line starting with a # is a comment and should be ignored. Co-developed-by: Cursor --- csv_to_json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csv_to_json b/csv_to_json index 7cc4ede..1a57ee7 100755 --- a/csv_to_json +++ b/csv_to_json @@ -30,7 +30,7 @@ def main(csv_file: TextIO, output: TextIO, separator: str): Convert a CSV file to JSON. """ import pandas as pd - df = pd.read_csv(csv_file, sep=separator) + df = pd.read_csv(csv_file, sep=separator, comment='#') df.to_json(output, orient='records', lines=False, indent=4) if __name__ == "__main__": From 311928db089a106804825748c7a49f85c16dc148 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Wed, 27 Aug 2025 10:50:41 -0400 Subject: [PATCH 09/13] refactor(csv,validation): Install dependencies if needed This commit introduces the ability for verify_results and csv_to_json to install their needed dependencies if it is not available on the system. csv_to_json installs pandas, verify_results installs pydantic Co-developed-by: Cursor --- csv_to_json | 9 ++++++++- verify_results | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/csv_to_json b/csv_to_json index 1a57ee7..5f3758b 100755 --- a/csv_to_json +++ b/csv_to_json @@ -25,11 +25,18 @@ import argparse import sys from typing import TextIO +try: + import pandas as pd +except ImportError: + print("WARNING: pandas is not installed. Installing using pip", file=sys.stderr) + import subprocess + subprocess.check_call([sys.executable, "-m", "pip", "install", "pandas", "--user", "--quiet"]) + import pandas as pd + def main(csv_file: TextIO, output: TextIO, separator: str): """ Convert a CSV file to JSON. """ - import pandas as pd df = pd.read_csv(csv_file, sep=separator, comment='#') df.to_json(output, orient='records', lines=False, indent=4) diff --git a/verify_results b/verify_results index 14fa2fa..396ea8f 100755 --- a/verify_results +++ b/verify_results @@ -7,8 +7,10 @@ from typing import TextIO try: from pydantic import BaseModel, TypeAdapter, ValidationError except ImportError as e: - print("Could not import pydantic, please install it using pip3 install pydantic", file=sys.stderr) - sys.exit(1) + print("WARNING: Could not import pydantic, installing it using pip", file=sys.stderr) + import subprocess + subprocess.check_call([sys.executable, "-m", "pip", "install", "pydantic", "--user", "--quiet"]) + from pydantic import BaseModel, TypeAdapter, ValidationError def verify_schema(file: TextIO, class_name: BaseModel): data = json.load(file) From d89c12f05f36b68b1e748546bc4e9819071a2fdf Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Wed, 27 Aug 2025 10:53:44 -0400 Subject: [PATCH 10/13] Refactor(verify,csvjson): Simplify default arguments This simplifies the default arguments so argparse takes care of opening the files with the needed modes, and when the default is stdout/stdin no other logic needs to be done to swap between file and console IO. Co-developed-by: Cursor --- csv_to_json | 7 ++----- verify_results | 16 +++++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/csv_to_json b/csv_to_json index 5f3758b..5647546 100755 --- a/csv_to_json +++ b/csv_to_json @@ -42,8 +42,8 @@ def main(csv_file: TextIO, output: TextIO, separator: str): if __name__ == "__main__": parser = argparse.ArgumentParser(description='Convert CSV files to JSON') - parser.add_argument('--csv_file', type=str, help='The CSV file to convert', default="") - parser.add_argument('--output_file', type=str, help='The JSON file to write', default="") + parser.add_argument('--csv_file', type=argparse.FileType("r"), help='The CSV file to convert', default=sys.stdin) + parser.add_argument('--output_file', type=argparse.FileType("w"), help='The JSON file to write', default=sys.stdout) parser.add_argument('--json_skip', action='store_true', help='Skip processing the CSV to JSON, effectively makes this a no-op') # Colon is used as the default separator since most wrappers use it. @@ -53,7 +53,4 @@ if __name__ == "__main__": if args.json_skip: sys.exit(0) - args.csv_file = open(args.csv_file, 'r') if args.csv_file else sys.stdin - args.output = open(args.output_file, 'w') if args.output_file else sys.stdout - main(args.csv_file, args.output_file, args.separator) \ No newline at end of file diff --git a/verify_results b/verify_results index 396ea8f..19c70e9 100755 --- a/verify_results +++ b/verify_results @@ -29,8 +29,15 @@ if __name__ == "__main__": import re parser = argparse.ArgumentParser() - parser.add_argument("--file", type=str, default=None, help="JSON file to verify, default is to read from stdin") - parser.add_argument("--schema_file", type=str, help="Schema file used to validate JSON file") + parser.add_argument("--file", + type=argparse.FileType("r"), + help="JSON file to verify, default is to read from stdin", + default=sys.stdin + ) + parser.add_argument("--schema_file", + type=argparse.FileType("r"), + help="Schema file used to validate JSON file" + ) parser.add_argument("--class_name", type=str, help="Class name used to validate JSON file", default="Results") parser.add_argument("--usage", action="store_true", help="Show usage") parser.add_argument("--verify_skip", action="store_true", help="Skip verification process") @@ -43,11 +50,6 @@ if __name__ == "__main__": if args.verify_skip: sys.exit(0) - if args.file is None: - args.file = sys.stdin - else: - args.file = open(args.file, "r") - try: # Get the file name (minus the extension), since it is the module name module_name = re.sub(r".py$", "", args.schema_file).split("/")[-1] From c0c2a7cf5eaea946edc32603619ccc21acbdf4c2 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Tue, 2 Sep 2025 10:40:32 -0400 Subject: [PATCH 11/13] fix(verify_results): Change type of --schema_file Change --schema_file type to a str, since we never directly read from the file (this is handled by importlib), and the necessary errors are already handled. --- verify_results | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify_results b/verify_results index 19c70e9..26e5519 100755 --- a/verify_results +++ b/verify_results @@ -35,7 +35,7 @@ if __name__ == "__main__": default=sys.stdin ) parser.add_argument("--schema_file", - type=argparse.FileType("r"), + type=str, help="Schema file used to validate JSON file" ) parser.add_argument("--class_name", type=str, help="Class name used to validate JSON file", default="Results") From bffebd06b31c0889e72e1c9afcf1ab369101f6dd Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Mon, 17 Nov 2025 13:33:59 -0500 Subject: [PATCH 12/13] refactor(verify_results, csv_to_json): Remove dependency installation in scripts --- csv_to_json | 6 ++---- verify_results | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/csv_to_json b/csv_to_json index 5647546..80ba8f2 100755 --- a/csv_to_json +++ b/csv_to_json @@ -28,10 +28,8 @@ from typing import TextIO try: import pandas as pd except ImportError: - print("WARNING: pandas is not installed. Installing using pip", file=sys.stderr) - import subprocess - subprocess.check_call([sys.executable, "-m", "pip", "install", "pandas", "--user", "--quiet"]) - import pandas as pd + print("ERROR: pandas is not installed. Exiting", file=sys.stderr) + exit(1) def main(csv_file: TextIO, output: TextIO, separator: str): """ diff --git a/verify_results b/verify_results index 26e5519..bb2c204 100755 --- a/verify_results +++ b/verify_results @@ -7,10 +7,8 @@ from typing import TextIO try: from pydantic import BaseModel, TypeAdapter, ValidationError except ImportError as e: - print("WARNING: Could not import pydantic, installing it using pip", file=sys.stderr) - import subprocess - subprocess.check_call([sys.executable, "-m", "pip", "install", "pydantic", "--user", "--quiet"]) - from pydantic import BaseModel, TypeAdapter, ValidationError + print("ERROR: Could not import pydantic, exiting", file=sys.stderr) + exit(1) def verify_schema(file: TextIO, class_name: BaseModel): data = json.load(file) From e38f7d74d4b444bfa1b887d0513e5c9399d303e7 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Mon, 17 Nov 2025 13:49:55 -0500 Subject: [PATCH 13/13] feat(verify): Add automatic install of dependencies --- deps/verification.json | 8 ++++++++ general_setup | 24 ++++++++---------------- 2 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 deps/verification.json diff --git a/deps/verification.json b/deps/verification.json new file mode 100644 index 0000000..5ac84c3 --- /dev/null +++ b/deps/verification.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "pip": [ + "pandas", + "pydantic" + ] + } +} \ No newline at end of file diff --git a/general_setup b/general_setup index 743f437..ea8141e 100755 --- a/general_setup +++ b/general_setup @@ -64,7 +64,8 @@ gs_usage_info() echo " --run_user: user that is actually running the test on the test system. Defaults to user running wrapper." echo " --sys_type: Type of system working with, aws, azure, hostname. Defaults to hostname." echo " --sysname: name of the system running, used in determining config files. Defaults to hostname." - echo " --test_verification : Runs the test verification. Information is in the test_verify file in the tests github" + echo " --json_skip: Skip JSON conversion of test CSV results, default is 0" + echo " --verify_skip: Skip test verifications against output, default is 0" echo " --tuned_setting: used in naming the tar file, default for RHEL is the current active tuned. For non" echo " RHEL systems, default is none." echo " --usage: this usage message." @@ -72,7 +73,6 @@ gs_usage_info() exit 1 } -to_test_verify_file="" to_sys_type=`hostname` to_configuration=`hostname` to_home_root=`echo $HOME | rev | cut -d'/' -f 2- | rev` @@ -92,6 +92,7 @@ to_user=`whoami` to_sysname=`hostname` to_pstats="default" to_no_pkg_install=0 +skip_verification=0 to_verify_flags="" to_json_flags="" to_tuned_setting="" @@ -170,20 +171,6 @@ do to_sysname=$value shift 2 ;; - --test_verification) - i=$((i + 2)) - to_test_verify_file=$2 - # - # If the path is relative, then we make it absolute by - # using the the path of general_setup, minus the test_tools dir. - # - echo $to_test_verify_file |grep -q "^/" - if [[ $? -ne 0 ]]; then - tdir=`echo $test_cmd | rev | cut -d'/' -f2- | rev` - to_test_verify_file=${tdir}/${to_test_verify_file} - fi - shift 2 - ;; --tuned_setting) i=$((i + 2)) if [[ $value != *"none"* ]]; then @@ -204,6 +191,7 @@ do ;; --verify_skip) to_verify_flags="$1" + skip_verification=1 shift 1 ;; --json_skip) @@ -236,6 +224,10 @@ if [[ $to_tuned_setting == "" ]]; then to_tuned_setting=`${TOOLS_BIN}/get_tuned_setting` fi +if [[ "$skip_verification" -eq 0 ]]; then + ${TOOLS_BIN}/package_tool --wrapper_config ${TOOLS_BIN}/deps/verification.json --no_packages $to_no_pkg_install +fi + # # Get the actual setting of the tuned for future comparison, # Do not depend on $to_tuned_setting. It might not have set