Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
f7580e9
Github action for running PRC tests
trel Feb 13, 2024
985d853
do not run pam_interactive tests as part of suite
d-w-moore Sep 3, 2025
37273ce
make a copy of read-only repo from which to install PRC
d-w-moore Sep 3, 2025
b5c2cc9
irods5
d-w-moore Sep 10, 2025
7ff4da7
chgs to workflow for irods 4 and 5
d-w-moore Sep 12, 2025
f395657
ws
d-w-moore Sep 12, 2025
d2e8565
save off irods-4 container files
d-w-moore Sep 15, 2025
219d683
preserve old dirs as irods 4 container versions
d-w-moore Sep 16, 2025
40653c3
add "irods_major" as docker compose param
d-w-moore Sep 16, 2025
723a6f0
branch builds for irods 4 and 5
d-w-moore Sep 16, 2025
2057413
fully parameterize irods+version
d-w-moore Sep 16, 2025
c3fab7a
send_oneshot now symlink
d-w-moore Sep 16, 2025
316f28d
add test options -n, -b to start_containser
d-w-moore Sep 16, 2025
bb799d4
add stop_containers
d-w-moore Sep 16, 2025
8ce39c3
no symlinks allowed in dockerfile context
d-w-moore Sep 16, 2025
b1d1e10
provide writeable dir 'test-data' for pool_test
d-w-moore Sep 16, 2025
72fc1f5
chown 'test-data'
d-w-moore Sep 16, 2025
3db0d0b
irods 5 tests
d-w-moore Sep 16, 2025
4b11078
docker image to list available package versions for a linux_vsn
d-w-moore Sep 16, 2025
dbc4d6a
health check and container synchronization
d-w-moore Sep 23, 2025
17e34f4
[_502]{_SQ] experimental test harness using containers
d-w-moore Jan 30, 2024
4a62021
misc py irods 5 chgs
d-w-moore Sep 24, 2025
63c19c1
utility script to generate docker images
d-w-moore Sep 24, 2025
c3e8648
carry forward args in create-docker-images
d-w-moore Sep 24, 2025
64331a8
changes to test asserts involving regex
d-w-moore Sep 25, 2025
9076727
healthcheck replaces oneshot mechanism
d-w-moore Sep 25, 2025
98903fd
correct iRODS version detect for server start
d-w-moore Sep 26, 2025
7d7dc6b
change image
d-w-moore Sep 26, 2025
918de89
preliminary local suite test
d-w-moore Sep 26, 2025
230ebf4
include script for local suite run.
d-w-moore Sep 29, 2025
d340e5d
print iRODS and Python Interpreter versions in header
d-w-moore Sep 29, 2025
b15d2d2
remove redundenat script
d-w-moore Sep 29, 2025
a294448
refactor for /pyN
d-w-moore Sep 29, 2025
c9a2731
column check test now filters by server version
d-w-moore Sep 29, 2025
a02fea0
integrate local PRC suite run
d-w-moore Sep 29, 2025
2d91709
rename new workflow
d-w-moore Sep 29, 2025
7b52877
name output include both python and iRODS
d-w-moore Sep 29, 2025
36f9643
amend workflow script
d-w-moore Sep 29, 2025
f424c58
debugchanges
d-w-moore Sep 30, 2025
abe2232
can start-bg server (for /tmp/irods.log)
d-w-moore Sep 30, 2025
4470fd7
TLS initializes correctly but Bats tests still fail
d-w-moore Sep 30, 2025
76ebc9e
get test working by adding sleep
d-w-moore Oct 1, 2025
8edca62
action name in run-the-tests
d-w-moore Oct 1, 2025
580efda
save changes for test under github actions
d-w-moore Oct 1, 2025
1ad07be
whoami
d-w-moore Oct 1, 2025
b2d8a68
move chown
d-w-moore Oct 1, 2025
0b59cd6
chmod for world
d-w-moore Oct 1, 2025
74546ff
--timeout instead of --time
d-w-moore Oct 1, 2025
c32dc94
debug prints
d-w-moore Oct 1, 2025
7678844
run test000* as root
d-w-moore Oct 1, 2025
39b1cc1
debug output for iinit; limit matrix
d-w-moore Oct 1, 2025
8efb989
partition test000 from test001-9
d-w-moore Oct 2, 2025
79528de
add iRODS 4 back into matrix
d-w-moore Oct 2, 2025
2b56ff4
fill out matrix with low,high choices
d-w-moore Oct 2, 2025
916fdf8
do not use oneshot send/recv mechanism
d-w-moore Oct 2, 2025
88ae56b
iinit_as_rods earlier
d-w-moore Oct 2, 2025
57bf8d0
revert some debug changes; push to GitHub for retrial of run-bats-tests
d-w-moore Oct 3, 2025
070a7d9
need iinit output once more
d-w-moore Oct 3, 2025
a777217
move iinit-as-rods earlier and repeat til success or timeout
d-w-moore Oct 3, 2025
ff046bd
clean debug
d-w-moore Oct 3, 2025
98e1105
print VERSION variables before run in container
d-w-moore Oct 3, 2025
7ac93d0
correct failing tests
d-w-moore Oct 3, 2025
5cfcce8
run against iRODS 5.0.2
d-w-moore Oct 3, 2025
20465bb
ws and comments
d-w-moore Oct 5, 2025
e7c2294
pass args to test script from outside container
d-w-moore Oct 6, 2025
7a12819
add version checking script
d-w-moore Oct 6, 2025
36b0a5b
update runner.py's new options processing with argparse
d-w-moore Oct 6, 2025
cc603f0
argparse related corrrections in runner.py
d-w-moore Oct 7, 2025
d093706
delete redundant initializations
d-w-moore Oct 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/run-bats-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: run-bats-tests

