#!/bin/bash # parameters: # - $1: Name of the output file with all the logs, dump.txt by default. source cpu.sh source governor.sh source special-tests.sh OUTFILE=dump FUNC=basic # do basic tests by default # Check validity of arguments USAGE="Usage: $0 [-h] [-of args] [-h ] [-o ] [-f ]" # Parse arguments parse_arguments() { while getopts hf:o: arguments 2>/dev/null do case $arguments in h) # --help echo "$USAGE" exit 0 ;; f) # --func_type (Function to perform: basic, sp1, sp2, sp3, default: basic) FUNC=$OPTARG ;; o) # --output-file (Output file to store dumps) OUTFILE=$OPTARG ;; \?) # getopts issues an error message echo "$USAGE " exit 1 ;; esac done } # Run isolation test for $FUNC run_func() { case "$FUNC" in "basic") call_routine cpufreq_basic_tests $OUTFILE ;; "sp1") governor_race ;; "sp2") simple_lockdep ;; "sp3") hotplug_with_updates ;; *) echo "Invalid [-f] function type" ;; esac } # Parse isol arguments parse_arguments $@ # Run requested functions run_func