%-*-Mode:erlang;coding:utf-8;tab-width:4;c-basic-offset:4;indent-tabs-mode:()-*-
% ex: set ft=erlang fenc=utf-8 sts=4 ts=4 sw=4 et nomod:
{acl, [
    % Access Control Lists (ACLs) define service name prefixes that can be
    % referenced instead of the literal service name prefixes for the
    % destination allow list and/or the destination deny list.  The ACLs may
    % reference other ACLs (cyclic references and missing references
    % in this list generate errors).  ACLs can be provided as service name
    % patterns to match before a send operation and non-patterns are made
    % into service name patterns by appending a '*' character.
    {all, [database, tests]},
    {database, ["/db/*"]},
    {tests, ["/tests/*"]},
    {api, ["/cloudi/api/*"]}
]}.
{services, [
    % an internal service is a native Erlang service,
    % using the cloudi_service behavior

    % this particular service handles the CloudI Service API which provides
    % dynamic configuration of CloudI
    {internal,
        % prefix specified for all subscriptions
        "/cloudi/api/",
        % module name of a module in a reachable path
        cloudi_service_api_requests,
        % module arguments are supplied as a list for the
        % cloudi_service_init/2 function
        [],
        % destination refresh controls how quickly service membership propogates
        % Any process that sends to long-lived processes can use
        % a 'lazy' prefix destination refresh (otherwise, if sending to
        % short-lived provesses, use an 'immediate' prefix destination refresh).
        % The 'lazy' prefix makes the service cache service name lookup data
        % while the 'immediate' prefix uses a central local process to do 
        % service name lookups.
        % A 'closest' suffix destination refresh always prefers local
        % processes rather than using remote processes
        % (processes on other nodes).
        % A 'furthest' suffix destination refresh always prefers remote
        % processes rather than using local processes.
        % A 'random' suffix load balances across all connected nodes.
        % A 'local' suffix will only send to local processes, which will
        % cause less request latency.
        % A 'remote' suffix will always send to remote processes, which can
        % provide more fault-tolerance guarantees.
        % If the process doesn't send to any other processes, then 'none' can
        % be used and the process will die if it attempts to send to another
        % process (it is as if the destination deny list contains all services).
        % (so the choices are:
        %  'lazy_closest', 'immediate_closest',
        %  'lazy_furthest', 'immediate_furthest',
        %  'lazy_random', 'immediate_random',
        %  'lazy_local', 'immediate_local',
        %  'lazy_remote', 'immediate_remote',
        %  'lazy_newest', 'immediate_newest',
        %  'lazy_oldest', 'immediate_oldest',
        %  'none')
        none,
        % timeout for executing the cloudi_service_init/2 function
        5000,
        % default timeout for asynchronous calls
        5000,
        % default timeout for synchronous calls
        5000,
        % destination deny list is used as an ACL (Access Control List) that
        % prevents the process from sending to destinations with the specified
        % prefixes.  if atoms are used within the list, they must exist as an
        % associative entry in the acl configuration list.
        % if the destination deny list is 'undefined' any destination is valid.
        % a blocked request will just return a timeout
        % (earlier than the timeout specified for the request).
        undefined,
        % destination allow list is used as an ACL (Access Control List) that
        % allows the process to send to destinations with the specified
        % prefixes.  if atoms are used within the list, they must exist as an
        % associative entry in the acl configuration list.
        % if the destination allow list is 'undefined' any destination is valid.
        % a blocked request will just return a timeout
        % (earlier than the timeout specified for the request).
        undefined,
        % specify how many processes should be created with this configuration
        1,
        % If more than MaxR restarts occur within MaxT seconds,
        % CloudI terminates the process
        % MaxR (maximum restarts)
        5,
        % MaxT (maximum time)
        300, % seconds
        % options, e.g.:
        % {queue_limit, 1024} % to limit the service's queue to a maximum
        %                     % of 1024 requests (to prevent excessive memory
        %                     % consumption while the service is busy,
        %                     % handling a previous request)
        % (see config_service_options in
        %  lib/cloudi_core/src/cloudi_configuration.hrl)
        []},
    {internal,
        "/cloudi/api/",
        cloudi_service_api_batch,
        [{queues,
          [{"start",
            [[{module, cloudi_service_send},
              {args,
               [{sends,
                 [{"/tests/echo/post", <<"0">>}]},
                {debug, true}]},
              {max_r, 0}]]}]}],
        none, 5000, 5000, 5000, undefined, undefined, 1, 5, 300,
        []},

    % an external service is an OS process connected
    % with a socket to the loopback device for each thread
    % the service below processes the Hexidecimal digits of PI (as a test)
    {external,
        % prefix specified for all subscriptions
        "/tests/",
        % executable file path
        "@cloudi_prefix@/tests/hexpi/hexpi_cxx",
        % command line arguments for the executable
        "",
        % {Key, Value} pairs to specify environment variables
        [{"LD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"},
         {"DYLD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"}],
        % destination refresh controls how quickly service membership propogates
        % Any process that sends to long-lived processes can use
        % a 'lazy' prefix destination refresh (otherwise, if sending to
        % short-lived provesses, use an 'immediate' prefix destination refresh).
        % The 'lazy' prefix makes the service cache service name lookup data
        % while the 'immediate' prefix uses a central local process to do 
        % service name lookups.
        % A 'closest' suffix destination refresh always prefers local
        % processes rather than using remote processes
        % (processes on other nodes).
        % A 'furthest' suffix destination refresh always prefers remote
        % processes rather than using local processes.
        % A 'random' suffix load balances across all connected nodes.
        % A 'local' suffix will only send to local processes, which will
        % cause less request latency.
        % A 'remote' suffix will always send to remote processes, which can
        % provide more fault-tolerance guarantees.
        % If the process doesn't send to any other processes, then 'none' can
        % be used and the process will die if it attempts to send to another
        % process (it is as if the destination deny list contains all services).
        % (so the choices are:
        %  'lazy_closest', 'immediate_closest',
        %  'lazy_furthest', 'immediate_furthest',
        %  'lazy_random', 'immediate_random',
        %  'lazy_local', 'immediate_local',
        %  'lazy_remote', 'immediate_remote',
        %  'lazy_newest', 'immediate_newest',
        %  'lazy_oldest', 'immediate_oldest',
        %  'none')
        none,
        % protocol used for each socket
        tcp,
        % buffer size used for each socket
        default, % bytes
        % timeout for receiving an initialization message from a socket
        20000,
        % default timeout for asynchronous calls
        5000,
        % default timeout for synchronous calls
        5000,
        % destination deny list is used as an ACL (Access Control List) that
        % prevents the process from sending to destinations with the specified
        % prefixes.  if atoms are used within the list, they must exist as an
        % associative entry in the acl configuration list.
        % if the destination deny list is 'undefined' any destination is valid.
        % a blocked request will just return a timeout
        % (earlier than the timeout specified for the request).
        undefined, % with 'none' destination refresh method, this is not checked
        % destination allow list is used as an ACL (Access Control List) that
        % allows the process to send to destinations with the specified
        % prefixes.  if atoms are used within the list, they must exist as an
        % associative entry in the acl configuration list.
        % if the destination allow list is 'undefined' any destination is valid.
        % a blocked request will just return a timeout
        % (earlier than the timeout specified for the request).
        undefined,
        % specify how many processes should be created with this configuration
        % (a float is a multiplier for the erlang VM scheduler count, i.e.,
        %  the desired cpu count)
        1,
        % specify how many threads should be created with this configuration
        % (i.e., how many sockets should be opened to each OS process)
        % (a float is a multiplier for the erlang VM scheduler count, i.e.,
        %  the desired cpu count)
        0.5,
        % If more than MaxR restarts occur within MaxT seconds,
        % CloudI terminates the process
        % MaxR (maximum restarts)
        5,
        % MaxT (maximum time)
        300, % seconds
        % options, e.g.:
        % {queue_limit, 1024} % to limit the service's queue to a maximum
        %                     % of 1024 requests (to prevent excessive memory
        %                     % consumption while the service is busy,
        %                     % handling a previous request)
        % (see config_service_options in
        %  lib/cloudi_core/src/cloudi_configuration.hrl)
        [{request_timeout_adjustment, true},
         {nice, 15}%,
         %{cgroup,
         % [{name, "cloudi/integration_tests/hexpi"},
         %  {parameters,
         %   [{"memory.limit_in_bytes", "64m"}]}]} % cgroup v1
         %   [{"memory.high", "64m"}]}]}           % cgroup v2
        ]},
    % (using the proplist method of specifying the configuration data...
    %  it provides defaults automatically)
    [%{type, internal}, % gets inferred
     {prefix, "/cloudi/"},
     {module, cloudi_service_filesystem},
     {args,
      [{directory, "@cloudi_prefix@/service_api/dashboard/"}]},
     {dest_refresh, none},
     {count_process, 4}],
    [{prefix, "/cloudi/log/"},
     {module, cloudi_service_filesystem},
     {args,
      [{directory, "@cloudi_prefix@/logs/"},
       {read, [{"/cloudi/log/cloudi.log", -16384}]},
       {files_size, 16},
       {refresh, 10},
       {debug, false}]},
     {dest_refresh, none}],
    [{prefix, "/shell"},
     {module, cloudi_service_shell},
     {dest_refresh, none},
     {count_process, 4}],
    [{module, cloudi_service_funnel},
     {args, [{name, "funnel"}]},
     {count_process, 4}],
    [{module, cloudi_service_cron},
     {args,
      [{expressions,
        [{"0 */1 * * * * *",
          [{send_args,
            ["/funnel/shell", default,
             "echo \"Hello World! The time is \"`date`\".\"",
             undefined, undefined]},
           {send_mcast, true},
           {send_args_info, true}]}]}]},
     {count_process, 4}],
    [{prefix, "*"},
     {module, cloudi_service_null},
     {args, [{debug, true}, {debug_contents, true}]},
     {dest_refresh, none},
     {options, [{response_timeout_immediate_max, limit_min}]}],
    [{prefix, "/tests/websockets/"},
     {module, cloudi_service_http_cowboy},
     {args, 
      [{port, 6464}, {output, external}, {use_websockets, true},
       {query_get_format, text_pairs},
       {websocket_connect_sync,
        "/tests/websockets/bounce/websocket/connect"},
       {websocket_disconnect_async,
        "/tests/websockets/bounce/websocket/disconnect"},
       {websocket_ping, 30000}, % milliseconds
       {websocket_subscriptions,
        [% also, subscribe to "on" a "bounce"
         {"b*u*ce", % <-- valid pattern
          [{parameters_selected, [1, 2]},
           {service_name,
            % wildcards for substitution don't need to be in a valid pattern
            "**/websocket"}]},
         % second subscription, "notification"
         {"b*u*ce",
          [{parameters_selected, [2, 1]},
           {service_name,
            "**tification/websocket"}]}
         ]},
       {content_security_policy,
        "default-src 'self'; "
        "script-src 'unsafe-inline' 'unsafe-eval' 'self'; "
        "style-src 'unsafe-inline' 'unsafe-eval' 'self'; "
        "object-src 'none'; "
        "worker-src 'none'; "
        "connect-src 'self' ws:"},
       {set_x_content_type_options, true},
       {set_x_xss_protection, true}]},
     {timeout_sync, 30000}],
    % tests/http/ services
    {internal,
        "/tests/http/",
        cloudi_service_http_cowboy,
        [{port, 6466}, {output, external},
         {query_get_format, text_pairs},
         {content_security_policy,
          "default-src 'self'; "
          "script-src 'unsafe-inline' 'unsafe-eval' 'self'; "
          "style-src 'unsafe-inline' 'unsafe-eval' 'self'; "
          "object-src 'none'; "
          "worker-src 'none'"},
         {set_x_content_type_options, true},
         {set_x_xss_protection, true}],
        immediate_closest,
        5000, 5000, 5000, [api], undefined, 1, 5, 300,
        []},
    {internal,
        "/tests/http/",
        cloudi_service_http_cowboy,
        [{port, 6467}, {output, internal},
         {query_get_format, text_pairs},
         {content_security_policy,
          "default-src 'self'; "
          "script-src 'unsafe-inline' 'unsafe-eval' 'self'; "
          "style-src 'unsafe-inline' 'unsafe-eval' 'self'; "
          "object-src 'none'; "
          "worker-src 'none'"},
         {set_x_content_type_options, true},
         {set_x_xss_protection, true}],
        immediate_closest, % quickstart testing, to avoid false negatives
        5000, 5000, 5000, undefined, undefined, 1, 5, 300,
        []},
    {internal,
        "/tests/http/",
        cloudi_service_http_elli,
        [{port, 6468}, {output, external},
         {query_get_format, text_pairs},
         {content_security_policy,
          "default-src 'self'; "
          "script-src 'unsafe-inline' 'unsafe-eval' 'self'; "
          "style-src 'unsafe-inline' 'unsafe-eval' 'self'; "
          "object-src 'none'; "
          "worker-src 'none'"},
         {set_x_content_type_options, true},
         {set_x_xss_protection, true}],
        immediate_closest,
        5000, 5000, 5000, [api], undefined, 1, 5, 300,
        []},
    {internal,
        "/queue",
        cloudi_service_queue,
        [% a maximum of 3 retries will occur if the service request
         % fails to receive a response within the timeout period
         % (e.g., the destination service crashes without providing a response)
         {retry, 3},
         % a write ahead logging (WAL) file path for all requests
         % (n.b., for efficiency reasons all requests are also held in memory)
         {file, "@cloudi_prefix@/logs/example_queue_${I}.log"},
         {compression, 6},
         {checksum, crc32}],
        immediate_closest,
        5000, 5000, 5000, undefined, undefined, 4, 5, 300,
        % make sure the cloudi_service_queue gets a timeout as
        % quickly as possible to allow it to retry
        [{request_timeout_immediate_max, limit_min},
         {response_timeout_immediate_max, limit_min}]},
    {internal,
        "/byzantine",
        cloudi_service_quorum,
        [{quorum, byzantine}],
        immediate_closest,
        5000, 5000, 5000, undefined, undefined, 1, 5, 300, []},
    {external,
        "/tests/http/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/http/http.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 4, 5, 300,
        [{nice, 15}]},
    {external,
        "/tests/http/",
        "@JAVA@",
        "-Dfile.encoding=UTF-8 "
        "-server "
        % enable assertions
        "-ea:org.cloudi... "
        "-jar @cloudi_prefix@/tests/http/java/http.jar",
        [],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 4, 5, 300,
        [{nice, 15}]},
    {external,
        "/tests/http/",
        "@RUBY@",
        "@cloudi_prefix@/tests/http/http.rb",
        [{"RUBYLIB", "@cloudi_prefix@/api/ruby/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 4, 5, 300,
        [{nice, 15}]},
@CONFIG_TESTS_ATS2_COUNT@
@CONFIG_TESTS_GO_COUNT@
@CONFIG_TESTS_HASKELL_COUNT@
@CONFIG_TESTS_OCAML_COUNT@
    {external,
        "/tests/count/",
        "@cloudi_prefix@/tests/count/count_c", "",
        [{"LD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"},
         {"DYLD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 4, 1, 5, 300,
        [{nice, 10}]},
    {external,
        "/tests/count/",
        "@JAVA@",
        "-Dfile.encoding=UTF-8 "
        "-server "
        % enable assertions
        "-ea:org.cloudi... "
        "-jar @cloudi_prefix@/tests/count/java/count.jar",
        [],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 4, 5, 300,
        [{nice, 10}]},
    {external,
        "/tests/count/",
        "@NODE@",
        "@cloudi_prefix@/tests/count/count.js",
        [{"NODE_PATH", "@cloudi_prefix@/api/javascript/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 4, 1, 5, 300,
        [{nice, 10}]},
    {external,
        "/tests/count/",
        "@PERL@",
        "@cloudi_prefix@/tests/count/CountTask.pm",
        [{"PERL5LIB", "@cloudi_prefix@/api/perl/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 4, 5, 300,
        [{nice, 10}]},
    {external,
        "/tests/count/",
        "@PHP@",
        "-d zend.assertions=1 "
        "-d include_path='@cloudi_prefix@/api/php/' "
        "-f @cloudi_prefix@/tests/count/count.php",
        [],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 4, 1, 5, 300,
        [{nice, 10}]},
    {external,
        "/tests/count/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/count/count.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 4, 5, 300,
        [{nice, 10}]},
    {external,
        "/tests/count/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/count/count_c.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 4, 5, 300,
        [{nice, 10}]},
    {external,
        "/tests/count/",
        "@RUBY@",
        "@cloudi_prefix@/tests/count/count.rb",
        [{"RUBYLIB", "@cloudi_prefix@/api/ruby/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 4, 5, 300,
        [{nice, 10}]},
    {internal,
        "/tests/count/",
        cloudi_service_test_count,
        [{mode, crdt}],
        immediate_closest, 5000, 5000, 5000, undefined, undefined, 4, 5, 300,
        []},
@CONFIG_TESTS_ATS2_HTTP_REQ@
@CONFIG_TESTS_GO_HTTP_REQ@
@CONFIG_TESTS_HASKELL_HTTP_REQ@
@CONFIG_TESTS_OCAML_HTTP_REQ@
    {external,
        "/tests/http_req/",
        "@cloudi_prefix@/tests/http_req/http_req_c", "",
        [{"LD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"},
         {"DYLD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         %% OpenBSD 6.8
         %{syscall_lock,
         % [{type, pledge},
         %  {names,
         %   [% C/C++ CloudI API use
         %    "stdio",
         %    % dynamically linked library loading
         %    "rpath"
         %    ]}]},
         %% Ubuntu 20.04 Linux (5.4.0 kernel, glibc 2.31)
         %{syscall_lock,
         % [{type, function},
         %  {names,
         %   [% C/C++ CloudI API use
         %    "execve","clock_gettime","poll","read","write","close","exit",
         %    "brk","mmap","munmap", % (malloc/free)
         %    % Linux-specific
         %    "exit_group",
         %    % dynamically linked library loading
         %    "arch_prctl","mprotect",
         %    "access","openat","stat","fstat","pread64"
         %    % static linking requires
         %    %"arch_prctl","mprotect","uname","readlink"
         %    ]}]},
         {nice, 10}]},
    {external,
        "/tests/http_req/",
        "@JAVA@",
        "-Dfile.encoding=UTF-8 "
        "-server "
        % enable assertions
        "-ea:org.cloudi... "
        "-jar @cloudi_prefix@/tests/http_req/java/http_req.jar",
        [],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {nice, 10}]},
    {external,
        "/tests/http_req/",
        "@NODE@",
        "@cloudi_prefix@/tests/http_req/http_req.js",
        [{"NODE_PATH", "@cloudi_prefix@/api/javascript/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {nice, 10}]},
    {external,
        "/tests/http_req/",
        "@PERL@",
        "@cloudi_prefix@/tests/http_req/http_req.pl",
        [{"PERL5LIB", "@cloudi_prefix@/api/perl/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {nice, 10}]},
    {external,
        "/tests/http_req/",
        "@PHP@",
        "-d zend.assertions=1 "
        "-d include_path='@cloudi_prefix@/api/php/' "
        "-f @cloudi_prefix@/tests/http_req/http_req.php",
        [],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {nice, 10}]},
    {external,
        "/tests/http_req/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/http_req/http_req.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {nice, 10}]},
    {external,
        "/tests/http_req/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/http_req/http_req_c.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined,
        1.0, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {count_process_dynamic,
          [{rate_request_max, 1.1},
           {rate_request_min, 0.9},
           {count_max, 4.0},
           {count_min, 0.25}]},
         {nice, 10}]},
    {external,
        "/tests/http_req/",
        "@RUBY@",
        "@cloudi_prefix@/tests/http_req/http_req.rb",
        [{"RUBYLIB", "@cloudi_prefix@/api/ruby/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {nice, 10}]},
    {internal,
        "/tests/http_req/",
        cloudi_service_test_http_req,
        [],
        none,
        limit_max, limit_max, limit_max, % test limits
        undefined, undefined, 1.0, 5, 300,
        [{timeout_terminate, limit_max},
         {request_timeout_adjustment, true},
         {hibernate,
          [{rate_request_min, 0.9}]},
         {count_process_dynamic,
          [{rate_request_max, 1.1},
           {rate_request_min, 0.9},
           {count_max, 2.0},
           {count_min, 0.25}]}]},
    {internal,
        "/tests/http_req/",
        cloudi_service_test_http_req,
        [],
        none,
        limit_min, limit_min, limit_min, % test limits
        undefined, undefined, 1.0, 5, 300,
        [{timeout_terminate, limit_min},
         {request_timeout_adjustment, true},
         {hibernate,
          [{rate_request_min, 0.9}]},
         {count_process_dynamic,
          [{rate_request_max, 1.1},
           {rate_request_min, 0.9},
           {count_max, 2.0},
           {count_min, 0.25}]}]},
@CONFIG_TESTS_ATS2_NULL@
@CONFIG_TESTS_GO_NULL@
@CONFIG_TESTS_HASKELL_NULL@
@CONFIG_TESTS_OCAML_NULL@
    {external,
        "/tests/null/response/",
        "@cloudi_prefix@/tests/null/null_c", "",
        [{"LD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"},
         {"DYLD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_min},
         {nice, 10}]},
    {external,
        "/tests/null/response/",
        "@JAVA@",
        "-Dfile.encoding=UTF-8 "
        "-server "
        % enable assertions
        "-ea:org.cloudi... "
        "-jar @cloudi_prefix@/tests/null/java/null_.jar",
        [],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_min},
         {nice, 10}]},
    {external,
        "/tests/null/response/",
        "@NODE@",
        "@cloudi_prefix@/tests/null/null.js",
        [{"NODE_PATH", "@cloudi_prefix@/api/javascript/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_min},
         {nice, 10}]},
    {external,
        "/tests/null/response/",
        "@PERL@",
        "@cloudi_prefix@/tests/null/null.pl",
        [{"PERL5LIB", "@cloudi_prefix@/api/perl/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_min},
         {nice, 10}]},
    {external,
        "/tests/null/response/",
        "@PHP@",
        "-d zend.assertions=1 "
        "-d include_path='@cloudi_prefix@/api/php/' "
        "-f @cloudi_prefix@/tests/null/null.php",
        [],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_min},
         {nice, 10}]},
    {external,
        "/tests/null/response/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/null/null.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_min},
         {nice, 10}]},
    {external,
        "/tests/null/response/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/null/null_c.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_min},
         {nice, 10}]},
    {external,
        "/tests/null/response/",
        "@RUBY@",
        "@cloudi_prefix@/tests/null/null.rb",
        [{"RUBYLIB", "@cloudi_prefix@/api/ruby/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_min},
         {nice, 10}]},
    {internal,
        "/tests/null/response/",
        cloudi_service_test_null,
        [],
        none, 5000, 5000, 5000, undefined, undefined, 1, 5, 300,
        [{response_timeout_immediate_max, limit_min}]},
    {external,
        "/tests/null/timeout/",
        "@cloudi_prefix@/tests/null/null_c", "",
        [{"LD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"},
         {"DYLD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_max},
         {nice, 10}]},
    {external,
        "/tests/null/timeout/",
        "@JAVA@",
        "-Dfile.encoding=UTF-8 "
        "-server "
        % enable assertions
        "-ea:org.cloudi... "
        "-jar @cloudi_prefix@/tests/null/java/null_.jar",
        [],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_max},
         {nice, 10}]},
    {external,
        "/tests/null/timeout/",
        "@NODE@",
        "@cloudi_prefix@/tests/null/null.js",
        [{"NODE_PATH", "@cloudi_prefix@/api/javascript/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_max},
         {nice, 10}]},
    {external,
        "/tests/null/timeout/",
        "@PERL@",
        "@cloudi_prefix@/tests/null/null.pl",
        [{"PERL5LIB", "@cloudi_prefix@/api/perl/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_max},
         {nice, 10}]},
    {external,
        "/tests/null/timeout/",
        "@PHP@",
        "-d zend.assertions=1 "
        "-d include_path='@cloudi_prefix@/api/php/' "
        "-f @cloudi_prefix@/tests/null/null.php",
        [],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_max},
         {nice, 10}]},
    {external,
        "/tests/null/timeout/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/null/null.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_max},
         {nice, 10}]},
    {external,
        "/tests/null/timeout/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/null/null_c.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_max},
         {nice, 10}]},
    {external,
        "/tests/null/timeout/",
        "@RUBY@",
        "@cloudi_prefix@/tests/null/null.rb",
        [{"RUBYLIB", "@cloudi_prefix@/api/ruby/"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{response_timeout_immediate_max, limit_max},
         {nice, 10}]},
    {internal,
        "/tests/null/timeout/",
        cloudi_service_test_null,
        [],
        none, 5000, 5000, 5000, undefined, undefined, 1, 5, 300,
        [{response_timeout_immediate_max, limit_max}]},
    {internal,
        "/tests/",
        cloudi_service_router,
        [{destinations,
          [{"http_req/any.xml/get",
            [{mode, round_robin},
             {service_names,
              ["http_req/c.xml/get",
               "http_req/java.xml/get",
               "http_req/perl.xml/get",
               "http_req/php.xml/get",
               "http_req/python.xml/get",
               "http_req/python_c.xml/get",
               "http_req/ruby.xml/get"]}]},
           {"null/response/any/get",
            [{mode, round_robin},
             {service_names,
              ["null/response/c/get",
               "null/response/java/get",
               "null/response/perl/get",
               "null/response/php/get",
               "null/response/python/get",
               "null/response/python_c/get",
               "null/response/ruby/get"]}]},
           {"null/timeout/any/get",
            [{mode, round_robin},
             {service_names,
              ["null/timeout/c/get",
               "null/timeout/java/get",
               "null/timeout/perl/get",
               "null/timeout/php/get",
               "null/timeout/python/get",
               "null/timeout/python_c/get",
               "null/timeout/ruby/get"]}]}]}],
        immediate_closest,
        5000, 5000, 5000, [api], undefined, 1, 5, 300,
        [{request_name_lookup, async}]},
    % normal echo in python
    {external,
        "/tests/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/echo/echo.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        [{nice, 15}]},
    % unstable 50% chance (coin toss) echo in python
    {external,
        "/tests/coin/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/echo/echo.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        none, default, default,
        5000, 5000, 5000, undefined, undefined, 1, 1, 5, 300,
        % give this service instance a 50% of failure on a service request
        [{monkey_chaos, [{probability_request, 0.5}]},
         {nice, 15}]},
    {internal,
        "/tests/http_req/",
        cloudi_service_filesystem,
        [{directory, "@cloudi_prefix@/tests/http_req/public_html/"},
         {write_append, ["/tests/http_req/hexpi.txt"]},
         {refresh, 10}, % seconds
         {cache, refresh}, % 5 seconds
         {files_size, 1024}, % KiB
         {replace, lfuda_gdsf},
         {redirect,
          [{"/tests/http_req/redirect/*", "/tests/http_req/*"}]},
         {notify_one,
          [{"/tests/http_req/index.html/get", "/tests/echo/put"}]}],
        immediate_closest,
        5000, 5000, 5000, undefined, undefined, 1, 5, 300, []},
    %{internal,
    %    "/db/pgsql/",
    %    cloudi_service_db_pgsql,
    %    [{hostname, "127.0.0.1"},
    %     {username, "cloudi_tests"},
    %     {password, "cloudi_tests"},
    %     {port, 5432},
    %     {database, "cloudi_tests"}],
    %    none,
    %    5000, 5000, 5000, undefined, undefined, 1, 5, 300, []},
    % the service below manages the Hexidecimal PI test
    [{prefix, "/tests/"},
     {module, cloudi_service_map_reduce},
     {args, [{map_reduce, cloudi_service_test_hexpi}, % map-reduce module
             {map_reduce_args, [1, 65536]},  % index start, index end
             {name, "hexpi_control"}, % suspend/resume service name
             {concurrency, 1.5}]},
     {timeout_init, 20000},
     {dest_list_deny, [api]},
     {options, [{request_timeout_adjustment, true},
                {aspects_suspend,
                 [{cloudi_service_map_reduce, aspect_suspend}]},
                {aspects_resume,
                 [{cloudi_service_map_reduce, aspect_resume}]}]}],
    {external,
        "/tests/websockets/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/websockets/websockets.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        immediate_local, default, default,
        5000, 5000, 5000, [api], undefined, 1, 4, 5, 300,
        [{nice, 15}]},
    {external,
        "/tests/environment/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/environment/environment.py "
        "'' À 'À' \"À\" `À`",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"},
         {"USER", "${USER}"},
         {"$USER", "user"},
         {"${USER}_$USER", "user_user"},
         {"$USER${USER}", "useruser"},
         {"${USER}123$USER", "user123user"},
         {"USER_D", "user_\\$"}, % \\ is needed to escape $
         {"USER_", "user_$"}, % "$" is ignored
         {"${INVALID1=$USER'check1'${INVALID2", "user'check1'"},
         {"$INVALID1=$USER\"check2\"$INVALID2}", "user\"check2\""},
         {"$USER/$USER $USER`$USER", "user/user user`user"},
         {"À_UNICODE", "true"},
         {"UNICODE_À", "true"},
         {"UNICODE_CHARACTER", "À"}],
        immediate_local, default, default,
        5000, 5000, 5000, [api], undefined, 1, 1, 5, 300,
        [{nice, 15}]},
    % msg_size tests can not use the udp protocol with the default buffer size
@CONFIG_TESTS_ATS2_MSG_SIZE@
@CONFIG_TESTS_GO_MSG_SIZE@
@CONFIG_TESTS_HASKELL_MSG_SIZE@
@CONFIG_TESTS_OCAML_MSG_SIZE@
    {internal,
        "/tests/msg_size/",
        cloudi_service_test_msg_size,
        [],
        immediate_closest,
        5000, 5000, 5000, [api], undefined, 2, 5, 300,
        [{request_timeout_adjustment, true},
         {automatic_loading, false},
         {duo_mode, true},
         {aspects_request_before,
          [{cloudi_service_test_msg_size, aspect_request}]},
         {aspects_terminate_before,
          [{cloudi_service_test_msg_size, aspect_terminate}]},
         {restart_delay, []},
         {scope, cloudi_service_test_msg_size}]},
    {external,
        "/tests/msg_size/",
        "@cloudi_prefix@/tests/msg_size/msg_size_cxx",
        "",
        [{"LD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"},
         {"DYLD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"}],
        immediate_closest, default, default,
        5000, 5000, 5000, [api], undefined, 2, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {aspects_init_after,
          [{cloudi_service_test_msg_size, aspect_init}]},
         {aspects_request_before,
          [{cloudi_service_test_msg_size, aspect_request}]},
         {aspects_terminate_before,
          [{cloudi_service_test_msg_size, aspect_terminate}]},
         {scope, cloudi_service_test_msg_size},
         {nice, 15}]},
    {external,
        "/tests/msg_size/",
        "@JAVA@",
        "-Dfile.encoding=UTF-8 "
        "-server "
        % enable assertions
        "-ea:org.cloudi... "
        "-jar @cloudi_prefix@/tests/msg_size/java/msg_size.jar",
        [],
        immediate_closest, default, default,
        5000, 5000, 5000, [api], undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {aspects_init_after,
          [{cloudi_service_test_msg_size, aspect_init}]},
         {aspects_request_before,
          [{cloudi_service_test_msg_size, aspect_request}]},
         {aspects_terminate_before,
          [{cloudi_service_test_msg_size, aspect_terminate}]},
         {scope, cloudi_service_test_msg_size},
         {nice, 15}]},
    {external,
        "/tests/msg_size/",
        "@NODE@",
        "@cloudi_prefix@/tests/msg_size/msg_size.js",
        [{"NODE_PATH", "@cloudi_prefix@/api/javascript/"}],
        immediate_closest, default, default,
        5000, 5000, 5000, [api], undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {aspects_init_after,
          [{cloudi_service_test_msg_size, aspect_init}]},
         {aspects_request_before,
          [{cloudi_service_test_msg_size, aspect_request}]},
         {aspects_terminate_before,
          [{cloudi_service_test_msg_size, aspect_terminate}]},
         {scope, cloudi_service_test_msg_size},
         {nice, 15}]},
    {external,
        "/tests/msg_size/",
        "@PERL@",
        "@cloudi_prefix@/tests/msg_size/msg_size.pl",
        [{"PERL5LIB", "@cloudi_prefix@/api/perl/"}],
        immediate_closest, default, default,
        5000, 5000, 5000, [api], undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {aspects_init_after,
          [{cloudi_service_test_msg_size, aspect_init}]},
         {aspects_request_before,
          [{cloudi_service_test_msg_size, aspect_request}]},
         {aspects_terminate_before,
          [{cloudi_service_test_msg_size, aspect_terminate}]},
         {scope, cloudi_service_test_msg_size},
         {nice, 15}]},
    {external,
        "/tests/msg_size/",
        "@PHP@",
        "-d zend.assertions=1 "
        "-d include_path='@cloudi_prefix@/api/php/' "
        "-f @cloudi_prefix@/tests/msg_size/msg_size.php",
        [],
        immediate_closest, default, default,
        5000, 5000, 5000, [api], undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {aspects_init_after,
          [{cloudi_service_test_msg_size, aspect_init}]},
         {aspects_request_before,
          [{cloudi_service_test_msg_size, aspect_request}]},
         {aspects_terminate_before,
          [{cloudi_service_test_msg_size, aspect_terminate}]},
         {scope, cloudi_service_test_msg_size},
         {nice, 15}]},
    {external,
        "/tests/msg_size/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/msg_size/msg_size.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        immediate_closest, default, default,
        5000, 5000, 5000, [api], undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {aspects_init_after,
          [{cloudi_service_test_msg_size, aspect_init}]},
         {aspects_request_before,
          [{cloudi_service_test_msg_size, aspect_request}]},
         {aspects_terminate_before,
          [{cloudi_service_test_msg_size, aspect_terminate}]},
         {scope, cloudi_service_test_msg_size},
         {nice, 15}]},
    {external,
        "/tests/msg_size/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/msg_size/msg_size_c.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        immediate_closest, default, default,
        5000, 5000, 5000, [api], undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {aspects_init_after,
          [{cloudi_service_test_msg_size, aspect_init}]},
         {aspects_request_before,
          [{cloudi_service_test_msg_size, aspect_request}]},
         {aspects_terminate_before,
          [{cloudi_service_test_msg_size, aspect_terminate}]},
         {scope, cloudi_service_test_msg_size},
         {nice, 15}]},
    {external,
        "/tests/msg_size/",
        "@RUBY@",
        "@cloudi_prefix@/tests/msg_size/msg_size.rb",
        [{"RUBYLIB", "@cloudi_prefix@/api/ruby/"}],
        immediate_closest, default, default,
        5000, 5000, 5000, [api], undefined, 1, 1, 5, 300,
        [{request_timeout_adjustment, true},
         {aspects_init_after,
          [{cloudi_service_test_msg_size, aspect_init}]},
         {aspects_request_before,
          [{cloudi_service_test_msg_size, aspect_request}]},
         {aspects_terminate_before,
          [{cloudi_service_test_msg_size, aspect_terminate}]},
         {scope, cloudi_service_test_msg_size},
         {nice, 15}]},
@CONFIG_TESTS_ATS2_MESSAGING@
@CONFIG_TESTS_GO_MESSAGING@
@CONFIG_TESTS_HASKELL_MESSAGING@
@CONFIG_TESTS_OCAML_MESSAGING@
    {external,
        "/tests/messaging/perl/",
        "@PERL@",
        "@cloudi_prefix@/tests/messaging/MessagingTask.pm",
        [{"PERL5LIB", "@cloudi_prefix@/api/perl/"}],
        immediate_local, default, default,
        5000, 10000, 10000, [api], undefined, 1, 4, 5, 300,
        [{dispatcher_pid_options, [{priority, low}]},
         {nice, 15},
         {scope, cloudi_service_test_messaging_perl}]},
    {external,
        "/tests/messaging/javascript/",
        "@NODE@",
        "@cloudi_prefix@/tests/messaging/messaging.js",
        [{"NODE_PATH", "@cloudi_prefix@/api/javascript/"}],
        immediate_local, default, default,
        5000, 10000, 10000, [api], undefined, 4, 1, 5, 300,
        [{restart_all, true},
         {dispatcher_pid_options, [{priority, low}]},
         {nice, 15},
         {scope, cloudi_service_test_messaging_javascript}]},
    {external,
        "/tests/messaging/php/",
        "@PHP@",
        "-d zend.assertions=1 "
        "-d include_path='@cloudi_prefix@/api/php/' "
        "-f @cloudi_prefix@/tests/messaging/messaging.php",
        [],
        immediate_local, default, default,
        5000, 10000, 10000, [api], undefined, 4, 1, 5, 300,
        [{restart_all, true},
         {dispatcher_pid_options, [{priority, low}]},
         {nice, 15},
         {scope, cloudi_service_test_messaging_php}]},
    {external,
        "/tests/messaging/python/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/messaging/messaging.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        immediate_local, default, default,
        5000, 10000, 10000, [api], undefined, 1, 4, 5, 300,
        [{dispatcher_pid_options, [{priority, low}]},
         {nice, 15},
         {scope, cloudi_service_test_messaging_python}]},
    {external,
        "/tests/messaging/python_c/",
        "@PYTHON@",
        "@cloudi_prefix@/tests/messaging/messaging_c.py",
        [{"PYTHONPATH", "@cloudi_prefix@/api/python/"},
         {"LANG", "en_US.UTF-8"}],
        immediate_local, default, default,
        5000, 10000, 10000, [api], undefined, 1, 4, 5, 300,
        [{dispatcher_pid_options, [{priority, low}]},
         {nice, 15},
         {scope, cloudi_service_test_messaging_python_c}]},
    {external,
        "/tests/messaging/ruby/",
        "@RUBY@",
        "@cloudi_prefix@/tests/messaging/messaging.rb",
        [{"RUBYLIB", "@cloudi_prefix@/api/ruby/"}],
        immediate_local, default, default,
        5000, 10000, 10000, [api], undefined, 1, 4, 5, 300,
        [{dispatcher_pid_options, [{priority, low}]},
         {nice, 15},
         {scope, cloudi_service_test_messaging_ruby}]},
    {external,
        "/tests/messaging/cxx/",
        "@cloudi_prefix@/tests/messaging/messaging_cxx",
        "",
        [{"LD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"},
         {"DYLD_LIBRARY_PATH", "@cloudi_prefix@/api/c/"}],
        immediate_local, default, default,
        5000, 10000, 10000, [api], undefined, 1, 4, 5, 300,
        [{dispatcher_pid_options, [{priority, low}]},
         {nice, 15},
         {scope, cloudi_service_test_messaging_cxx}]},
    {external,
        "/tests/messaging/java/",
        "@JAVA@",
        "-Dfile.encoding=UTF-8 "
        % based on http://www.infoq.com/articles/benchmarking-jvm
        "-Xbatch -server -Xmx1G -Xms1G "
        % enable assertions
        "-ea:org.cloudi... "
        "-jar @cloudi_prefix@/tests/messaging/java/messaging.jar",
        [],
        immediate_local, default, default,
        5000, 10000, 10000, [api], undefined, 1, 4, 5, 300,
        [{dispatcher_pid_options, [{priority, low}]},
         {nice, 15},
         %{cgroup,
         % [{name, "cloudi/integration_tests/messaging_java"},
         %  {parameters,
         %   [{"memory.max", "4m"}]}]}, % cgroup v2
         {scope, cloudi_service_test_messaging_java}]},
    {internal,
        "/tests/messaging/erlang/variation0/",
        cloudi_service_test_messaging,
        [],
        immediate_local,
        5000, 10000, 10000, [api], undefined, 4, 5, 300,
        [{restart_all, true},
         {hibernate, false},
         {duo_mode, false},
         {scope, cloudi_service_test_messaging_erlang_variation0}]},
    {internal,
        "/tests/messaging/erlang/variation1/",
        cloudi_service_test_messaging,
        [],
        immediate_local,
        5000, 10000, 10000, [api], undefined, 4, 5, 300,
        [{restart_all, true},
         {hibernate, false},
         {duo_mode, true},
         {scope, cloudi_service_test_messaging_erlang_variation1}]},
    {internal,
        "/tests/messaging/erlang/variation2/",
        cloudi_service_test_messaging,
        [],
        immediate_local,
        5000, 10000, 10000, [api], undefined, 4, 5, 300,
        [{restart_all, true},
         {hibernate, true},
         {duo_mode, false},
         {scope, cloudi_service_test_messaging_erlang_variation2}]},
    {internal,
        "/tests/messaging/erlang/variation3/",
        cloudi_service_test_messaging,
        [],
        immediate_local,
        5000, 10000, 10000, [api], undefined, 4, 5, 300,
        [{restart_all, true},
         {hibernate, true},
         {duo_mode, true},
         {scope, cloudi_service_test_messaging_erlang_variation3}]}
]}.
% automatic node detection with a UDP multicast group
{nodes, automatic}.
% is equivalent to:
%{nodes, [{discovery, [{multicast, []}]}]}.
% manually specified node names
%{nodes, ['cloudi@host1', 'cloudi@host2']}.
% is equivalent to:
%{nodes, [{nodes, ['cloudi@host1', 'cloudi@host2']}]}.
% (see https://cloudi.org/api.html#2_nodes_set for all the options)
{logging, [
    %{file, "path/to/logfile"},
    %{level, trace}, % levels: off, fatal, error, warn, info, debug, trace
    %{syslog,
    % [{identity, "CloudI"},
    %  {facility, local0},
    %  {level, trace}]}, % CloudI log levels are mapped to syslog levels
    %{formatters,
    % [{any,
    %   [{formatter, cloudi_core_i_logger},
    %    {formatter_config,
    %     [{mode, legacy}]}]},
    %  {['STDOUT'],
    %   [{formatter, cloudi_core_i_logger},
    %    {formatter_config,
    %     [{mode, legacy_stdout}]}]},
    %  {['STDERR'],
    %   [{formatter, cloudi_core_i_logger},
    %    {formatter_config,
    %     [{mode, legacy_stderr}]}]}]},
    %{redirect, undefined}
    {log_time_offset, info}
]}.
{code, [
    % internal service source code configuration
    % (should only be used when absolutely necessary, i.e.,
    %  typically an internal service with automatic_loading == true
    %  will handle starting an application or loading the service module)
    {paths,
     ["@cloudi_prefix@/tests/count/erlang/ebin/",
      "@cloudi_prefix@/tests/hexpi/erlang/ebin/",
      "@cloudi_prefix@/tests/http_req/erlang/ebin/",
      "@cloudi_prefix@/tests/msg_size/erlang/ebin/",
      "@cloudi_prefix@/tests/messaging/erlang/ebin/",
      "@cloudi_prefix@/tests/null/erlang/ebin/"]},
    {modules,
     [cloudi_service_test_msg_size]}
    %{applications,
    % [cloudi_x_msgpack]},
    %{releases,
    % ["/full/path/to/release1/name1.boot",
    %  "/full/path/to/release2/name2.script"]}
]}.


