|
| 1 | +DOCKER POWERED TEST HARNESS |
| 2 | + |
| 3 | +a. DESCRIPTION |
| 4 | + |
| 5 | +A series of docker images which support running isolated test scripts (using BATS, bash, or Python). |
| 6 | +Once built, the images allow loading and customizing the Docker container environment for a given |
| 7 | +test script. |
| 8 | + |
| 9 | +The general form for test invocation is: docker_container_driver.sh <path_to_script_on_host> |
| 10 | + |
| 11 | +Within the container, a computed internal path to the same script is executed, whether directly or |
| 12 | +indirectly by a wrapper script. The wrapper for many of the PRC authentication-via-PAM tests is |
| 13 | +irods/test/login_auth_test.sh. |
| 14 | + |
| 15 | +The test_script_parameters file, located in the irods/test/harness directory, contains customized |
| 16 | +settings for each test script run, including: |
| 17 | + |
| 18 | + - Docker image name to be used. |
| 19 | + |
| 20 | + - Wrapper to be invoked, if any. Wrappers shall perform common setup tasks up to and including |
| 21 | + invoking the test script itself. |
| 22 | + |
| 23 | + - Which user is running the test. (Unless otherwise specified, this is the passwordless-sudo- |
| 24 | + enabled user 'testuser'). |
| 25 | + |
| 26 | +When done with a test, the docker_container_driver.sh exit code mirrors the return code from the |
| 27 | +run of the test script. The container itself is removed unless the -L ("leak") option is given. |
| 28 | + |
| 29 | +b. SAMPLE RUNS |
| 30 | + |
| 31 | +To build required images |
| 32 | +------------------------ |
| 33 | +For our convenience in this doc, set a shell variable REPOROOT to ~/python-irodsclient (or |
| 34 | +similar) to specify the path to the top level of the local repository. |
| 35 | + |
| 36 | +Sample command lines to build Docker images: |
| 37 | + |
| 38 | + 1) cd $REPO_ROOT/irods/test/harness |
| 39 | + ./build_docker.sh |
| 40 | + |
| 41 | + Builds docker images in proper sequence. |
| 42 | + |
| 43 | + 2) cd $REPO_ROOT/irods/test/harness; |
| 44 | + IRODS_PACKAGE_VERSION=4.3.4 PYTHON_VERSION=3.11 NO_CACHE=1 ./build-docker.sh [ Dockerfiles... ] |
| 45 | + |
| 46 | + Builds (ignoring docker cache) images based on specific iRODS package version and desired |
| 47 | + Python Interpreter version, optionally with a restricted list of Docker files in need of rebulding. |
| 48 | + |
| 49 | +Sample command lines to run a test script. |
| 50 | + |
| 51 | +$REPO_ROOT/irods/test/harness/docker_container_driver.sh $REPO_ROOT/irods/test/scripts/run_local_suite |
| 52 | + |
| 53 | +For both builder and driver script, the environment variable DOCKER may be set to "podman" to run |
| 54 | +the alternative container engine. It will otherwise default to a value of "docker". |
| 55 | + |
| 56 | + |
0 commit comments