From d447c7c6c48f97ff45cc4a467fa1233bd4406b55 Mon Sep 17 00:00:00 2001 From: Maciej Szlosarczyk Date: Fri, 12 Jul 2019 16:07:30 +0300 Subject: [PATCH] Include information about changes in documentation Describe Roda app that is used for testing. Describe new feature for handling certificate file path --- .travis.yml | 2 +- README.md | 26 ++++++++++++++++--- .../epp_proxy/priv/test_backend_app/config.ru | 4 +-- .../{backend_server.rb => epp_server.rb} | 2 +- 4 files changed, 26 insertions(+), 8 deletions(-) rename apps/epp_proxy/priv/test_backend_app/{backend_server.rb => epp_server.rb} (95%) diff --git a/.travis.yml b/.travis.yml index d2d8a3a..494dbc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ install: - "/bin/bash -l -c \"cd apps/epp_proxy/priv/test_backend_app && bundle install\"" script: - - "/bin/bash -l -c \"cd apps/epp_proxy/priv/test_backend_app && bundle exec rackup -D\"" + - "/bin/bash -l -c \"cd apps/epp_proxy/priv/test_backend_app && bundle exec rackup --pid pidfile -D\"" - "rebar3 as test compile" - "DEBUG=1 rebar3 ct --sys_config config/test.config --readable=false --cover --verbose=true" - "rebar3 cover --verbose" diff --git a/README.md b/README.md index bb2f9e1..8bdec0c 100644 --- a/README.md +++ b/README.md @@ -82,10 +82,10 @@ of Erlang property list. | `epp_session_url` | `https://example.com/epp/session` | EppSessionRoot | HTTP address of the session endpoints including schema and port. | `epp_command_url` | `https://example.com/epp/command` | EppCommandRoot | HTTP address of the command endpoints including schema and port. | `epp_error_url` | `https://example.com/epp/error` | EppErrorRoot | HTTP address of the error endpoints including schema and port. -| `cacertfile_path` | `/opt/ca/ca.crt.pem` | SSLCACertificateFile | Where is the client root CA located. -| `certfile_path` | `/opt/ca/server.crt.pem` | SSLCertificateFile | Where is the server certificate located. -| `keyfile_path` | `/opt/ca/server.key.pem` | SSLCertificateKeyFile | Where is the server key located. -| `crlfile_path` | `/opt/ca/crl.pem` | SSLCARevocationFile | Where is the CRL file located. +| `cacertfile_path` | `/opt/ca/ca.crt.pem` | SSLCACertificateFile | Where is the client root CA located. Can be inside apps/epp_proxy/priv or absolute path. +| `certfile_path` | `/opt/ca/server.crt.pem` | SSLCertificateFile | Where is the server certificate located. Can be inside apps/epp_proxy/priv or absolute path. +| `keyfile_path` | `/opt/ca/server.key.pem` | SSLCertificateKeyFile | Where is the server key located. Can be inside apps/epp_proxy/priv or absolute path. +| `crlfile_path` | `/opt/ca/crl.pem` | SSLCARevocationFile | Where is the CRL file located. Can be inside apps/epp_proxy/priv or absolute path. Migrating from mod_epp @@ -100,6 +100,24 @@ Checklist of steps to perform if you want to migrate from mod_epp, but still use 5. If you do not feel comfortable using Erlang configuration file, you can use command line arguments and flags in format of `/epp_proxy/rel/bin/epp_proxy -epp_proxy tls_port 444`, where `-epp_proxy` is name of application, followed by configuration parameter name and value. +Testing +---- +The application comes with test suite written with common_test. For integration +tests, there is a small Roda application located in apps/epp_proxy/priv/test_backend_app. +It has been written with Ruby 2.6.3 + +You need to start it before running the test suite. To start it as a deamon, +from the root folder of the project, execute: + +```bash +$ /bin/bash -l -c "cd apps/epp_proxy/priv/test_backend_app && bundle install" +$ /bin/bash -l -c "cd apps/epp_proxy/priv/test_backend_app && bundle exec rackup --pid pidfile -D" +``` + +After you finish testing, you can stop the process by reading the stored pid: + + $ kill `cat apps/epp_proxy/priv/test_backend_app/pidfile` + TODO ---- diff --git a/apps/epp_proxy/priv/test_backend_app/config.ru b/apps/epp_proxy/priv/test_backend_app/config.ru index 313f480..7de4012 100644 --- a/apps/epp_proxy/priv/test_backend_app/config.ru +++ b/apps/epp_proxy/priv/test_backend_app/config.ru @@ -2,7 +2,7 @@ require "rack/unreloader" -Unreloader = Rack::Unreloader.new() { BackendServer } -Unreloader.require("backend_server.rb") { "BackendServer" } +Unreloader = Rack::Unreloader.new() { EppServer } +Unreloader.require("epp_server.rb") { "EppServer" } run(Unreloader) diff --git a/apps/epp_proxy/priv/test_backend_app/backend_server.rb b/apps/epp_proxy/priv/test_backend_app/epp_server.rb similarity index 95% rename from apps/epp_proxy/priv/test_backend_app/backend_server.rb rename to apps/epp_proxy/priv/test_backend_app/epp_server.rb index e866816..d1b6e4a 100644 --- a/apps/epp_proxy/priv/test_backend_app/backend_server.rb +++ b/apps/epp_proxy/priv/test_backend_app/epp_server.rb @@ -1,6 +1,6 @@ require 'roda' -class BackendServer < Roda +class EppServer < Roda plugin :render route do |r|