tee not pipe (#2078)

This commit is contained in:
Addison Crump 2024-04-18 18:23:57 +02:00 committed by GitHub
parent 84a432dab2
commit 276bfc6386
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 27 additions and 27 deletions

View File

@ -36,7 +36,7 @@ windows_alias = "unsupported"
[tasks.test_unix] [tasks.test_unix]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
timeout 30s ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME} >fuzz_stdout.log || true timeout 30s ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME} | tee fuzz_stdout.log || true
if grep -qa "objectives: 1" fuzz_stdout.log; then if grep -qa "objectives: 1" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"
else else

View File

@ -110,7 +110,7 @@ windows_alias = "unsupported"
[tasks.test_unix] [tasks.test_unix]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
timeout 30s ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME} ./corpus/ -t 1000 >fuzz_stdout.log || true timeout 30s ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME} ./corpus/ -t 1000 | tee fuzz_stdout.log || true
if grep -qa "objectives: 1" fuzz_stdout.log; then if grep -qa "objectives: 1" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"
else else

View File

@ -110,7 +110,7 @@ windows_alias = "test_windows"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 30s ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so >fuzz_stdout.log 2>/dev/null || true timeout 30s ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so | tee fuzz_stdout.log 2>/dev/null || true
if grep -qa "corpus: 30" fuzz_stdout.log; then if grep -qa "corpus: 30" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"
else else
@ -125,7 +125,7 @@ dependencies = [ "fuzzer", "harness" ]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 30s ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so >fuzz_stdout.log 2>/dev/null || true timeout 30s ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so | tee fuzz_stdout.log 2>/dev/null || true
''' '''
dependencies = [ "fuzzer", "harness" ] dependencies = [ "fuzzer", "harness" ]

View File

@ -82,7 +82,7 @@ rm -rf libafl_unix_shmem_server || true
mkdir in || true mkdir in || true
echo a > in/a echo a > in/a
# Allow sigterm as exit code # Allow sigterm as exit code
timeout 31s ./${FUZZER_NAME} -o out -i in >fuzz_stdout.log || true timeout 31s ./${FUZZER_NAME} -o out -i in | tee fuzz_stdout.log || true
if grep -qa "objectives: 1" fuzz_stdout.log; then if grep -qa "objectives: 1" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"
else else

View File

@ -82,7 +82,7 @@ rm -rf libafl_unix_shmem_server || true
mkdir in || true mkdir in || true
echo a > in/a echo a > in/a
# Allow sigterm as exit code # Allow sigterm as exit code
timeout 31s ./${FUZZER_NAME} -o out -i in >fuzz_stdout.log || true timeout 31s ./${FUZZER_NAME} -o out -i in | tee fuzz_stdout.log || true
if grep -qa "objectives: 1" fuzz_stdout.log; then if grep -qa "objectives: 1" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"
else else

View File

@ -83,7 +83,7 @@ rm -rf libafl_unix_shmem_server || true
mkdir in || true mkdir in || true
echo a > in/a echo a > in/a
# Allow sigterm as exit code # Allow sigterm as exit code
timeout 31s ./${FUZZER_NAME} -o out -i in >fuzz_stdout.log || true timeout 31s ./${FUZZER_NAME} -o out -i in | tee fuzz_stdout.log || true
cat fuzz_stdout.log cat fuzz_stdout.log
if grep -qa "objectives: 1" fuzz_stdout.log; then if grep -qa "objectives: 1" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"

View File

