Skip to content
Snippets Groups Projects
Commit f30b99bb authored by Jason Hiser's avatar Jason Hiser :tractor:
Browse files

changed test_cmds to support input of arbitrary path to binary for a test,...

changed test_cmds to support input of arbitrary path to binary for a test, also bzip2 test improvements


Former-commit-id: aa21520c9d4a00d237ef71282d7e022d146c80d8
parent c0a6ac50
No related branches found
No related tags found
No related merge requests found
...@@ -55,16 +55,19 @@ run_bench_prog_only 120 -k $DATA_DIR/compression_input1_orig ...@@ -55,16 +55,19 @@ run_bench_prog_only 120 -k $DATA_DIR/compression_input1_orig
#sure it does exist before doing any comparisons. I check the bench's output #sure it does exist before doing any comparisons. I check the bench's output
#file because it is possible for the test to fail to produce an output for #file because it is possible for the test to fail to produce an output for
#different reasons. #different reasons.
if [[ -z "$IGNORE_RESULTS" ]] && [[ -f $DATA_DIR/compression_input1_orig.bz2 ]]; then if [[ -z "$IGNORE_RESULTS" ]] ; then
if [[ -f $DATA_DIR/compression_input1_orig.bz2 ]]; then
compare_std_results compare_std_results
diff $DATA_DIR/compression_input1_test.bz2 $DATA_DIR/compression_input1_orig.bz2 diff $DATA_DIR/compression_input1_test.bz2 $DATA_DIR/compression_input1_orig.bz2
status=$? status=$?
if [ ! "$status" -eq 0 ]; then if [ ! "$status" -eq 0 ]; then
echo "Exit Status Failure" echo "Exit Status Failure"
report_failure
fi
else
report_failure report_failure
fi fi
fi fi
cleanup cleanup
report_success report_success
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
show_logs_on_failure=0 show_logs_on_failure=0
had_fails=0 had_fails=0
apps="" apps=""
declare -A app_paths
default_apps="bzip2 grep du ncal ls objdump readelf sort tar touch tcpdump" default_apps="bzip2 grep du ncal ls objdump readelf sort tar touch tcpdump"
configs="" configs=""
default_configs="rida" default_configs="rida"
...@@ -50,15 +51,14 @@ do_tests() ...@@ -50,15 +51,14 @@ do_tests()
fi fi
progpath=$(which $prog) progpath="${app_path[$prog]}"
if [ "$progpath" = "" ]; then if [ "$progpath" = "" ]; then
echo "TEST: Original binary ($prog) not found: skipping..." echo "TEST: Original binary ($prog) not found: skipping..."
continue continue
fi fi
progpath=$(realpath $progpath)
echo "TEST ($config) ${prog}=${progpath}: Protecting..."
echo "TEST ($config) ${prog}: Protecting..."
progpath=$(readlink -f $progpath)
case $config in case $config in
zafl) zafl)
...@@ -162,6 +162,74 @@ do_tests() ...@@ -162,6 +162,74 @@ do_tests()
ibtl_p1) ibtl_p1)
$PSZ $progpath $protected --backend strata --step ibtl=on --step ilr=on --step pc_confine=on --step p1transform=on --tempdir $temp_dir > test_${prog}.ps.log 2>&1 $PSZ $progpath $protected --backend strata --step ibtl=on --step ilr=on --step pc_confine=on --step p1transform=on --tempdir $temp_dir > test_${prog}.ps.log 2>&1
;; ;;
mvp1v1)
$VGT -i $progpath -c mvp1 -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-1/bin/$(basename $progpath) $protected
;;
mvp1v2)
$VGT -i $progpath -c mvp1 -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-2/bin/$(basename $progpath) $protected
;;
mvp2v1)
$VGT -i $progpath -c mvp2 -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-1/bin/$(basename $progpath) $protected
;;
mvp2v2)
$VGT -i $progpath -c mvp2 -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-2/bin/$(basename $progpath) $protected
;;
mvp3v1)
$VGT -i $progpath -c mvp3 -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-1/bin/$(basename $progpath) $protected
;;
mvp3v2)
$VGT -i $progpath -c mvp3 -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-2/bin/$(basename $progpath) $protected
;;
mvp3v3)
$VGT -i $progpath -c mvp3 -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-3/bin/$(basename $progpath) $protected
;;
mvp4v1)
$VGT -i $progpath -c mvp4 -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-1/bin/$(basename $progpath) $protected
;;
mvp4v2)
$VGT -i $progpath -c mvp4 -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-2/bin/$(basename $progpath) $protected
;;
mvp4v3)
$VGT -i $progpath -c mvp4 -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-3/bin/$(basename $progpath) $protected
;;
mvpAv1)
$VGT -i $progpath -c mvpA -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-1/bin/$(basename $progpath) $protected
;;
mvpAv2)
$VGT -i $progpath -c mvpA -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-2/bin/$(basename $progpath) $protected
;;
mvpBv1)
$VGT -i $progpath -c mvpB -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-1/bin/$(basename $progpath) $protected
;;
mvpBv2)
$VGT -i $progpath -c mvpB -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-2/bin/$(basename $progpath) $protected
;;
mvpCv1)
$VGT -i $progpath -c mvpC -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-1/bin/$(basename $progpath) $protected
;;
mvpCv2)
$VGT -i $progpath -c mvpC -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-2/bin/$(basename $progpath) $protected
;;
mvpCv3)
$VGT -i $progpath -c mvpC -o $temp_dir > test_${prog}.ps.log 2>&1
cp $temp_dir/vs-1/variant-3/bin/$(basename $progpath) $protected
;;
orig) orig)
cp $progpath $protected cp $progpath $protected
;; ;;
...@@ -315,9 +383,32 @@ parse_args() ...@@ -315,9 +383,32 @@ parse_args()
} }
process_apps()
{
local new_apps=""
local fields=()
for i in $apps
do
IFS="=" read -ra fields <<< $i
if [[ ${#fields[@]} -gt 2 ]]; then
echo "Cannot separate $i into 2 fields based on delimiter '='"
exit 1
elif [[ ${#fields[@]} -eq 2 ]]; then
app_path[${fields[0]}]=${fields[1]}
elif [[ ${#fields[@]} -eq 1 ]]; then
app_path[${fields[0]}]=$(which ${fields[0]})
fi
new_apps="$new_apps ${fields[0]}"
done
apps="$new_apps"
}
main() main()
{ {
parse_args "$@" parse_args "$@"
process_apps
echo echo
echo "test configuration" echo "test configuration"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment