summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorJuanjo Rodriguez <jjrodrig@gmail.com>2020-03-17 23:51:40 +0100
committerGitHub <noreply@github.com>2020-03-17 23:51:40 +0100
commit3bf47de19232ef076e843d05c626beeebd051bd7 (patch)
tree05071744ac66428c610aa37c99f05d531e019762 /dev
parent8acb4d59c99646786c82ed5a37f8023ec8d78e5a (diff)
downloadcouchdb-3bf47de19232ef076e843d05c626beeebd051bd7.tar.gz
3.x merge - Port elixir proxyauth tests from js to elixir (#2660)
* Port elixir proxyauth tests from js to elixir (#2660) * Add support for specify a custom config file for CouchDB startup during testing
Diffstat (limited to 'dev')
-rwxr-xr-xdev/run27
1 files changed, 27 insertions, 0 deletions
diff --git a/dev/run b/dev/run
index a96817d83..573c80c9b 100755
--- a/dev/run
+++ b/dev/run
@@ -211,6 +211,14 @@ def get_args_parser():
default=None,
help="Extra arguments to pass to beam process",
)
+ parser.add_option(
+ "-l",
+ "--locald-config",
+ dest="locald_configs",
+ action="append",
+ default=[],
+ help="Path to config to place in 'local.d'. Can be repeated",
+ )
return parser
@@ -238,6 +246,7 @@ def setup_context(opts, args):
"reset_logs": True,
"procs": [],
"auto_ports": opts.auto_ports,
+ "locald_configs": opts.locald_configs,
}
@@ -279,9 +288,24 @@ def setup_configs(ctx):
"_default": "",
}
write_config(ctx, node, env)
+ write_locald_configs(ctx, node, env)
generate_haproxy_config(ctx)
+def write_locald_configs(ctx, node, env):
+ for locald_config in ctx["locald_configs"]:
+ config_src = os.path.join(ctx["rootdir"], locald_config)
+ if os.path.exists(config_src):
+ config_filename = os.path.basename(config_src)
+ config_tgt = os.path.join(
+ ctx["devdir"], "lib", node, "etc", "local.d", config_filename
+ )
+ with open(config_src) as handle:
+ content = handle.read()
+ with open(config_tgt, "w") as handle:
+ handle.write(content)
+
+
def generate_haproxy_config(ctx):
haproxy_config = os.path.join(ctx["devdir"], "lib", "haproxy.cfg")
template = os.path.join(ctx["rootdir"], "rel", "haproxy.cfg")
@@ -382,6 +406,8 @@ def write_config(ctx, node, env):
with open(tgt, "w") as handle:
handle.write(content)
+ ensure_dir_exists(etc_tgt, "local.d")
+
def boot_haproxy(ctx):
if not ctx["with_haproxy"]:
@@ -580,6 +606,7 @@ def boot_node(ctx, node):
"-couch_ini",
os.path.join(node_etcdir, "default.ini"),
os.path.join(node_etcdir, "local.ini"),
+ os.path.join(node_etcdir, "local.d"),
"-reltool_config",
os.path.join(reldir, "reltool.config"),
"-parent_pid",