@ -99,7 +99,7 @@ windows_alias = "unsupported"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) & (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2 sleep 0.2
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
if grep -qa "corpus: 30" fuzz_stdout.log; then if grep -qa "corpus: 30" fuzz_stdout.log; then

View File

@ -161,7 +161,7 @@ windows_alias = "unsupported"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) & (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2 sleep 0.2
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
if grep -qa "corpus: 30" fuzz_stdout.log; then if grep -qa "corpus: 30" fuzz_stdout.log; then
@ -177,7 +177,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) & (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2 sleep 0.2
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
''' '''

View File

@ -98,7 +98,7 @@ windows_alias = "unsupported"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus >fuzz_stdout.log 2>/dev/null || true timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus | tee fuzz_stdout.log 2>/dev/null || true
if grep -qa "corpus: 30" fuzz_stdout.log; then if grep -qa "corpus: 30" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"
else else
@ -112,7 +112,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus >fuzz_stdout.log 2>/dev/null || true timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus | tee fuzz_stdout.log 2>/dev/null || true
''' '''
dependencies = [ "fuzzer" ] dependencies = [ "fuzzer" ]

View File

@ -171,7 +171,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
(timeout --foreground 11s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) & (timeout --foreground 11s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2 sleep 0.2
timeout --foreground 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true timeout --foreground 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
''' '''

View File

@ -98,7 +98,7 @@ windows_alias = "unsupported"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null | tee fuzz_stdout.log || true
if grep -qa "corpus: 30" fuzz_stdout.log; then if grep -qa "corpus: 30" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"
else else
@ -112,7 +112,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null | tee fuzz_stdout.log || true
''' '''
dependencies = [ "fuzzer" ] dependencies = [ "fuzzer" ]

View File

@ -161,7 +161,7 @@ windows_alias = "unsupported"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log & timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log &
sleep 0.2 sleep 0.2
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
if grep -qa "corpus: 30" fuzz_stdout.log; then if grep -qa "corpus: 30" fuzz_stdout.log; then
@ -177,7 +177,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log & timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log &
sleep 0.2 sleep 0.2
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
''' '''

View File

@ -99,7 +99,7 @@ windows_alias = "unsupported"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME}.coverage --broker-port 21337 --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true timeout 31s ./${FUZZER_NAME}.coverage --broker-port 21337 --cores 0 --input ./corpus 2>/dev/null | tee fuzz_stdout.log || true
if grep -qa "corpus: 30" fuzz_stdout.log; then if grep -qa "corpus: 30" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"
else else
@ -113,7 +113,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null | tee fuzz_stdout.log || true
''' '''
dependencies = [ "fuzzer" ] dependencies = [ "fuzzer" ]

View File

@ -104,7 +104,7 @@ rm -rf libafl_unix_shmem_server || true
rm -rf corpus/ || true rm -rf corpus/ || true
mkdir corpus/ || true mkdir corpus/ || true
cp seeds/* corpus/ || true cp seeds/* corpus/ || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null | tee fuzz_stdout.log || true
if grep -qa "corpus: 30" fuzz_stdout.log; then if grep -qa "corpus: 30" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"
else else

View File

@ -161,7 +161,7 @@ windows_alias = "unsupported"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) & (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2 sleep 0.2
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
if grep -qa "corpus: 30" fuzz_stdout.log; then if grep -qa "corpus: 30" fuzz_stdout.log; then
@ -177,7 +177,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) & (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2 sleep 0.2
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
''' '''

View File

@ -62,7 +62,7 @@ windows_alias = "test_windows"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) & (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2 sleep 0.2
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
if grep -qa "corpus: 30" fuzz_stdout.log; then if grep -qa "corpus: 30" fuzz_stdout.log; then
@ -78,7 +78,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) & (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2 sleep 0.2
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
''' '''

View File

@ -60,7 +60,7 @@ windows_alias = "test_windows"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME} 2>/dev/null >fuzz_stdout.log || true timeout 31s ./${FUZZER_NAME} 2>/dev/null | tee fuzz_stdout.log || true
echo "The test is skipped. See https://github.com/AFLplusplus/LibAFL/issues/1176" echo "The test is skipped. See https://github.com/AFLplusplus/LibAFL/issues/1176"
''' '''
dependencies = [ "fuzzer" ] dependencies = [ "fuzzer" ]

View File

@ -106,7 +106,7 @@ windows_alias = "unsupported"
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME} --cores 0 >fuzz_stdout.log 2>/dev/null || true timeout 31s ./${FUZZER_NAME} --cores 0 | tee fuzz_stdout.log 2>/dev/null || true
if grep -qa "corpus: 8" fuzz_stdout.log; then if grep -qa "corpus: 8" fuzz_stdout.log; then
echo "Fuzzer is working" echo "Fuzzer is working"
else else
@ -120,7 +120,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell" script_runner = "@shell"
script=''' script='''
rm -rf libafl_unix_shmem_server || true rm -rf libafl_unix_shmem_server || true
timeout 31s ./${FUZZER_NAME} --cores 0 >fuzz_stdout.log 2>/dev/null || true timeout 31s ./${FUZZER_NAME} --cores 0 | tee fuzz_stdout.log 2>/dev/null || true
''' '''
dependencies = [ "fuzzer" ] dependencies = [ "fuzzer" ]