From 9d9667457644c5a6cfbaaf15e9208b5d92decb9b Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 4 Sep 2019 00:10:22 +0300 Subject: [PATCH 1/3] Remove outdated doc --- doc/testing.md | 120 ------------------------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 doc/testing.md diff --git a/doc/testing.md b/doc/testing.md deleted file mode 100644 index 81f208edd..000000000 --- a/doc/testing.md +++ /dev/null @@ -1,120 +0,0 @@ -Testing -------- - -Setup test databases: - - RAILS_ENV=test rake db:setup:all - -Run basic test (no EPP tests): - - rake - - -Testing EPP -=========== - -In order to test EPP, you have to configure apache to handle EPP request correctly. - -### Apache site config - -First you should have mod_epp installed, please follow main README for doing it. - -Apache site config for autotest, add file to /etc/apache2/sites-enabled/epp-autotest.conf - -```apache - - Listen 701 - - SSLEngine on - SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL - SSLCertificateFile /etc/apache2/ssl/apache.crt - SSLCertificateKeyFile /etc/apache2/ssl/apache.key - - SSLVerifyClient optional_no_ca - - EPPEngine On - EPPCommandRoot /proxy/command - EPPSessionRoot /proxy/session - EPPErrorRoot /proxy/error - EPPRawFrame raw_frame - - ProxyPass /proxy/ http://localhost:8989/epp/ - - EPPAuthURI implicit - EPPReturncodeHeader X-EPP-Returncode - - -``` - - - -* Run all tests with temp server running automatically on port 8989: - - rake test - - -Manual debugging -================ - -### Apache mod_epp manual debugging - -Debugging Apache mod_epp without Registry app. - - sudo apt-get install apache2-dbg - -Includes htpasswd command to generate authentication files - - sudo apt-get install apache2-utils - -For manual debugging purposes, standalone CGI scripts can be used: -This needs a static greeting file, so you will have to make /var/www writable. - -```apache - - - Options ExecCGI - SetHandler cgi-script - - - Listen 1700 - - - EPPEngine On - EPPCommandRoot /cgi-bin/epp/command - EPPSessionRoot /cgi-bin/epp/session - EPPErrorRoot /cgi-bin/epp/error - - Alias /cgi-bin/epp/session/hello /var/www/html/epp/session-hello - - Alias /cgi-bin/epp/session/login /usr/lib/cgi-bin/epp/session-login - Alias /cgi-bin/epp/session/logout /usr/lib/cgi-bin/epp/session-logout - Alias /cgi-bin/epp/error/schema /usr/lib/cgi-bin/epp/error-schema - Alias /cgi-bin/epp/command/create /usr/lib/cgi-bin/epp/create - Alias /cgi-bin/epp/command/info /usr/lib/cgi-bin/epp/info - - EPPAuthURI /epp/auth/login - - AuthType Basic - AuthName "EPP" - AuthUserFile /etc/apache2/htpasswd - require valid-user - - - -``` - - sudo a2enmod cgi - sudo a2enmod authn_file # will be used for non implicit authentication URIs - sudo htpasswd -c /etc/apache2/htpasswd test - Type "test" when prompted - cd /usr/lib/cgi-bin - mkdir epp - -Copy the files from $mod_epp/examples/cgis to /usr/lib/cgi-bin/epp - - -Allowed testing email list -========================== - -All allowed testing emails are located under config/initialized/settings.rb file. - From ccdbadd9382bdae34e0515734e36a0ebbb995324 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 18 Sep 2020 12:24:09 +0500 Subject: [PATCH 2/3] Revert "Remove outdated doc" This reverts commit e728fac7d0b7be2158e25b11adf0b197c9b850dc. --- doc/testing.md | 120 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 doc/testing.md diff --git a/doc/testing.md b/doc/testing.md new file mode 100644 index 000000000..81f208edd --- /dev/null +++ b/doc/testing.md @@ -0,0 +1,120 @@ +Testing +------- + +Setup test databases: + + RAILS_ENV=test rake db:setup:all + +Run basic test (no EPP tests): + + rake + + +Testing EPP +=========== + +In order to test EPP, you have to configure apache to handle EPP request correctly. + +### Apache site config + +First you should have mod_epp installed, please follow main README for doing it. + +Apache site config for autotest, add file to /etc/apache2/sites-enabled/epp-autotest.conf + +```apache + + Listen 701 + + SSLEngine on + SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL + SSLCertificateFile /etc/apache2/ssl/apache.crt + SSLCertificateKeyFile /etc/apache2/ssl/apache.key + + SSLVerifyClient optional_no_ca + + EPPEngine On + EPPCommandRoot /proxy/command + EPPSessionRoot /proxy/session + EPPErrorRoot /proxy/error + EPPRawFrame raw_frame + + ProxyPass /proxy/ http://localhost:8989/epp/ + + EPPAuthURI implicit + EPPReturncodeHeader X-EPP-Returncode + + +``` + + + +* Run all tests with temp server running automatically on port 8989: + + rake test + + +Manual debugging +================ + +### Apache mod_epp manual debugging + +Debugging Apache mod_epp without Registry app. + + sudo apt-get install apache2-dbg + +Includes htpasswd command to generate authentication files + + sudo apt-get install apache2-utils + +For manual debugging purposes, standalone CGI scripts can be used: +This needs a static greeting file, so you will have to make /var/www writable. + +```apache + + + Options ExecCGI + SetHandler cgi-script + + + Listen 1700 + + + EPPEngine On + EPPCommandRoot /cgi-bin/epp/command + EPPSessionRoot /cgi-bin/epp/session + EPPErrorRoot /cgi-bin/epp/error + + Alias /cgi-bin/epp/session/hello /var/www/html/epp/session-hello + + Alias /cgi-bin/epp/session/login /usr/lib/cgi-bin/epp/session-login + Alias /cgi-bin/epp/session/logout /usr/lib/cgi-bin/epp/session-logout + Alias /cgi-bin/epp/error/schema /usr/lib/cgi-bin/epp/error-schema + Alias /cgi-bin/epp/command/create /usr/lib/cgi-bin/epp/create + Alias /cgi-bin/epp/command/info /usr/lib/cgi-bin/epp/info + + EPPAuthURI /epp/auth/login + + AuthType Basic + AuthName "EPP" + AuthUserFile /etc/apache2/htpasswd + require valid-user + + + +``` + + sudo a2enmod cgi + sudo a2enmod authn_file # will be used for non implicit authentication URIs + sudo htpasswd -c /etc/apache2/htpasswd test + Type "test" when prompted + cd /usr/lib/cgi-bin + mkdir epp + +Copy the files from $mod_epp/examples/cgis to /usr/lib/cgi-bin/epp + + +Allowed testing email list +========================== + +All allowed testing emails are located under config/initialized/settings.rb file. + From 9e18de564cf578a103702778574a2e775f7f8115 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 18 Sep 2020 12:33:00 +0500 Subject: [PATCH 3/3] Update testing.md to reflect current test approach --- doc/testing.md | 107 ++++--------------------------------------------- 1 file changed, 8 insertions(+), 99 deletions(-) diff --git a/doc/testing.md b/doc/testing.md index 81f208edd..efa534887 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -1,4 +1,4 @@ -Testing +Testing local project without docker container ------- Setup test databases: @@ -10,108 +10,17 @@ Run basic test (no EPP tests): rake -Testing EPP -=========== +Testing using docker container +------- -In order to test EPP, you have to configure apache to handle EPP request correctly. +It's strongly recommended to test/debug registry application using docker containers from https://github.com/internetee/docker-images . +For doing so first setup containers as per docker images documentation (https://github.com/internetee/docker-images/blob/master/README.MD), then in docker images directory run the following: -### Apache site config + docker-compose run registry bundle exec rake RAILS_ENV=test COVERAGE=true -First you should have mod_epp installed, please follow main README for doing it. - -Apache site config for autotest, add file to /etc/apache2/sites-enabled/epp-autotest.conf - -```apache - - Listen 701 - - SSLEngine on - SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL - SSLCertificateFile /etc/apache2/ssl/apache.crt - SSLCertificateKeyFile /etc/apache2/ssl/apache.key - - SSLVerifyClient optional_no_ca - - EPPEngine On - EPPCommandRoot /proxy/command - EPPSessionRoot /proxy/session - EPPErrorRoot /proxy/error - EPPRawFrame raw_frame - - ProxyPass /proxy/ http://localhost:8989/epp/ - - EPPAuthURI implicit - EPPReturncodeHeader X-EPP-Returncode - - -``` - - - -* Run all tests with temp server running automatically on port 8989: - - rake test - - -Manual debugging -================ - -### Apache mod_epp manual debugging - -Debugging Apache mod_epp without Registry app. - - sudo apt-get install apache2-dbg - -Includes htpasswd command to generate authentication files - - sudo apt-get install apache2-utils - -For manual debugging purposes, standalone CGI scripts can be used: -This needs a static greeting file, so you will have to make /var/www writable. - -```apache - - - Options ExecCGI - SetHandler cgi-script - - - Listen 1700 - - - EPPEngine On - EPPCommandRoot /cgi-bin/epp/command - EPPSessionRoot /cgi-bin/epp/session - EPPErrorRoot /cgi-bin/epp/error - - Alias /cgi-bin/epp/session/hello /var/www/html/epp/session-hello - - Alias /cgi-bin/epp/session/login /usr/lib/cgi-bin/epp/session-login - Alias /cgi-bin/epp/session/logout /usr/lib/cgi-bin/epp/session-logout - Alias /cgi-bin/epp/error/schema /usr/lib/cgi-bin/epp/error-schema - Alias /cgi-bin/epp/command/create /usr/lib/cgi-bin/epp/create - Alias /cgi-bin/epp/command/info /usr/lib/cgi-bin/epp/info - - EPPAuthURI /epp/auth/login - - AuthType Basic - AuthName "EPP" - AuthUserFile /etc/apache2/htpasswd - require valid-user - - - -``` - - sudo a2enmod cgi - sudo a2enmod authn_file # will be used for non implicit authentication URIs - sudo htpasswd -c /etc/apache2/htpasswd test - Type "test" when prompted - cd /usr/lib/cgi-bin - mkdir epp - -Copy the files from $mod_epp/examples/cgis to /usr/lib/cgi-bin/epp +To run single test: + docker-compose run registry bundle exec rails test RAILS_ENV=test COVERAGE=true Allowed testing email list ==========================