From 6a71d251cd80b5c06267003942447c42faff697c Mon Sep 17 00:00:00 2001 From: idbeta Date: Tue, 23 Feb 2021 13:31:01 +0800 Subject: [PATCH 1/4] test: add fuzzing case --- .github/workflows/fuzzing-ci.yaml | 8 +- t/fuzzing/public.pyc | Bin 0 -> 1743 bytes t/fuzzing/serverless_route_test.py | 112 ++++++++++++++++++ .../{route_test.py => simpleroute_test.py} | 0 4 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 t/fuzzing/public.pyc create mode 100644 t/fuzzing/serverless_route_test.py rename t/fuzzing/{route_test.py => simpleroute_test.py} (100%) diff --git a/.github/workflows/fuzzing-ci.yaml b/.github/workflows/fuzzing-ci.yaml index 1b27660c4ee3..634b8fb2e612 100644 --- a/.github/workflows/fuzzing-ci.yaml +++ b/.github/workflows/fuzzing-ci.yaml @@ -51,9 +51,13 @@ jobs: run: | pip install typing boofuzz - - name: run test + - name: run simpleroute test run: | - python $PWD/t/fuzzing/route_test.py + python $PWD/t/fuzzing/simpleroute_test.py + + - name: run serverless route test + run: | + python $PWD/t/fuzzing/serverless_route_test.py - name: echo test log # more than 150k lines, so only display the last log, actually, this step is not needed. diff --git a/t/fuzzing/public.pyc b/t/fuzzing/public.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d8b6a0677579d07301a2b74cadd1c1f77a791ce GIT binary patch literal 1743 zcmbtUQEwYX5T3oW-PlcN1t<_Iq$5fd3n_7g#9LK@XjSnNMQ0EwQe`f88+$Kj-}QFg zrp10CNIb*;<5%zl;QRLMlkS|^29b21uTm_m<6ePFp2_7Ky- z_g2?-V6t=VlEL)t*tkJb8EdWvZg4Sw_s-15gKB+ZoNo!6tx)E@y_Mj^@{ ziAx+WFzjy-3!k=~rSd3{on_!r2!uSfWT9j`Ys(_Qt0Rk0w#T6?TXOY67A<-9@+(=k zSNT{VjrRnH&NjRzL}G%xC3#z}MV9dHNY<6hKeWcY)FHm z99wrE;JhqZun`pQ0p?8^M?P-q9^UGblmSr59nxuL9oY!rn4kH0_oGV1FDX8K!X6Z1d(2=kgP(#phvJVGMRS- zP#X9mgEj8m(r{Yn`$vq-}^X#IQRM6W?MlAIK^fB7X$(s)L}hD1G|)s#YfRw}-zn z4v&0=t2@y4}YP#+Eo5RODCqtYP1RslPrsw0e=(59|FaX=;HTIXcd3PIh$zJY Date: Tue, 23 Feb 2021 13:37:38 +0800 Subject: [PATCH 2/4] remove trailing spaces --- .github/workflows/fuzzing-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fuzzing-ci.yaml b/.github/workflows/fuzzing-ci.yaml index 634b8fb2e612..04b30d190f74 100644 --- a/.github/workflows/fuzzing-ci.yaml +++ b/.github/workflows/fuzzing-ci.yaml @@ -54,7 +54,7 @@ jobs: - name: run simpleroute test run: | python $PWD/t/fuzzing/simpleroute_test.py - + - name: run serverless route test run: | python $PWD/t/fuzzing/serverless_route_test.py From 6dfc821d6bcac48ecd592bbaa2206b2b8402ac25 Mon Sep 17 00:00:00 2001 From: idbeta Date: Tue, 23 Feb 2021 13:50:33 +0800 Subject: [PATCH 3/4] remove useless file --- t/fuzzing/public.pyc | Bin 1743 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 t/fuzzing/public.pyc diff --git a/t/fuzzing/public.pyc b/t/fuzzing/public.pyc deleted file mode 100644 index 5d8b6a0677579d07301a2b74cadd1c1f77a791ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1743 zcmbtUQEwYX5T3oW-PlcN1t<_Iq$5fd3n_7g#9LK@XjSnNMQ0EwQe`f88+$Kj-}QFg zrp10CNIb*;<5%zl;QRLMlkS|^29b21uTm_m<6ePFp2_7Ky- z_g2?-V6t=VlEL)t*tkJb8EdWvZg4Sw_s-15gKB+ZoNo!6tx)E@y_Mj^@{ ziAx+WFzjy-3!k=~rSd3{on_!r2!uSfWT9j`Ys(_Qt0Rk0w#T6?TXOY67A<-9@+(=k zSNT{VjrRnH&NjRzL}G%xC3#z}MV9dHNY<6hKeWcY)FHm z99wrE;JhqZun`pQ0p?8^M?P-q9^UGblmSr59nxuL9oY!rn4kH0_oGV1FDX8K!X6Z1d(2=kgP(#phvJVGMRS- zP#X9mgEj8m(r{Yn`$vq-}^X#IQRM6W?MlAIK^fB7X$(s)L}hD1G|)s#YfRw}-zn z4v&0=t2@y4}YP#+Eo5RODCqtYP1RslPrsw0e=(59|FaX=;HTIXcd3PIh$zJY Date: Tue, 23 Feb 2021 17:08:23 +0800 Subject: [PATCH 4/4] fixed bug --- t/fuzzing/public.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/fuzzing/public.py b/t/fuzzing/public.py index e91a49aa096b..00f4ed20c33b 100644 --- a/t/fuzzing/public.py +++ b/t/fuzzing/public.py @@ -29,7 +29,7 @@ def check_log(*logs): apisix_errorlog = logs[1] apisix_accesslog = logs[2] - cmds = ['cat %s | grep -a "fail"'%boofuzz_log, 'cat %s | grep -a "error"'%apisix_errorlog, 'cat %s | grep -a " 500 "'%apisix_accesslog] + cmds = ['cat %s | grep -a "fail"'%boofuzz_log, 'cat %s | grep -a "error" | grep -v "invalid request body"'%apisix_errorlog, 'cat %s | grep -a " 500 "'%apisix_accesslog] for cmd in cmds: r = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) assert r.stdout.read().strip() == ""