From 7032c018fe6aebd612ff7f5d5c0b019eab93811e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Tue, 18 Jul 2023 16:24:32 +0200 Subject: [PATCH] wip --- test/README.md | 71 +++++++++++++++++--------------------------------- 1 file changed, 24 insertions(+), 47 deletions(-) diff --git a/test/README.md b/test/README.md index 486019ef4..a4fdb953f 100644 --- a/test/README.md +++ b/test/README.md @@ -5,8 +5,22 @@ live within their own subdirectories. All tests can be run by a single shell scr is a bit parametrized so that you can influence the duration of testing. Upon invocation, the script outputs values of its parameters. You can change the value by passing the environment variable of the same name with a desired value. +```sh +# to execute the whole testsuite +sh testsuite.sh +# to execute the testsuite with DEBUG on and only one Tomcat cycle, execute +DEBUG=1 TOMCAT_CYCLE_COUNT=1 sh testsuite.sh +``` + You can also run the individual testsuites by yourself, just execute the corresponsing script. +```sh +sh basetests.sh +# alternatively, you can use the run_test function +source includes/common.sh # load definitions +run_test basetests.sh "Basic tests" # run tests +``` + You might find useful `includes` directory, especially `common.sh` script that contains shared functions for the tests (mainly for controlling container images, see the section below). @@ -20,7 +34,11 @@ repository. Also, if you use `podman` instead of `docker`, make sure you have `podman-docker` package installed (tests are using `docker`). -If you don't want to use quay.io, just set `IMG` and `HTTPD_IMG` variables to docker, local repository or some other service. +If you don't want to use quay.io (the default), just set `IMG` and `HTTPD_IMG` variables to docker, local repository or some +other service. + +There are a few helper functions for both images, however, if you want to control the images manually, use the corresponding +Dockerfiles. See the testsuite, mainly `includes/common.sh`, to see how the images are run. ### httpd_mod_cluster @@ -33,55 +51,14 @@ the prefix `httpd_` are using this image. The second image is a Tomcat image with mod_cluster enabled. Its Dockerfile is in the test root directory and tests use `tomcat_create` function. As for httpd, all functions orking with tomcat image are prefixed `tomcat_`. -#### Building and pushing the image - -You can build the images manually or using included Makefiles. For tomcat, you can built the image by running - -``` -make docker-build -``` -and then push it to quay.io by - -``` -make docker-push -``` - -Do not forget to log into quay.io before you run those commands. You can log in using `docker login quay.io`. +## Dependencies +There are several dependecies / other repositories you have to have checked out and built/installed, namely: -#### Running the image -``` -docker run --network=host -e tomcat_port=[port] -e cluster_port=[port] [image] -Or -docker run --network=host -e tomcat_ajp_port=[port] -e cluster_port=[port] [image] -# You can also add the variable -e tomcat_shutdown_port=true if u want to have a shutdown port -``` - -To load webapps into the container: -``` -docker cp webapp.war :/usr/local/tomcat/webapps/ -``` - -## Testing websocket -Using com.ning.http.client.ws.WebSocketTextListener -To be able to run `maintests.sh` successfully, please check out https://github.com/jfclere/httpd_websocket -and build it: -``` -git clone https://github.com/jfclere/httpd_websocket -cd https://github.com/jfclere/httpd_websocket -mvn install -cd .. -``` -Build the groovy jar -``` -mvn install -``` -run the groovy stuff -``` -java -jar target/test-1.0.jar -``` +* https://github.com/jfclere/httpd_websocket +* https://github.com/modcluster/mod_cluster -*NOTE: You might need an older JAVA version – version 11 should be ok. You can change it via JAVA env variable.* +Alternatively, you can use `setup-dependencies.sh` script that prepares everything for you. # Testing with miniserver There is also a python script that can be run to check mod_proxy_cluster. You can find it within `includes` directory