From 2b5d35ffc52fe58044cfc0903d0d169b90b482bb Mon Sep 17 00:00:00 2001 From: pauldg Date: Mon, 20 Jan 2025 12:59:46 +0100 Subject: [PATCH] added unit test --- .../objectstore/templates/examples/irods.yml | 49 +++++++++---------- lib/galaxy/objectstore/templates/models.py | 2 +- test/unit/objectstore/test_template_models.py | 1 + 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/lib/galaxy/objectstore/templates/examples/irods.yml b/lib/galaxy/objectstore/templates/examples/irods.yml index 959adf177af..fe02b68f5d8 100644 --- a/lib/galaxy/objectstore/templates/examples/irods.yml +++ b/lib/galaxy/objectstore/templates/examples/irods.yml @@ -12,9 +12,9 @@ help: Host url to connect to. port: label: iRODS host port - type: integer + type: string help: Host port to connect to. - default: 1247 + default: "1247" username: label: Username type: string @@ -35,7 +35,7 @@ help: Connection timeout in seconds. default: 30 refresh_time: - label: iRODS host + label: Refresh time type: integer help: Connection refresh time in seconds. default: 300 @@ -105,12 +105,12 @@ default: "hostname" ssl_ca_certificate_file: label: Username - type: string + type: variable help: | Location of a file of trusted CA certificates in PEM format. Note that the certificates in this file are used in conjunction with the system default trusted certificates - default: "/etc/irods/ssl/irods.crt" + default: "" secrets: password: label: Password @@ -119,30 +119,27 @@ configuration: type: irods auth: - username: "{{ variables.username }}" - password: "{{ secrets.password }}" + username: '{{ variables.username }}' + password: '{{ secrets.password }}' resource: - name: "{{ environment.resource }}" + name: '{{ environment.resource }}' zone: - name: "{{ environment.zone }}" + name: '{{ environment.zone }}' connection: - host: "{{ variables.host }}" - port: "{{ variables.port }}" - timeout: "{{ environment.timeout }}" - refresh_time: "{{ environment.refresh_time }}" - connection_pool_monitor_interval: "{{ environment.connection_pool_monitor_interval }}" - # ssl section is optional + host: '{{ variables.host }}' + port: '{{ variables.port }}' + timeout: '{{ environment.timeout }}' + refresh_time: '{{ environment.refresh_time }}' + connection_pool_monitor_interval: '{{ environment.connection_pool_monitor_interval }}' ssl: - client_server_negotiation: "{{ ssl.client_server_negotiation }}" - client_server_policy: "{{ ssl.client_server_policy }}" - encryption_algorithm: "{{ ssl.encryption_algorithm }}" - encryption_key_size: "{{ ssl.encryption_key_size }}" - encryption_num_hash_rounds: "{{ ssl.encryption_num_hash_rounds }}" - encryption_salt_size: "{{ ssl.encryption_salt_size }}" - ssl_verify_server: "{{ ssl.ssl_verify_server }}" - ssl_ca_certificate_file: "{{ ssl.ssl_ca_certificate_file }}" - # The logical section is optional and is meant for defining the remote path - # if not defined the default path is: /zone_name/home/username + client_server_negotiation: '{{ ssl.client_server_negotiation }}' + client_server_policy: '{{ ssl.client_server_policy }}' + encryption_algorithm: '{{ ssl.encryption_algorithm }}' + encryption_key_size: '{{ ssl.encryption_key_size }}' + encryption_num_hash_rounds: '{{ ssl.encryption_num_hash_rounds }}' + encryption_salt_size: '{{ ssl.encryption_salt_size }}' + ssl_verify_server: '{{ ssl.ssl_verify_server }}' + ssl_ca_certificate_file: '{{ ssl.ssl_ca_certificate_file }}' logical: - path: "{{ variables.logical_path }}" + path: '{{ variables.logical_path }}' diff --git a/lib/galaxy/objectstore/templates/models.py b/lib/galaxy/objectstore/templates/models.py index 1f9e13093ed..f347ddebc3e 100644 --- a/lib/galaxy/objectstore/templates/models.py +++ b/lib/galaxy/objectstore/templates/models.py @@ -400,7 +400,7 @@ class IrodsResource(StrictModel): class IrodsZoneTemplate(StrictModel): - zone: str + zone: Union[str, TemplateExpansion] class IrodsZone(StrictModel): diff --git a/test/unit/objectstore/test_template_models.py b/test/unit/objectstore/test_template_models.py index 9513a6e807d..f09dbd372dc 100644 --- a/test/unit/objectstore/test_template_models.py +++ b/test/unit/objectstore/test_template_models.py @@ -334,6 +334,7 @@ def test_examples_parse(): assert_example_parses("minio_just_buckets_legacy.yml") assert_example_parses("azure_just_container.yml") assert_example_parses("production_gcp_s3.yml") + assert_example_parses("irods.yml") def assert_example_parses(filename: str):