Skip to content

Commit

Permalink
Add test for MODCLUSTER-794
Browse files Browse the repository at this point in the history
  • Loading branch information
jajik committed Aug 10, 2023
1 parent 7767403 commit cb0be6b
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
source includes/common.sh
res=0
# Those are currently all tests we have. In CI only MODCLUSTER-{734,755}/testit.sh pass, so until we fix the issue, only these tests are enabled.
# basetests.sh hangingtests.sh maintests.sh JBCS-1236/testit.sh MODCLUSTER-640/testit.sh MODCLUSTER-734/testit.sh MODCLUSTER-755/testit.sh MODCLUSTER-785/testit.sh
# basetests.sh hangingtests.sh maintests.sh JBCS-1236/testit.sh MODCLUSTER-640/testit.sh MODCLUSTER-734/testit.sh MODCLUSTER-755/testit.sh MODCLUSTER-785/testit.sh MODCLUSTER-794/testit.sh
for testcase in MODCLUSTER-734/testit.sh MODCLUSTER-755/testit.sh
do
run_test $testcase $(echo $testcase | cut -f1 -d/)
Expand Down
60 changes: 60 additions & 0 deletions test/MODCLUSTER-794/mod_proxy_cluster.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
LoadModule watchdog_module modules/mod_watchdog.so

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so

<IfModule !lbmethod_cluster_module>
UseAlias On
</IfModule>

ProxyPreserveHost On

<IfModule manager_module>
Listen 6666
ServerName localhost
ManagerBalancerName mycluster

<IfModule !lbmethod_cluster_module>
CreateBalancers 0
EnableOptions On
</IfModule>

EnableWsTunnel
WSUpgradeHeader websocket
<VirtualHost *:6666>
EnableMCPMReceive
<Directory />
Require ip 127.0.0.
Require ip ::1
# This one is used in GH Actions
Require ip 172.17.
</Directory>
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Require ip 127.0.0.
Require ip ::1
# This one is used in GH Actions
Require ip 172.17.
</Location>
</VirtualHost>
</IfModule>

<IfModule lbmethod_cluster_module>
LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
LoadModule watchdog_module modules/mod_watchdog.so
<Proxy "balancer://mycluster">
ProxySet growth=10
ProxySet lbmethod=cluster
</Proxy>
</IfModule>

# This is the default value, but let's go with the explicit here
Maxnode 20

35 changes: 35 additions & 0 deletions test/MODCLUSTER-794/testit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/sh

# Shell to test MODCLUSTER-794

pwd | grep MODCLUSTER-794
if [ $? ]; then
PREFIX=MODCLUSTER-794
else
PREFIX="."
fi

. includes/common.sh

# first stop any previously running tests.
tomcat_all_stop
tomcat_all_remove
httpd_all_clean

MPC_NAME=MODCLUSTER-794 MPC_CONF=https://raw.githubusercontent.com/modcluster/mod_proxy_cluster/main/test/MODCLUSTER-794/mod_proxy_cluster.conf httpd_run

for i in {1..20}; do
tomcat_start $i
done

sleep 20

curl -m 10 localhost:6666

if [ $? -ne 0 ]; then
echo "curl to server failed"
tomcat_all_remove
return 1
fi

tomcat_all_remove
2 changes: 2 additions & 0 deletions test/testsuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ run_test MODCLUSTER-755/testit.sh "MODCLUSTER-755"
res=$(expr $res + $?)
run_test MODCLUSTER-785/testit.sh "MODCLUSTER-785"
res=$(expr $res + $?)
run_test MODCLUSTER-794/testit.sh "MODCLUSTER-794"
res=$(expr $res + $?)

echo "Clean remaining httpd containers"
httpd_all_clean
Expand Down

0 comments on commit cb0be6b

Please sign in to comment.