aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-06-02 13:43:21 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-06-02 13:49:55 +0300
commit8004bbaa1b31b14dd4c4d3886b5f57b103bf7405 (patch)
treea6fd826c284fe1e7131c4852c2964b6029ca758d
parent685600d72b0c300f94c0c69dc0a16c4ebb230a21 (diff)
downloadpies-8004bbaa1b31b14dd4c4d3886b5f57b103bf7405.tar.gz
pies-8004bbaa1b31b14dd4c4d3886b5f57b103bf7405.tar.bz2
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.
-rw-r--r--doc/pies.texi4
-rw-r--r--src/piesctl-cl.opt6
-rw-r--r--src/piesctl.c4
-rw-r--r--tests/env.at4
-rw-r--r--tests/respawn.at2
-rw-r--r--tests/shell.at2
-rw-r--r--tests/shutdown.at4
-rw-r--r--tests/startup.at4
8 files changed, 21 insertions, 9 deletions
diff --git a/doc/pies.texi b/doc/pies.texi
index 1a798e1..b77a40c 100644
--- a/doc/pies.texi
+++ b/doc/pies.texi
@@ -3026,2 +3026,6 @@ Talk to @command{pies} instance @var{inst}.
3026 3026
3027@item --no-netc
3028@itemx -N
3029Don't read @file{~/.netrc} file.
3030
3027@item -u @var{url} 3031@item -u @var{url}
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
@@ -71,2 +71,8 @@ END
71 71
72OPTION(no-netrc,N,,
73 [<don't read ~/.netrc file>])
74BEGIN
75 no_netrc_option = 1;
76END
77
72GROUP(Preprocessor) 78GROUP(Preprocessor)
diff --git a/src/piesctl.c b/src/piesctl.c
index 0cd2736..4c777d7 100644
--- a/src/piesctl.c
+++ b/src/piesctl.c
@@ -51,2 +51,3 @@ char default_config_file[] = SYSCONFDIR "/piesctl.conf";
51int preprocess_only; 51int preprocess_only;
52int no_netrc_option;
52int verbose; 53int verbose;
@@ -545,3 +546,4 @@ shttp_connect (struct pies_url *url, struct grecs_sockaddr *source_addr)
545 546
546 netrc_scan (conn->url); 547 if (!no_netrc_option)
548 netrc_scan (conn->url);
547 549
diff --git a/tests/env.at b/tests/env.at
index c293c65..18b0e52 100644
--- a/tests/env.at
+++ b/tests/env.at
@@ -17,3 +17,3 @@ component envtest {
17 action disable; 17 action disable;
18 exec "piesctl --url unix:///$PWD/pies.ctl shutdown"; 18 exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
19 } 19 }
@@ -22,3 +22,3 @@ _EOT
22 22
23to 3 \ 23to 5 \
24 envtest -exec \ 24 envtest -exec \
diff --git a/tests/respawn.at b/tests/respawn.at
index 0ba60dc..ab29f11 100644
--- a/tests/respawn.at
+++ b/tests/respawn.at
@@ -29,3 +29,3 @@ component test {
29 action disable; 29 action disable;
30 exec "piesctl --url unix:///$PWD/pies.ctl shutdown"; 30 exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
31 } 31 }
diff --git a/tests/shell.at b/tests/shell.at
index e3d104b..b459d02 100644
--- a/tests/shell.at
+++ b/tests/shell.at
@@ -31,3 +31,3 @@ component test {
31 action disable; 31 action disable;
32 exec "piesctl --url unix:///$PWD/pies.ctl shutdown"; 32 exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
33 } 33 }
diff --git a/tests/shutdown.at b/tests/shutdown.at
index 1c2a4ef..24a4504 100644
--- a/tests/shutdown.at
+++ b/tests/shutdown.at
@@ -31,3 +31,3 @@ component test {
31 action disable; 31 action disable;
32 exec "piesctl --url unix:///$PWD/pies.ctl shutdown"; 32 exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
33 } 33 }
@@ -44,3 +44,3 @@ to 5 \
44 pies --foreground --stderr \ 44 pies --foreground --stderr \
45 --config-file control.conf --config-file pies.conf 2>errlog 45 --config-file control.conf --config-file pies.conf --debug 1 2>errlog
46 46
diff --git a/tests/startup.at b/tests/startup.at
index 22ad25b..b65f9f6 100644
--- a/tests/startup.at
+++ b/tests/startup.at
@@ -41,3 +41,3 @@ component test {
41 action disable; 41 action disable;
42 exec "piesctl --url unix:///$PWD/pies.ctl shutdown"; 42 exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
43 } 43 }
@@ -49,3 +49,3 @@ to 5 \
49 pies --foreground --stderr \ 49 pies --foreground --stderr \
50 --config-file control.conf --config-file pies.conf 2>errlog 50 --config-file control.conf --config-file pies.conf --debug 1 2>errlog
51 51

Return to:

Send suggestions and report system problems to the System administrator.