From 9e35f149ef2278ec2be06ea750912896142ba834 Mon Sep 17 00:00:00 2001 From: pauldg Date: Thu, 17 Oct 2024 13:58:09 +0200 Subject: [PATCH] added tests for new sections --- .../irods_object_store_conf_logical_path.xml | 11 +++++++ .../irods_object_store_conf_ssl.xml | 13 ++++++++ test/unit/objectstore/test_irods.py | 31 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 test/unit/objectstore/irods_object_store_conf_logical_path.xml create mode 100644 test/unit/objectstore/irods_object_store_conf_ssl.xml diff --git a/test/unit/objectstore/irods_object_store_conf_logical_path.xml b/test/unit/objectstore/irods_object_store_conf_logical_path.xml new file mode 100644 index 000000000000..09298ebdcb4b --- /dev/null +++ b/test/unit/objectstore/irods_object_store_conf_logical_path.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/test/unit/objectstore/irods_object_store_conf_ssl.xml b/test/unit/objectstore/irods_object_store_conf_ssl.xml new file mode 100644 index 000000000000..d59a55fd73b1 --- /dev/null +++ b/test/unit/objectstore/irods_object_store_conf_ssl.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/test/unit/objectstore/test_irods.py b/test/unit/objectstore/test_irods.py index ad6f0e689fb2..3b1471bd57bc 100644 --- a/test/unit/objectstore/test_irods.py +++ b/test/unit/objectstore/test_irods.py @@ -16,6 +16,12 @@ CONFIG_FILE_NAME_NO_AUTH = "irods_object_store_conf_no_auth.xml" CONFIG_FILE_NO_AUTH = os.path.join(SCRIPT_DIRECTORY, CONFIG_FILE_NAME_NO_AUTH) +CONFIG_FILE_NAME_SSL = "irods_object_store_conf_ssl.xml" +CONFIG_FILE_SSL = os.path.join(SCRIPT_DIRECTORY, CONFIG_FILE_NAME_SSL) + +CONFIG_FILE_NAME_LOGICAL_PATH = "irods_object_store_conf_logical_path.xml" +CONFIG_FILE_LOGICAL_PATH = os.path.join(SCRIPT_DIRECTORY, CONFIG_FILE_NAME_LOGICAL_PATH) + def test_parse_valid_config_xml(): tree = parse_xml(CONFIG_FILE) @@ -39,6 +45,31 @@ def test_parse_valid_config_xml(): assert config["extra_dirs"][1]["path"] == "database/tmp_irods" +def test_parse_config_xml_ssl(): + tree = parse_xml(CONFIG_FILE_SSL) + root = tree.getroot() + config = parse_config_xml(root) + + print(config) + + assert config["ssl"]["client_server_negotiation"] == "request_server_negotiation" + assert config["ssl"]["client_server_policy"] == "CS_NEG_REQUIRE" + assert config["ssl"]["encryption_algorithm"] == "AES-256-CBC" + assert config["ssl"]["encryption_key_size"] == 32 + assert config["ssl"]["encryption_num_hash_rounds"] == 16 + assert config["ssl"]["encryption_salt_size"] == 8 + assert config["ssl"]["ssl_verify_server"] == "cert" + assert config["ssl"]["ssl_ca_certificate_file"] == "/etc/irods/ssl/irods.crt" + + +def test_parse_config_xml_logical_path(): + tree = parse_xml(CONFIG_FILE_LOGICAL_PATH) + root = tree.getroot() + config = parse_config_xml(root) + + assert config["logical"]["path"] == "/tempZone/home/rods" + + def test_parse_config_xml_no_extra_dir(): tree = parse_xml(CONFIG_FILE_NO_EXTRA_DIR) root = tree.getroot()