From 4db9d5bcec665914c25019caeb3bad1f6b721417 Mon Sep 17 00:00:00 2001 From: nterranova <nicholas.terranova@cnaf.infn.it> Date: Tue, 6 Mar 2018 18:28:47 +0100 Subject: [PATCH] README.md, empty_voms_proxy.t and expired_ac_proxy.t fixed --- README.md | 4 ++++ t/README.md | 22 +++++++++++----------- t/empty_voms_proxy.t | 7 ++++--- t/expired_ac_proxy.t | 7 ++++--- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index ec7990d..16e58bd 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,7 @@ A comma-separated list of _Fully Qualified Attribute Names_ ### voms_user + +## Testing + +Setup and files to test the *ngx\_http\_voms\_module* are contained in the `t` folder. diff --git a/t/README.md b/t/README.md index a223aab..ee257f6 100644 --- a/t/README.md +++ b/t/README.md @@ -2,33 +2,33 @@ ## Description -Setup and files to test the *ngx\_http\_voms\_module* are contained in the **t** folder. The [Openresty data-driven testsuite](https://openresty.gitbooks.io/programming-openresty/content/testing/) has been adopted for testing. +Setup and files to test the *ngx\_http\_voms\_module* are contained in the `t` folder. The [Openresty data-driven testsuite](https://openresty.gitbooks.io/programming-openresty/content/testing/) has been adopted for testing. ### Test fixture setup -Proxy certificates are in the **certs** folder: +Proxy certificates are in the `certs` folder: - * 0.pem: long-lived proxy, no AC; - * 1.pem: long-lived proxy, expired AC; + * 0.pem: long-lived proxy certificate, without Attribute Certificate (AC); + * 1.pem: long-lived proxy certificate, with an expired AC; * 2.pem: expired proxy certificate. Proxy certificates are generated using [VOMS client 3.3.0](http://italiangrid.github.io/voms/documentation/voms-clients-guide/3.0.3/). -The following options are used: +The following command is used: VOMS_CLIENTS_JAVA_OPTIONS="-Dvoms.fake.vo=test.vo -Dvoms.fake=true -Dvoms.fake.aaCert=<path_to_cert>/voms_example.cert.pem -Dvoms.fake.aaKey=<path_to_key>/voms_example.key.pem" voms-proxy-init3 -voms test.vo -cert <path_to_test0>/test0.p12 --valid <validity> -*voms\_example.cert.pem* and *voms\_example.ket.pem* can be found in the **certs** folder. +*voms\_example.cert.pem* and *voms\_example.ket.pem* can be found in the `certs` folder. -To perform correctly the VOMS AC validation, a \*.lsc or \*.pem file is needed in **/etc/grid-security/vomsdir**, see [VOMS client 3.3.0 User Guide](http://italiangrid.github.io/voms/documentation/voms-clients-guide/3.0.3/) for further details. An example of *voms.example.lsc* can be found in **vomsdir/test.vo**. +To perform correctly the VOMS AC validation, a \*.lsc or \*.pem file is needed in `/etc/grid-security/vomsdir`, see [VOMS client 3.3.0 User Guide](http://italiangrid.github.io/voms/documentation/voms-clients-guide/3.0.3/) for further details. An example of *voms.example.lsc* can be found in `vomsdir/test.vo`. -Trust-anchors (igi-test-ca.pem) are contained in the **trust-anchors** folder. Nginx server certificate and key (nginx\_voms\_example.cert.pem and nginx\_voms\_example\_key.pem) are in the **certs** folder. +Trust-anchors (igi-test-ca.pem) are contained in the `trust-anchors` folder. Nginx server certificate and key (nginx\_voms\_example.cert.pem and nginx\_voms\_example\_key.pem) are in the `certs` folder. ### Running Tests -To run the tests made available in the **t** folder just type +To run the tests made available in the `t` folder just type - prove -v t + prove -v Using the docker image provided to exploit Openresty in the Storm2 project: @@ -39,4 +39,4 @@ Using the docker image provided to exploit Openresty in the Storm2 project: make && make install cd .. sudo chown build.build -R t - prove -v t + prove -v diff --git a/t/empty_voms_proxy.t b/t/empty_voms_proxy.t index 84eb5c9..c08fd21 100644 --- a/t/empty_voms_proxy.t +++ b/t/empty_voms_proxy.t @@ -5,7 +5,7 @@ run_tests(); __DATA__ -=== TEST 1: https with x509 client authentication, valid proxy certificate no voms attributes +=== TEST 1: https with x509 client authentication, valid proxy certificate with no VOMS attributes --- main_config env OPENSSL_ALLOW_PROXY_CERTS=1; env X509_VOMS_DIR=t/vomsdir; @@ -20,7 +20,8 @@ __DATA__ ssl_verify_client on; location = / { default_type text/plain; - echo $voms_fqans $voms_user; + echo $voms_fqans; + echo $voms_user; } } --- config @@ -32,7 +33,7 @@ __DATA__ --- request GET / --- response_body_like eval -qr/\n/ +qr/\n\n/ --- error_log VOMS extension not found --- error_code: 200 diff --git a/t/expired_ac_proxy.t b/t/expired_ac_proxy.t index 88bb867..cad7d17 100644 --- a/t/expired_ac_proxy.t +++ b/t/expired_ac_proxy.t @@ -5,7 +5,7 @@ run_tests(); __DATA__ -=== TEST 1: https with x509 client authentication, valid proxy certificate expired voms attributes +=== TEST 1: https with x509 client authentication, valid proxy certificate with expired VOMS attributes --- main_config env OPENSSL_ALLOW_PROXY_CERTS=1; env X509_VOMS_DIR=t/vomsdir; @@ -20,7 +20,8 @@ __DATA__ ssl_verify_client on; location = / { default_type text/plain; - echo $voms_fqans $voms_user; + echo $voms_fqans; + echo $voms_user; } } --- config @@ -32,7 +33,7 @@ __DATA__ --- request GET / --- response_body_like eval -qr/\n/ +qr/\n\n/ --- error_log AC not valid anymore --- error_code: 200 -- GitLab