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 @@ -12,21 +12,21 @@ component envtest { } command "$abs_builddir/envtest -clone"; chdir $PWD; stdout file "$PWD/log"; return-code 0 { action disable; - exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; + exec "$abs_top_builddir/src/piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; } } _EOT to 5 \ envtest -exec \ $abs_top_builddir/src/pies --foreground --stderr \ - --config-file control.conf --config-file envtest.conf 2>errlog + --config-file control.conf --config-file envtest.conf --debug 1 2>errlog cat log ], [0], [$4]) AT_CLEANUP]) @@ -65,6 +65,74 @@ LOGIN="user" PATH="/usr/local/bin:/usr/bin:/bin" PIES_INSTANCE="pies" USER="user" ]) m4_popdef([ENVTEST]) + +# ############################## +# Legacy syntax +# ############################## + +AT_BANNER([env: legacy syntax]) + +m4_pushdef([ENVTEST], +[AT_SETUP([$1]) +AT_KEYWORDS([env $2]) +AT_CHECK([ +PIES_XFAIL_CHECK +PIES_CONTROL_INIT +cat > envtest.conf <<_EOT +component envtest { + env $3; + command "$abs_builddir/envtest -clone"; + chdir $PWD; + stdout file "$PWD/log"; + return-code 0 { + action disable; + exec "$abs_top_builddir/src/piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; + } +} +_EOT + +to 5 \ + envtest -exec \ + $abs_top_builddir/src/pies --foreground --stderr \ + --config-file control.conf --config-file envtest.conf --debug 1 2>errlog +cat log +], +[0], +[$4]) +AT_CLEANUP]) + +ENVTEST([clear],[clear],[-],[]) +ENVTEST([keep],[keep],[- USER LOGIN], +[LOGIN="user" +USER="user" +]) + +ENVTEST([set],[set],["FOO=bar" "BAR=bar"], +[BAR="bar" +FOO="bar" +HOME="/home/user" +LC_ALL="C" +LC_CTYPE="C" +LC_MESSAGES="C" +LC_NUMERIC="C" +LOGIN="user" +PATH="/usr/local/bin:/usr/bin:/bin" +PIES_INSTANCE="pies" +PWD="/home" +USER="user" +]) + +ENVTEST([unset],[unset],["-LC_NUMERIC" "-LC_CTYPE" "-LC_MESSAGES"], +[HOME="/home/user" +LC_ALL="C" +LOGIN="user" +PATH="/usr/local/bin:/usr/bin:/bin" +PIES_INSTANCE="pies" +PWD="/home" +USER="user" +]) + + |