mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 18:50:13 +00:00
Improve Formatting & Commenting Tests 1-2
This commit is contained in:
parent
908bdd99f3
commit
a7e94b6023
4 changed files with 24 additions and 49 deletions
|
@ -60,10 +60,10 @@ defaultcolor=$(tput setaf default)
|
||||||
# ---------
|
# ---------
|
||||||
|
|
||||||
reloadNginX () {
|
reloadNginX () {
|
||||||
|
printf "\n"
|
||||||
echo "${bold}${green}---------------"
|
echo "${bold}${green}---------------"
|
||||||
echo "${bold}${green}Reloading Nginx"
|
echo "${bold}${green}Reloading Nginx"
|
||||||
echo "${bold}${green}---------------"
|
echo "${bold}${green}---------------"
|
||||||
printf "\n\n"
|
|
||||||
sudo nginx -t && sudo nginx -s reload
|
sudo nginx -t && sudo nginx -s reload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ waitforReload () {
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
||||||
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
sleep 10s
|
sleep 10s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,6 @@ printf "\n"
|
||||||
echo "${bold}${yellow}---------------------------"
|
echo "${bold}${yellow}---------------------------"
|
||||||
echo "${bold}${yellow}Making backup of nginx.conf"
|
echo "${bold}${yellow}Making backup of nginx.conf"
|
||||||
echo "${bold}${yellow}---------------------------"
|
echo "${bold}${yellow}---------------------------"
|
||||||
printf "\n"
|
|
||||||
sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/_nginx_conf_backup/nginx.conf
|
sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/_nginx_conf_backup/nginx.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +88,6 @@ printf "\n"
|
||||||
echo "${bold}${yellow}-------------------------------------------"
|
echo "${bold}${yellow}-------------------------------------------"
|
||||||
echo "${bold}${yellow}Delete any default files installed by Nginx"
|
echo "${bold}${yellow}Delete any default files installed by Nginx"
|
||||||
echo "${bold}${yellow}-------------------------------------------"
|
echo "${bold}${yellow}-------------------------------------------"
|
||||||
printf "\n"
|
|
||||||
sudo rm /etc/nginx/sites-available/default
|
sudo rm /etc/nginx/sites-available/default
|
||||||
sudo rm /etc/nginx/sites-enabled/default
|
sudo rm /etc/nginx/sites-enabled/default
|
||||||
sudo rm /var/www/html/*
|
sudo rm /var/www/html/*
|
||||||
|
@ -97,7 +95,6 @@ printf "\n"
|
||||||
echo "${bold}${yellow}---------------------"
|
echo "${bold}${yellow}---------------------"
|
||||||
echo "${bold}${yellow}Setup Vhost for Nginx"
|
echo "${bold}${yellow}Setup Vhost for Nginx"
|
||||||
echo "${bold}${yellow}---------------------"
|
echo "${bold}${yellow}---------------------"
|
||||||
printf "\n"
|
|
||||||
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/default.vhost /etc/nginx/sites-available/default.vhost
|
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/default.vhost /etc/nginx/sites-available/default.vhost
|
||||||
sudo ln -s /etc/nginx/sites-available/default.vhost /etc/nginx/sites-enabled/default.vhost
|
sudo ln -s /etc/nginx/sites-available/default.vhost /etc/nginx/sites-enabled/default.vhost
|
||||||
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/index.html /var/www/html/index.html
|
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/index.html /var/www/html/index.html
|
||||||
|
@ -114,7 +111,6 @@ printf "\n"
|
||||||
echo "${bold}${magenta}--------------------------------------"
|
echo "${bold}${magenta}--------------------------------------"
|
||||||
echo "${bold}${magenta}Fetch install-ngxblocker from the repo"
|
echo "${bold}${magenta}Fetch install-ngxblocker from the repo"
|
||||||
echo "${bold}${magenta}--------------------------------------"
|
echo "${bold}${magenta}--------------------------------------"
|
||||||
printf "\n"
|
|
||||||
sudo wget https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/install-ngxblocker -O /usr/sbin/install-ngxblocker
|
sudo wget https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/install-ngxblocker -O /usr/sbin/install-ngxblocker
|
||||||
sudo chmod +x /usr/sbin/install-ngxblocker
|
sudo chmod +x /usr/sbin/install-ngxblocker
|
||||||
}
|
}
|
||||||
|
@ -124,7 +120,6 @@ printf "\n"
|
||||||
echo "${bold}${magenta}--------------------------"
|
echo "${bold}${magenta}--------------------------"
|
||||||
echo "${bold}${magenta}Execute install-ngxblocker"
|
echo "${bold}${magenta}Execute install-ngxblocker"
|
||||||
echo "${bold}${magenta}--------------------------"
|
echo "${bold}${magenta}--------------------------"
|
||||||
printf "\n"
|
|
||||||
cd /usr/sbin
|
cd /usr/sbin
|
||||||
sudo bash ./install-ngxblocker -s /usr/sbin/ -x
|
sudo bash ./install-ngxblocker -s /usr/sbin/ -x
|
||||||
}
|
}
|
||||||
|
@ -134,7 +129,6 @@ printf "\n"
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
echo "${bold}${magenta}Execute setup-ngxblocker"
|
echo "${bold}${magenta}Execute setup-ngxblocker"
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
printf "\n"
|
|
||||||
cd /usr/sbin
|
cd /usr/sbin
|
||||||
sudo bash ./setup-ngxblocker -i /usr/sbin/install-ngxblocker -x
|
sudo bash ./setup-ngxblocker -i /usr/sbin/install-ngxblocker -x
|
||||||
}
|
}
|
||||||
|
@ -144,7 +138,6 @@ printf "\n"
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
echo "${bold}${magenta}Execute setup-ngxblocker"
|
echo "${bold}${magenta}Execute setup-ngxblocker"
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
printf "\n"
|
|
||||||
cd /usr/sbin
|
cd /usr/sbin
|
||||||
sudo bash ./setup-ngxblocker -x
|
sudo bash ./setup-ngxblocker -x
|
||||||
}
|
}
|
||||||
|
@ -158,7 +151,6 @@ printf "\n"
|
||||||
echo "${bold}${yellow}----------------------------------------------------"
|
echo "${bold}${yellow}----------------------------------------------------"
|
||||||
echo "${bold}${yellow}Copy older globalblacklist.conf file to force update"
|
echo "${bold}${yellow}Copy older globalblacklist.conf file to force update"
|
||||||
echo "${bold}${yellow}----------------------------------------------------"
|
echo "${bold}${yellow}----------------------------------------------------"
|
||||||
printf "\n"
|
|
||||||
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/globalblacklist-dummy.conf /etc/nginx/conf.d/globalblacklist.conf
|
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/globalblacklist-dummy.conf /etc/nginx/conf.d/globalblacklist.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +159,6 @@ printf "\n"
|
||||||
echo "${bold}${yellow}--------------------------------------"
|
echo "${bold}${yellow}--------------------------------------"
|
||||||
echo "${bold}${yellow}Delete Files to test update-ngxblocker"
|
echo "${bold}${yellow}Delete Files to test update-ngxblocker"
|
||||||
echo "${bold}${yellow}--------------------------------------"
|
echo "${bold}${yellow}--------------------------------------"
|
||||||
printf "\n"
|
|
||||||
sudo rm /etc/nginx/conf.d/*.conf
|
sudo rm /etc/nginx/conf.d/*.conf
|
||||||
sudo rm /etc/nginx/bots.d/*.conf
|
sudo rm /etc/nginx/bots.d/*.conf
|
||||||
ls -la /etc/nginx/conf.d/
|
ls -la /etc/nginx/conf.d/
|
||||||
|
@ -179,7 +170,6 @@ printf "\n"
|
||||||
echo "${bold}${yellow}----------------------------------------------------"
|
echo "${bold}${yellow}----------------------------------------------------"
|
||||||
echo "${bold}${yellow}Copy older globalblacklist.conf file to force update"
|
echo "${bold}${yellow}Copy older globalblacklist.conf file to force update"
|
||||||
echo "${bold}${yellow}----------------------------------------------------"
|
echo "${bold}${yellow}----------------------------------------------------"
|
||||||
printf "\n"
|
|
||||||
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/globalblacklist-dummy.conf /etc/nginx/conf.d/globalblacklist.conf
|
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/globalblacklist-dummy.conf /etc/nginx/conf.d/globalblacklist.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +178,6 @@ printf "\n"
|
||||||
echo "${bold}${magenta}-------------------------"
|
echo "${bold}${magenta}-------------------------"
|
||||||
echo "${bold}${magenta}Execute update-ngxblocker"
|
echo "${bold}${magenta}Execute update-ngxblocker"
|
||||||
echo "${bold}${magenta}-------------------------"
|
echo "${bold}${magenta}-------------------------"
|
||||||
printf "\n"
|
|
||||||
cd /usr/sbin
|
cd /usr/sbin
|
||||||
sudo bash ./update-ngxblocker -n
|
sudo bash ./update-ngxblocker -n
|
||||||
}
|
}
|
||||||
|
@ -198,7 +187,6 @@ printf "\n"
|
||||||
echo "${bold}${yellow}------------------------------------------------------------"
|
echo "${bold}${yellow}------------------------------------------------------------"
|
||||||
echo "${bold}${yellow}Make sure we test with latest generated globalblacklist.conf"
|
echo "${bold}${yellow}Make sure we test with latest generated globalblacklist.conf"
|
||||||
echo "${bold}${yellow}------------------------------------------------------------"
|
echo "${bold}${yellow}------------------------------------------------------------"
|
||||||
printf "\n"
|
|
||||||
sudo cp ${TRAVIS_BUILD_DIR}/conf.d/globalblacklist.conf /etc/nginx/conf.d/globalblacklist.conf
|
sudo cp ${TRAVIS_BUILD_DIR}/conf.d/globalblacklist.conf /etc/nginx/conf.d/globalblacklist.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +195,6 @@ printf "\n"
|
||||||
echo "${bold}${green}------------------------------------------------------------"
|
echo "${bold}${green}------------------------------------------------------------"
|
||||||
echo "${bold}${green}Make Backup all conf files and folders used during this test"
|
echo "${bold}${green}Make Backup all conf files and folders used during this test"
|
||||||
echo "${bold}${green}------------------------------------------------------------"
|
echo "${bold}${green}------------------------------------------------------------"
|
||||||
printf "\n"
|
|
||||||
sudo cp /etc/nginx/bots.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_test1/bots.d/
|
sudo cp /etc/nginx/bots.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_test1/bots.d/
|
||||||
sudo cp /etc/nginx/conf.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_test1/conf.d/
|
sudo cp /etc/nginx/conf.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_test1/conf.d/
|
||||||
sudo cp /etc/nginx/sites-available/default.vhost ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_test1/default.vhost
|
sudo cp /etc/nginx/sites-available/default.vhost ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_test1/default.vhost
|
||||||
|
|
|
@ -60,10 +60,10 @@ defaultcolor=$(tput setaf default)
|
||||||
# ---------
|
# ---------
|
||||||
|
|
||||||
reloadNginX () {
|
reloadNginX () {
|
||||||
|
printf "\n"
|
||||||
echo "${bold}${green}---------------"
|
echo "${bold}${green}---------------"
|
||||||
echo "${bold}${green}Reloading Nginx"
|
echo "${bold}${green}Reloading Nginx"
|
||||||
echo "${bold}${green}---------------"
|
echo "${bold}${green}---------------"
|
||||||
printf "\n\n"
|
|
||||||
sudo nginx -t && sudo nginx -s reload
|
sudo nginx -t && sudo nginx -s reload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ waitforReload () {
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
||||||
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
sleep 10s
|
sleep 10s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,15 +64,15 @@ resetNginx () {
|
||||||
echo "${bold}${green}------------------------------------------------"
|
echo "${bold}${green}------------------------------------------------"
|
||||||
echo "${bold}${green}Disable any User Whitelisting and set to Default"
|
echo "${bold}${green}Disable any User Whitelisting and set to Default"
|
||||||
echo "${bold}${green}------------------------------------------------"
|
echo "${bold}${green}------------------------------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/blacklist-user-agents-none.conf /etc/nginx/bots.d/blacklist-user-agents.conf
|
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/blacklist-user-agents-none.conf /etc/nginx/bots.d/blacklist-user-agents.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadNginX () {
|
reloadNginX () {
|
||||||
|
printf "\n"
|
||||||
echo "${bold}${green}---------------"
|
echo "${bold}${green}---------------"
|
||||||
echo "${bold}${green}Reloading Nginx"
|
echo "${bold}${green}Reloading Nginx"
|
||||||
echo "${bold}${green}---------------"
|
echo "${bold}${green}---------------"
|
||||||
printf "\n\n"
|
|
||||||
sudo nginx -t && sudo nginx -s reload
|
sudo nginx -t && sudo nginx -s reload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ waitforReload () {
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
||||||
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
sleep 10s
|
sleep 10s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,11 +224,10 @@ shuf -n 10 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list > ${TRAVIS_
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
sudo rm ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp
|
sudo rm ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp
|
||||||
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}---------------------------"
|
echo "${bold}${magenta}---------------------------"
|
||||||
echo "${bold}${magenta}Testing 10 Random Bad Bots"
|
echo "${bold}${magenta}Testing 10 Random Bad Bots"
|
||||||
echo "${bold}${magenta}---------------------------"
|
echo "${bold}${magenta}---------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -245,11 +244,10 @@ IFS=""
|
||||||
|
|
||||||
testGoodUserAgents () {
|
testGoodUserAgents () {
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/good-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/good-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}---------------------"
|
echo "${bold}${magenta}---------------------"
|
||||||
echo "${bold}${magenta}Testing All Good Bots"
|
echo "${bold}${magenta}Testing All Good Bots"
|
||||||
echo "${bold}${magenta}---------------------"
|
echo "${bold}${magenta}---------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -266,11 +264,10 @@ IFS=""
|
||||||
|
|
||||||
testAllowedUserAgents () {
|
testAllowedUserAgents () {
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/allowed-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/allowed-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
echo "${bold}${magenta}Testing All Allowed Bots"
|
echo "${bold}${magenta}Testing All Allowed Bots"
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -287,11 +284,10 @@ IFS=""
|
||||||
|
|
||||||
testLimitedUserAgents () {
|
testLimitedUserAgents () {
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/limited-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/limited-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
echo "${bold}${magenta}Testing All Limited Bots"
|
echo "${bold}${magenta}Testing All Limited Bots"
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -309,11 +305,10 @@ IFS=""
|
||||||
testRandomReferrers () {
|
testRandomReferrers () {
|
||||||
shuf -n 10 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
shuf -n 10 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
||||||
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}---------------------------------"
|
echo "${bold}${magenta}---------------------------------"
|
||||||
echo "${bold}${magenta}Testing 10 Random Bad Referrers"
|
echo "${bold}${magenta}Testing 10 Random Bad Referrers"
|
||||||
echo "${bold}${magenta}---------------------------------"
|
echo "${bold}${magenta}---------------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -329,11 +324,10 @@ IFS=""
|
||||||
}
|
}
|
||||||
|
|
||||||
testGoodReferrers () {
|
testGoodReferrers () {
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}----------------------"
|
echo "${bold}${magenta}----------------------"
|
||||||
echo "${bold}${magenta}Testing Good Referrers"
|
echo "${bold}${magenta}Testing Good Referrers"
|
||||||
echo "${bold}${magenta}----------------------"
|
echo "${bold}${magenta}----------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-referrers-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-referrers-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -355,7 +349,7 @@ IFS=""
|
||||||
echo "${bold}${green}--------------"
|
echo "${bold}${green}--------------"
|
||||||
echo "${bold}${green}Tests Starting"
|
echo "${bold}${green}Tests Starting"
|
||||||
echo "${bold}${green}--------------"
|
echo "${bold}${green}--------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
|
|
||||||
resetNginx
|
resetNginx
|
||||||
reloadNginX
|
reloadNginX
|
||||||
|
|
|
@ -64,15 +64,15 @@ resetNginx () {
|
||||||
echo "${bold}${green}------------------------------------------------"
|
echo "${bold}${green}------------------------------------------------"
|
||||||
echo "${bold}${green}Disable any User Whitelisting and set to Default"
|
echo "${bold}${green}Disable any User Whitelisting and set to Default"
|
||||||
echo "${bold}${green}------------------------------------------------"
|
echo "${bold}${green}------------------------------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/blacklist-user-agents-none.conf /usr/local/nginx/bots.d/blacklist-user-agents.conf
|
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/blacklist-user-agents-none.conf /usr/local/nginx/bots.d/blacklist-user-agents.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadNginX () {
|
reloadNginX () {
|
||||||
|
printf "\n"
|
||||||
echo "${bold}${green}---------------"
|
echo "${bold}${green}---------------"
|
||||||
echo "${bold}${green}Reloading Nginx"
|
echo "${bold}${green}Reloading Nginx"
|
||||||
echo "${bold}${green}---------------"
|
echo "${bold}${green}---------------"
|
||||||
printf "\n\n"
|
|
||||||
sudo nginx -t && sudo nginx -s reload
|
sudo nginx -t && sudo nginx -s reload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ waitforReload () {
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
||||||
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
sleep 10s
|
sleep 10s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,11 +224,10 @@ shuf -n 10 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list > ${TRAVIS_
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
sudo rm ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp
|
sudo rm ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp
|
||||||
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}---------------------------"
|
echo "${bold}${magenta}---------------------------"
|
||||||
echo "${bold}${magenta}Testing 10 Random Bad Bots"
|
echo "${bold}${magenta}Testing 10 Random Bad Bots"
|
||||||
echo "${bold}${magenta}---------------------------"
|
echo "${bold}${magenta}---------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -245,11 +244,10 @@ IFS=""
|
||||||
|
|
||||||
testGoodUserAgents () {
|
testGoodUserAgents () {
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/good-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/good-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}---------------------"
|
echo "${bold}${magenta}---------------------"
|
||||||
echo "${bold}${magenta}Testing All Good Bots"
|
echo "${bold}${magenta}Testing All Good Bots"
|
||||||
echo "${bold}${magenta}---------------------"
|
echo "${bold}${magenta}---------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -266,11 +264,10 @@ IFS=""
|
||||||
|
|
||||||
testAllowedUserAgents () {
|
testAllowedUserAgents () {
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/allowed-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/allowed-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
echo "${bold}${magenta}Testing All Allowed Bots"
|
echo "${bold}${magenta}Testing All Allowed Bots"
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -287,11 +284,10 @@ IFS=""
|
||||||
|
|
||||||
testLimitedUserAgents () {
|
testLimitedUserAgents () {
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/limited-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/limited-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
echo "${bold}${magenta}Testing All Limited Bots"
|
echo "${bold}${magenta}Testing All Limited Bots"
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -309,11 +305,10 @@ IFS=""
|
||||||
testRandomReferrers () {
|
testRandomReferrers () {
|
||||||
shuf -n 10 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
shuf -n 10 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
||||||
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}---------------------------------"
|
echo "${bold}${magenta}---------------------------------"
|
||||||
echo "${bold}${magenta}Testing 10 Random Bad Referrers"
|
echo "${bold}${magenta}Testing 10 Random Bad Referrers"
|
||||||
echo "${bold}${magenta}---------------------------------"
|
echo "${bold}${magenta}---------------------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -329,11 +324,10 @@ IFS=""
|
||||||
}
|
}
|
||||||
|
|
||||||
testGoodReferrers () {
|
testGoodReferrers () {
|
||||||
printf "\n\n"
|
|
||||||
echo "${bold}${magenta}----------------------"
|
echo "${bold}${magenta}----------------------"
|
||||||
echo "${bold}${magenta}Testing Good Referrers"
|
echo "${bold}${magenta}Testing Good Referrers"
|
||||||
echo "${bold}${magenta}----------------------"
|
echo "${bold}${magenta}----------------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-referrers-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-referrers-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -355,7 +349,7 @@ IFS=""
|
||||||
echo "${bold}${green}--------------"
|
echo "${bold}${green}--------------"
|
||||||
echo "${bold}${green}Tests Starting"
|
echo "${bold}${green}Tests Starting"
|
||||||
echo "${bold}${green}--------------"
|
echo "${bold}${green}--------------"
|
||||||
printf "\n\n"
|
printf "\n"
|
||||||
|
|
||||||
resetNginx
|
resetNginx
|
||||||
reloadNginX
|
reloadNginX
|
||||||
|
|
Loading…
Add table
Reference in a new issue