fix qemu sigunaction tests

This commit is contained in:
vanhauser-thc
2022-03-29 10:34:08 +02:00
parent d2ea1141eb
commit b34751efbf
3 changed files with 14 additions and 18 deletions

View File

@ -12,19 +12,19 @@
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
.POSIX:
_UNIQ=_QINU_ TARGETS=unsigaction.so unsigaction32.so unsigaction64.so
TARGETCANDIDATES=unsigaction.so
_TARGETS=$(_UNIQ)$(AFL_NO_X86)$(_UNIQ)
__TARGETS=$(_TARGETS:$(_UNIQ)1$(_UNIQ)=)
TARGETS=$(__TARGETS:$(_UNIQ)$(_UNIQ)=$(TARGETCANDIDATES))
all: $(TARGETS) all: $(TARGETS)
unsigaction.so: unsigaction.c unsigaction.so: unsigaction.c
@if $(CC) -fPIC -shared unsigaction.c -o unsigaction.so 2>/dev/null ; then echo "unsigaction build success"; else echo "unsigaction build failure (that's fine)"; fi @if $(CC) -fPIC -shared unsigaction.c -o unsigaction.so 2>/dev/null ; then echo "unsigaction build success"; else echo "unsigaction build failure (that's fine)"; fi
unsigaction32.so: unsigaction.c
@if $(CC) -fPIC -m32 -shared unsigaction.c -o unsigaction32.so 2>/dev/null ; then echo "unsigaction32 build success"; else echo "unsigaction32 build failure (that's fine)"; fi
unsigaction64.so: unsigaction.c
@if $(CC) -fPIC -m64 -shared unsigaction.c -o unsigaction64.so 2>/dev/null ; then echo "unsigaction64 build success"; else echo "unsigaction64 build failure (that's fine)"; fi
clean: clean:
rm -f unsigaction.so rm -f unsigaction.so

View File

@ -165,11 +165,8 @@ test -e ../afl-qemu-trace && {
CODE=1 CODE=1
} }
} || { } || {
echo CUT------------------------------------------------------------------CUT $ECHO "$YELLOW[-] cannot compile test program (32 bit) for unsigaction library"
cat errors INCOMPLETE=1
echo CUT------------------------------------------------------------------CUT
$ECHO "$RED[!] cannot compile test program (32 bit) for unsigaction library"
CODE=1
} }
} || { } || {
$ECHO "$YELLOW[-] we cannot test qemu_mode unsigaction library (32 bit) because it is not present" $ECHO "$YELLOW[-] we cannot test qemu_mode unsigaction library (32 bit) because it is not present"
@ -194,11 +191,8 @@ test -e ../afl-qemu-trace && {
} }
unset LD_PRELOAD unset LD_PRELOAD
} || { } || {
echo CUT------------------------------------------------------------------CUT $ECHO "$YELLOW[-] cannot compile test program (64 bit) for unsigaction library"
cat errors INCOMPLETE=1
echo CUT------------------------------------------------------------------CUT
$ECHO "$RED[!] cannot compile test program (64 bit) for unsigaction library"
CODE=1
} }
} || { } || {
$ECHO "$YELLOW[-] we cannot test qemu_mode unsigaction library (64 bit) because it is not present" $ECHO "$YELLOW[-] we cannot test qemu_mode unsigaction library (64 bit) because it is not present"

View File

@ -217,7 +217,9 @@ cd ../samples/python_simple || echo "Cannot cd"
# Run afl-showmap on the sample application. If anything comes out then it must have worked! # Run afl-showmap on the sample application. If anything comes out then it must have worked!
unset AFL_INST_RATIO unset AFL_INST_RATIO
echo 0 | ../../../afl-showmap -U -m none -t 2000 -q -o ./.test-instr0 -- $PYTHONBIN ./simple_test_harness.py ./sample_inputs/sample1.bin || echo "Showmap" pwd
echo "echo 0 | ../../../afl-showmap -U -m none -t 2000 -o ./.test-instr0 -- $PYTHONBIN ./simple_test_harness.py ./sample_inputs/sample1.bin"
echo 0 | ../../../afl-showmap -U -m none -t 2000 -o ./.test-instr0 -- $PYTHONBIN ./simple_test_harness.py ./sample_inputs/sample1.bin || echo "Showmap"
if [ -s ./.test-instr0 ] if [ -s ./.test-instr0 ]
then then