diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-06-02 13:43:21 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-06-02 13:49:55 +0300 |
commit | 8004bbaa1b31b14dd4c4d3886b5f57b103bf7405 (patch) | |
tree | a6fd826c284fe1e7131c4852c2964b6029ca758d /tests | |
parent | 685600d72b0c300f94c0c69dc0a16c4ebb230a21 (diff) | |
download | pies-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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/env.at | 4 | ||||
-rw-r--r-- | tests/respawn.at | 2 | ||||
-rw-r--r-- | tests/shell.at | 2 | ||||
-rw-r--r-- | tests/shutdown.at | 4 | ||||
-rw-r--r-- | tests/startup.at | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/tests/env.at b/tests/env.at index c293c65..18b0e52 100644 --- a/tests/env.at +++ b/tests/env.at | |||
@@ -12,18 +12,18 @@ component envtest { | |||
12 | } | 12 | } |
13 | command "$abs_builddir/envtest -clone"; | 13 | command "$abs_builddir/envtest -clone"; |
14 | chdir $PWD; | 14 | chdir $PWD; |
15 | stdout file "$PWD/log"; | 15 | stdout file "$PWD/log"; |
16 | return-code 0 { | 16 | return-code 0 { |
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 | } |
20 | } | 20 | } |
21 | _EOT | 21 | _EOT |
22 | 22 | ||
23 | to 3 \ | 23 | to 5 \ |
24 | envtest -exec \ | 24 | envtest -exec \ |
25 | $abs_top_builddir/src/pies --foreground --stderr \ | 25 | $abs_top_builddir/src/pies --foreground --stderr \ |
26 | --config-file control.conf --config-file envtest.conf 2>errlog | 26 | --config-file control.conf --config-file envtest.conf 2>errlog |
27 | cat log | 27 | cat log |
28 | ], | 28 | ], |
29 | [0], | 29 | [0], |
diff --git a/tests/respawn.at b/tests/respawn.at index 0ba60dc..ab29f11 100644 --- a/tests/respawn.at +++ b/tests/respawn.at | |||
@@ -24,13 +24,13 @@ cat > pies.conf <<_EOT | |||
24 | component test { | 24 | component test { |
25 | mode respawn; | 25 | mode respawn; |
26 | command "$auxdir/respawn $statefile 3"; | 26 | command "$auxdir/respawn $statefile 3"; |
27 | chdir $PWD; | 27 | chdir $PWD; |
28 | return-code 1 { | 28 | return-code 1 { |
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 | } |
32 | } | 32 | } |
33 | _EOT | 33 | _EOT |
34 | 34 | ||
35 | to 5 \ | 35 | to 5 \ |
36 | pies --foreground --stderr \ | 36 | pies --foreground --stderr \ |
diff --git a/tests/shell.at b/tests/shell.at index e3d104b..b459d02 100644 --- a/tests/shell.at +++ b/tests/shell.at | |||
@@ -26,13 +26,13 @@ component test { | |||
26 | mode respawn; | 26 | mode respawn; |
27 | flags shell; | 27 | flags shell; |
28 | command "if $auxdir/respawn $statefile 3; then echo pass; else exit 1; fi >> $outfile"; | 28 | command "if $auxdir/respawn $statefile 3; then echo pass; else exit 1; fi >> $outfile"; |
29 | chdir $PWD; | 29 | chdir $PWD; |
30 | return-code 1 { | 30 | return-code 1 { |
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 | } |
34 | } | 34 | } |
35 | _EOT | 35 | _EOT |
36 | 36 | ||
37 | set -e | 37 | set -e |
38 | to 5 \ | 38 | to 5 \ |
diff --git a/tests/shutdown.at b/tests/shutdown.at index 1c2a4ef..24a4504 100644 --- a/tests/shutdown.at +++ b/tests/shutdown.at | |||
@@ -26,26 +26,26 @@ cat > pies.conf <<_EOT | |||
26 | component test { | 26 | component test { |
27 | mode respawn; | 27 | mode respawn; |
28 | command "$auxdir/respawn $statefile 3"; | 28 | command "$auxdir/respawn $statefile 3"; |
29 | chdir $PWD; | 29 | chdir $PWD; |
30 | return-code 1 { | 30 | return-code 1 { |
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 | } |
34 | } | 34 | } |
35 | 35 | ||
36 | component s { | 36 | component s { |
37 | mode shutdown; | 37 | mode shutdown; |
38 | command "$auxdir/touchfile shutdown"; | 38 | command "$auxdir/touchfile shutdown"; |
39 | } | 39 | } |
40 | _EOT | 40 | _EOT |
41 | 41 | ||
42 | set -e | 42 | set -e |
43 | to 5 \ | 43 | 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 | ||
47 | cat shutdown | 47 | cat shutdown |
48 | ], | 48 | ], |
49 | [0], | 49 | [0], |
50 | [shutdown | 50 | [shutdown |
51 | ]) | 51 | ]) |
diff --git a/tests/startup.at b/tests/startup.at index 22ad25b..b65f9f6 100644 --- a/tests/startup.at +++ b/tests/startup.at | |||
@@ -36,21 +36,21 @@ component test { | |||
36 | command "$auxdir/startcheck b1 b2"; | 36 | command "$auxdir/startcheck b1 b2"; |
37 | chdir $PWD; | 37 | chdir $PWD; |
38 | stdout file "log.out"; | 38 | stdout file "log.out"; |
39 | stderr file "log.err"; | 39 | stderr file "log.err"; |
40 | return-code * { | 40 | return-code * { |
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 | } |
44 | } | 44 | } |
45 | _EOT | 45 | _EOT |
46 | 46 | ||
47 | set -e | 47 | set -e |
48 | to 5 \ | 48 | 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 | ||
52 | cat log.out | 52 | cat log.out |
53 | cat log.err >&2 | 53 | cat log.err >&2 |
54 | ], | 54 | ], |
55 | [0], | 55 | [0], |
56 | [# b1 | 56 | [# b1 |