Blame tests/blackbox-segfault.sh

Packit Service f88c7f
#!/bin/sh
Packit Service f88c7f
#
Packit Service eb5446
# Needs PATH to be set to find accompanying test programs
Packit Service eb5446
# - including qb-blackbox which for in-tree tests should be
Packit Service eb5446
# - in ../tools
Packit Service eb5446
Packit Service eb5446
#
Packit Service f88c7f
# create a normal blackbox
Packit Service eb5446
#
Packit Service f88c7f
rm -f crash-test-dummy.fdata
Packit Service eb5446
crash_test_dummy
Packit Service eb5446
rm -f core*
Packit Service f88c7f
Packit Service eb5446
. test.conf
Packit Service f88c7f
Packit Service f88c7f
# first test that reading the valid
Packit Service f88c7f
# blackbox data actually works.
Packit Service eb5446
qb-blackbox crash-test-dummy.fdata
Packit Service f88c7f
if [ $? -ne 0 ]; then
Packit Service f88c7f
	exit 1
Packit Service f88c7f
fi
Packit Service f88c7f
Packit Service f88c7f
for i in $(seq $NUM_BB_TESTS)
Packit Service f88c7f
do
Packit Service f88c7f
    rm -f butchered_blackbox.fdata
Packit Service f88c7f
    echo " ==== Corrupt blackbox test $i/$NUM_BB_TESTS ===="
Packit Service eb5446
    file_change_bytes -i crash-test-dummy.fdata -o butchered_blackbox.fdata -n 1024
Packit Service eb5446
    qb-blackbox butchered_blackbox.fdata
Packit Service f88c7f
    [ $? -gt 127 ] && exit 1 || true
Packit Service f88c7f
done
Packit Service f88c7f
Packit Service f88c7f
exit 0