mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-03 02:59:57 +00:00
Test New Curl Test Format on Test Unit REF: #264
This commit is contained in:
parent
6781978cc7
commit
9f52c83202
1 changed files with 14 additions and 5 deletions
|
@ -296,12 +296,22 @@ run_curltest14
|
||||||
# Function Curl Test 15 - TEST CASES
|
# Function Curl Test 15 - TEST CASES
|
||||||
# **************************************************
|
# **************************************************
|
||||||
|
|
||||||
|
#run_curltest15 () {
|
||||||
|
#truncate -s 0 ${_curltest15}
|
||||||
|
#printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
||||||
|
#printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest15}"
|
||||||
|
#curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000/index.php 2>&1 >> ${_curltest15}
|
||||||
|
#if grep -i 'Welcome' ${_curltest15}; then
|
||||||
|
# echo "$(tput setaf 2)NO FALSE POSITIVE - TEST PASSED"
|
||||||
|
#else
|
||||||
|
# echo "$(tput setaf 1)FALSE POSITIVE - TEST FAILED"
|
||||||
|
#fi
|
||||||
|
#}
|
||||||
|
#run_curltest15
|
||||||
|
|
||||||
run_curltest15 () {
|
run_curltest15 () {
|
||||||
truncate -s 0 ${_curltest15}
|
|
||||||
printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
||||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest15}"
|
if grep -i 'Welcome' | curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000/index.php 2>&1; then
|
||||||
curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000/index.php 2>&1 >> ${_curltest15}
|
|
||||||
if grep -i 'Welcome' ${_curltest15}; then
|
|
||||||
echo "$(tput setaf 2)NO FALSE POSITIVE - TEST PASSED"
|
echo "$(tput setaf 2)NO FALSE POSITIVE - TEST PASSED"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)FALSE POSITIVE - TEST FAILED"
|
echo "$(tput setaf 1)FALSE POSITIVE - TEST FAILED"
|
||||||
|
@ -309,7 +319,6 @@ fi
|
||||||
}
|
}
|
||||||
run_curltest15
|
run_curltest15
|
||||||
|
|
||||||
|
|
||||||
echo "Tests Completed"
|
echo "Tests Completed"
|
||||||
|
|
||||||
# **********************
|
# **********************
|
||||||
|
|
Loading…
Add table
Reference in a new issue