diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-06-03 13:17:13 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-06-03 13:41:34 +0300 |
commit | f50a208f9df348cede2ba50b4f435351d8d3f19e (patch) | |
tree | c596fdf237b17713ab56c0269cdb1d339e306941 /tests/env.at | |
parent | 8004bbaa1b31b14dd4c4d3886b5f57b103bf7405 (diff) | |
download | pies-f50a208f9df348cede2ba50b4f435351d8d3f19e.tar.gz pies-f50a208f9df348cede2ba50b4f435351d8d3f19e.tar.bz2 |
Finish the env re-implementation
* NEWS: Document the "env" statement and the PIES_MASTER_PID
environment variable.
Version 1.3.91
* configure.ac: Version 1.3.91
* doc/pies.texi: Document the new "env" statement syntax. Provide
instructions on how to convert legacy "env" statement to the new
form.
* lib/envop.c (environ_unset): Take reference value as argument.
If supplied, unset the variable only if its value matches the
reference one.
* lib/envop.h (environ_unset): Change proto.
* src/pies.c (parse_legacy_env): Minor changes.
(_cb_env_unset): Allow to specify value.
* src/progman.c (run_command): Define PIES_MASTER_PID.
* tests/env.at: Check the legacy env syntax.
* tests/envop.at: Additional checks.
Diffstat (limited to 'tests/env.at')
-rw-r--r-- | tests/env.at | 72 |
1 files changed, 70 insertions, 2 deletions
diff --git a/tests/env.at b/tests/env.at index 18b0e52..430bf10 100644 --- a/tests/env.at +++ b/tests/env.at | |||
@@ -15,7 +15,7 @@ component envtest { | |||
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 --no-netrc shutdown"; | 18 | exec "$abs_top_builddir/src/piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; |
19 | } | 19 | } |
20 | } | 20 | } |
21 | _EOT | 21 | _EOT |
@@ -23,7 +23,7 @@ _EOT | |||
23 | to 5 \ | 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 --debug 1 2>errlog |
27 | cat log | 27 | cat log |
28 | ], | 28 | ], |
29 | [0], | 29 | [0], |
@@ -68,3 +68,71 @@ USER="user" | |||
68 | ]) | 68 | ]) |
69 | 69 | ||
70 | m4_popdef([ENVTEST]) | 70 | m4_popdef([ENVTEST]) |
71 | |||
72 | # ############################## | ||
73 | # Legacy syntax | ||
74 | # ############################## | ||
75 | |||
76 | AT_BANNER([env: legacy syntax]) | ||
77 | |||
78 | m4_pushdef([ENVTEST], | ||
79 | [AT_SETUP([$1]) | ||
80 | AT_KEYWORDS([env $2]) | ||
81 | AT_CHECK([ | ||
82 | PIES_XFAIL_CHECK | ||
83 | PIES_CONTROL_INIT | ||
84 | cat > envtest.conf <<_EOT | ||
85 | component envtest { | ||
86 | env $3; | ||
87 | command "$abs_builddir/envtest -clone"; | ||
88 | chdir $PWD; | ||
89 | stdout file "$PWD/log"; | ||
90 | return-code 0 { | ||
91 | action disable; | ||
92 | exec "$abs_top_builddir/src/piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; | ||
93 | } | ||
94 | } | ||
95 | _EOT | ||
96 | |||
97 | to 5 \ | ||
98 | envtest -exec \ | ||
99 | $abs_top_builddir/src/pies --foreground --stderr \ | ||
100 | --config-file control.conf --config-file envtest.conf --debug 1 2>errlog | ||
101 | cat log | ||
102 | ], | ||
103 | [0], | ||
104 | [$4]) | ||
105 | AT_CLEANUP]) | ||
106 | |||
107 | ENVTEST([clear],[clear],[-],[]) | ||
108 | ENVTEST([keep],[keep],[- USER LOGIN], | ||
109 | [LOGIN="user" | ||
110 | USER="user" | ||
111 | ]) | ||
112 | |||
113 | ENVTEST([set],[set],["FOO=bar" "BAR=bar"], | ||
114 | [BAR="bar" | ||
115 | FOO="bar" | ||
116 | HOME="/home/user" | ||
117 | LC_ALL="C" | ||
118 | LC_CTYPE="C" | ||
119 | LC_MESSAGES="C" | ||
120 | LC_NUMERIC="C" | ||
121 | LOGIN="user" | ||
122 | PATH="/usr/local/bin:/usr/bin:/bin" | ||
123 | PIES_INSTANCE="pies" | ||
124 | PWD="/home" | ||
125 | USER="user" | ||
126 | ]) | ||
127 | |||
128 | ENVTEST([unset],[unset],["-LC_NUMERIC" "-LC_CTYPE" "-LC_MESSAGES"], | ||
129 | [HOME="/home/user" | ||
130 | LC_ALL="C" | ||
131 | LOGIN="user" | ||
132 | PATH="/usr/local/bin:/usr/bin:/bin" | ||
133 | PIES_INSTANCE="pies" | ||
134 | PWD="/home" | ||
135 | USER="user" | ||
136 | ]) | ||
137 | |||
138 | |||