From 8004bbaa1b31b14dd4c4d3886b5f57b103bf7405 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 2 Jun 2019 13:43:21 +0300 Subject: Speed up tests. Presence of the ~/.netrc file can slow down execution because of eventual DNS calls in hostcmp. Provide an option to disable netrc parsing and use it in tests. * src/piesctl-cl.opt: New option: --no-netrc. * doc/pies.texi: Document --no-netrc * src/piesctl.c (shttp_connect): Don't read ~/.netrc if given --no-netrc. * tests/env.at: Pass --no-netrc to piesctl. * tests/respawn.at: Likewise. * tests/shell.at: Likewise. * tests/shutdown.at: Likewise. * tests/startup.at: Likewise. --- src/piesctl-cl.opt | 6 ++++++ src/piesctl.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/piesctl-cl.opt b/src/piesctl-cl.opt index f7eaf2a..ebdfec4 100644 --- a/src/piesctl-cl.opt +++ b/src/piesctl-cl.opt @@ -69,6 +69,12 @@ BEGIN } END +OPTION(no-netrc,N,, + []) +BEGIN + no_netrc_option = 1; +END + GROUP(Preprocessor) OPTION(include-directory,I,DIR, diff --git a/src/piesctl.c b/src/piesctl.c index 0cd2736..4c777d7 100644 --- a/src/piesctl.c +++ b/src/piesctl.c @@ -49,6 +49,7 @@ char const *instance = "pies"; char *config_file; char default_config_file[] = SYSCONFDIR "/piesctl.conf"; int preprocess_only; +int no_netrc_option; int verbose; int dump; @@ -543,7 +544,8 @@ shttp_connect (struct pies_url *url, struct grecs_sockaddr *source_addr) if (pies_url_copy (&conn->url, url)) grecs_alloc_die (); - netrc_scan (conn->url); + if (!no_netrc_option) + netrc_scan (conn->url); return conn; } -- cgit v1.2.1