on: [push, pull_request]

jobs:
tests:
timeout-minutes: 20

name: Python ${{ matrix.python }}, iRODS ${{ matrix.irods_server }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./irods/test/harness
strategy:
matrix:
python: ['3.9','3.13']
irods_server: ['4.3.4','5.0.2']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build images
run: ./create_docker_images.sh "${{ matrix.irods_server }}" "${{ matrix.python }}"

- name: run tests
run: |
for script in ../scripts/test00[1-9]*; do
Copy link
Collaborator Author

@d-w-moore d-w-moore Oct 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to test[1-9]*

./docker_container_driver.sh -V $script
done
28 changes: 28 additions & 0 deletions .github/workflows/run-local-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: run-local-suite

on: [push, pull_request]

jobs:
tests:
timeout-minutes: 20

name: Python ${{ matrix.python }}, iRODS ${{ matrix.irods_server }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./irods/test/harness
strategy:
matrix:
python: ['3.9','3.13']
irods_server: ['4.3.4','5.0.2']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build images
run: ./create_docker_images.sh "${{ matrix.irods_server }}" "${{ matrix.python }}"

- name: run tests
run: |
./docker_container_driver.sh -V ../scripts/run_suite_locally.sh
41 changes: 41 additions & 0 deletions .github/workflows/run-the-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: run-the-tests

on: [push, pull_request]

jobs:
tests:
timeout-minutes: 20

name: Python ${{ matrix.python }}, iRODS ${{ matrix.irods_server }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docker-testing
strategy:
matrix:
python: ['3.9','3.13']
irods_server: ['4.3.4','5.0.2']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: who am i
run: echo $(id -u) $(id -un)

- name: Start containers
run: ./start_containers.sh "${{ matrix.irods_server }}" "${{ matrix.python }}"

- name: run test
run: |
while :; do
client_container=$(docker ps --format "{{.Names}}"|grep python.client)
[ -n "$client_container" ] && break
sleep 1
done
echo "client_container = [$client_container]"
docker exec "${client_container}" /repo_root/docker-testing/run_tests.sh

- name: Stop containers
if: always()
run: ./stop_containers.sh "${{ matrix.irods_server }}" "${{ matrix.python }}"
1 change: 0 additions & 1 deletion Dockerfile.prc_test.centos
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ RUN python${py_N} repo/docker_build/iinit.py \
password rods
SHELL ["/bin/bash","-c"]
CMD echo "Waiting on iRODS server... " ; \
python${PY_N} repo/docker_build/recv_oneshot -h irods-provider -p 8888 -t 360 && \
sudo groupadd -o -g $(stat -c%g /irods_shared) irods && sudo usermod -aG irods user && \
newgrp irods < repo/run_python_tests.sh
1 change: 0 additions & 1 deletion Dockerfile.prc_test.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ SHELL ["/bin/bash","-c"]
# 3. run python tests as the new group

CMD echo "Waiting on iRODS server... " ; \
python${PY_N} repo/docker_build/recv_oneshot -h irods-provider -p 8888 -t 360 && \
sudo groupadd -o -g $(stat -c%g /irods_shared) irods && sudo usermod -aG irods user && \
newgrp irods < repo/run_python_tests.sh
42 changes: 42 additions & 0 deletions docker-testing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
The file `$REPO/.github/workflows/run-the-tests.yml`
(where `$REPO` is the /path/to/local/python-irodsclient repository)
contains commands for starting the server and client containers and running the PRC
suite in response to a push or pull-request.

The tests suite can also be run on any workstation with "docker compose" installed:

1. cd into top level of $REPO

2. run:
```
./docker-testing/start_containers.sh 3.6
```
This builds and runs the docker images. "3.6" is the version of python desired.

3. run:
```
docker exec <name-of-python-client-container> /repo_root/docker-testing/run_tests.sh
```
(Note: `/repo_root` is an actual literal path, internal to the container.)
You'll see the test output displayed on the console. At completion, xmlrunner outputs are in /tmp.

4. use `docker logs -f` with the provider instance name to tail the irods server log output

DEBUGGING
---------
We can also to run a specific test that we specify by name:

```
$ docker exec -it <name-of-python-client-container> /repo_root/docker_testing/run_tests.sh irods.test.<module>.<class>.<method>
```

Optionally we can also enter the PDB command-line debugger at a place of our choosing in the source code, by stopping on a breakpoint,
and then stepping through code.

The breakpoint can be placed by adding the line

```
import pdb;pdb.set_trace()
```

immediately before the source line in the test code at which we wish to enter the debugger.
13 changes: 13 additions & 0 deletions docker-testing/apt-list-all.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ARG linux_vsn="ubuntu:18.04"
FROM ${linux_vsn}
RUN apt update
RUN apt install -y lsb-release apt-transport-https
RUN apt install -y wget
RUN apt install -y gnupg2
RUN wget -qO - https://packages.irods.org/irods-signing-key.asc | apt-key add -
RUN echo "deb [arch=amd64] https://packages.irods.org/apt/ $(lsb_release -sc) main" |\
tee "/etc/apt/sources.list.d/renci-irods.list"
RUN apt update

ENTRYPOINT ["apt", "list", "-a"]

1 change: 1 addition & 0 deletions docker-testing/harness-docker-compose-irods-4.yml
1 change: 1 addition & 0 deletions docker-testing/harness-docker-compose-irods-5.yml
47 changes: 47 additions & 0 deletions docker-testing/harness-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: '3'

services:
irods-catalog:
build:
context: irods_catalog_${irods_major}
# 5432 is exposed by default and can conflict with other postgres containers.
# When the metalnx-db service is no longer needed, this stanza can be removed.
ports:
- "5430:5432"
environment:
- POSTGRES_PASSWORD=testpassword

python-client:
build:
context: python_client
args:
python_version: ${python_version}
command:
tail -f /dev/null
volumes:
- ${repo_external}:/repo_root:ro
- /tmp/irods-client-share.py-${python_version}:/irods_shared
depends_on:
irods-catalog-provider:
condition: service_healthy

irods-catalog-provider:
volumes:
- /tmp/irods-client-share.py-${python_version}:/irods_shared
build:
context: irods_catalog_provider_${irods_major}
args:
irods_version: ${irods_version}
shm_size: 500mb
healthcheck:
test: ["CMD", "su", "-", "irods", "-c", "ils || exit 1"]
interval: 10s
timeout: 10s
retries: 3
#start_period: 20s
#start_interval: 2s
ports:
- "1247:1247"
depends_on:
- irods-catalog

46 changes: 46 additions & 0 deletions docker-testing/iinit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env python

from getpass import getpass
from irods.password_obfuscation import encode
import json
import os
import sys
from os import chmod
from os.path import expanduser,exists,join
from getopt import getopt


home_env_path = expanduser('~/.irods')
env_file_path = join(home_env_path,'irods_environment.json')
auth_file_path = join(home_env_path,'.irodsA')


def do_iinit(host, port, user, zone, password):
if not exists(home_env_path):
os.makedirs(home_env_path)
else:
raise RuntimeError('~/.irods already exists')

with open(env_file_path,'w') as env_file:
json.dump ( { "irods_host": host,
"irods_port": int(port),
"irods_user_name": user,
"irods_zone_name": zone }, env_file, indent=4)
with open(auth_file_path,'w') as auth_file:
auth_file.write(encode(password))
chmod (auth_file_path,0o600)


def get_kv_pairs_from_cmdline(*args):
arglist = list(args)
while arglist:
k = arglist.pop(0)
v = arglist.pop(0)
yield k,v


if __name__ == '__main__':
import sys
args = sys.argv[1:]
dct = {k:v for k,v in get_kv_pairs_from_cmdline(*args)}
do_iinit(**dct)
3 changes: 3 additions & 0 deletions docker-testing/irods_catalog_4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM postgres:12

COPY init-user-db.sh /docker-entrypoint-initdb.d/init-user-db.sh
11 changes: 11 additions & 0 deletions docker-testing/irods_catalog_4/init-user-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Adapted from "Initialization script" in documentation for official Postgres dockerhub:
# https://hub.docker.com/_/postgres/
set -e

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE DATABASE "ICAT";
CREATE USER irods WITH PASSWORD 'testpassword';
GRANT ALL PRIVILEGES ON DATABASE "ICAT" to irods;
EOSQL
3 changes: 3 additions & 0 deletions docker-testing/irods_catalog_5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM postgres:16

COPY init-user-db.sh /docker-entrypoint-initdb.d/init-user-db.sh
12 changes: 12 additions & 0 deletions docker-testing/irods_catalog_5/init-user-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Adapted from "Initialization script" in documentation for official Postgres dockerhub:
# https://hub.docker.com/_/postgres/
set -e

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE DATABASE "ICAT";
CREATE USER irods WITH PASSWORD 'testpassword';
GRANT ALL PRIVILEGES ON DATABASE "ICAT" to irods;
ALTER DATABASE "ICAT" OWNER TO irods
EOSQL
60 changes: 60 additions & 0 deletions docker-testing/irods_catalog_provider_4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y \
apt-transport-https \
gnupg \
wget \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/*

RUN wget -qO - https://packages.irods.org/irods-signing-key.asc | apt-key add - && \
echo "deb [arch=amd64] https://packages.irods.org/apt/ focal main" | tee /etc/apt/sources.list.d/renci-irods.list

RUN apt-get update && \
apt-get install -y \
libcurl4-gnutls-dev \
jq \
python3 \
python3-distro \
python3-jsonschema \
python3-pip \
python3-psutil \
python3-requests \
rsyslog \
unixodbc \
gawk \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/*

ARG irods_version=4.3.1
ARG irods_package_version_suffix=-0~focal
ARG irods_package_version=${irods_version}${irods_package_version_suffix}
ARG irods_resource_plugin_version=${irods_version}.0${irods_package_version_suffix}

## TODO : examine. the below command also installed:
#irods-resource-plugin-s3=${irods_resource_plugin_version}

RUN apt-get update && \
apt-get install -y \
irods-database-plugin-postgres=${irods_package_version} \
irods-runtime=${irods_package_version} \
irods-server=${irods_package_version} \
irods-icommands=${irods_package_version} \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/*

COPY setup-${irods_version}.input /
RUN mv /setup-${irods_version}.input /irods_setup.input

WORKDIR /
COPY entrypoint.sh .
COPY send_oneshot .
RUN chmod u+x ./entrypoint.sh
RUN chmod u+x ./send_oneshot
ENTRYPOINT ["./entrypoint.sh"]
Loading
Loading