summaryrefslogtreecommitdiffabout
path: root/tests
Side-by-side diff
Diffstat (limited to 'tests') (more/less context) (show whitespace changes)
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/accept.at4
-rw-r--r--tests/atlocal.in2
-rw-r--r--tests/builtin.at4
-rw-r--r--tests/chargen.c2
-rw-r--r--tests/control.at4
-rw-r--r--tests/cyclic.at37
-rw-r--r--tests/env.at4
-rw-r--r--tests/envglobal.at86
-rw-r--r--tests/envop.at4
-rw-r--r--tests/envtest.c2
-rw-r--r--tests/expandenv.at50
-rw-r--r--tests/inet.at4
-rw-r--r--tests/iobuf.h2
-rw-r--r--tests/lines.c2
-rw-r--r--tests/maxinst.at4
-rw-r--r--tests/nt.c2
-rw-r--r--tests/passfd.at4
-rw-r--r--tests/readtime.c2
-rw-r--r--tests/recvfd.c2
-rw-r--r--tests/redirect.at4
-rw-r--r--tests/respawn.at4
-rw-r--r--tests/ret-exec.at4
-rw-r--r--tests/ret-notify.at4
-rw-r--r--tests/shell.at4
-rw-r--r--tests/shutdown.at4
-rw-r--r--tests/startup.at4
-rw-r--r--tests/testsuite.at6
-rw-r--r--tests/to.c2
-rw-r--r--tests/version.at4
30 files changed, 217 insertions, 48 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bfdc692..25719bf 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,5 +1,5 @@
# This file is part of GNU Pies.
-# Copyright (C) 2008-2020 Sergey Poznyakoff
+# Copyright (C) 2008-2021 Sergey Poznyakoff
#
# GNU Pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -54,7 +54,9 @@ TESTSUITE_AT = \
control.at\
cyclic.at\
env.at\
+ envglobal.at\
envop.at\
+ expandenv.at\
inet.at\
maxinst.at\
passfd.at\
diff --git a/tests/accept.at b/tests/accept.at
index e12be02..ae2af92 100644
--- a/tests/accept.at
+++ b/tests/accept.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2019-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2019-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/atlocal.in b/tests/atlocal.in
index c043843..f18034c 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -1,6 +1,6 @@
# @configure_input@ -*- shell-script -*-
# Configurable variable values for GNU Pies test suite.
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# Copyright (C) 2016-2021 Sergey Poznyakoff
PATH=@abs_builddir@:@abs_top_builddir@/src:$srcdir:$PATH
XFAILFILE=$abs_builddir/.badversion
diff --git a/tests/builtin.at b/tests/builtin.at
index 88e24d7..cfda075 100644
--- a/tests/builtin.at
+++ b/tests/builtin.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/chargen.c b/tests/chargen.c
index 59aa0d8..19f99da 100644
--- a/tests/chargen.c
+++ b/tests/chargen.c
@@ -1,5 +1,5 @@
/* This file is part of GNU Pies testsuite.
- Copyright (C) 2019-2020 Sergey Poznyakoff
+ Copyright (C) 2019-2021 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/tests/control.at b/tests/control.at
index 5171862..f85e735 100644
--- a/tests/control.at
+++ b/tests/control.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/cyclic.at b/tests/cyclic.at
index 7c24acf..2d580a0 100644
--- a/tests/cyclic.at
+++ b/tests/cyclic.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2019-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2019-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,6 +15,7 @@
# along with GNU pies. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP([Detecting cyclic dependencies])
+
AT_CHECK([
PIES_XFAIL_CHECK
# The following matrices describe the test.conf configuration file below.
@@ -105,10 +106,38 @@ Legend:
1: g
2: h
],
-[pies: component a depends on itself
+[pies: cyclic dependencies detected:
pies: a -> d -> c -> e -> a
-pies: component b depends on itself
pies: b -> b
])
+AT_CHECK([
+AT_DATA([test.conf],[
+component a {
+ command "a";
+ prerequisites (b,c);
+}
+component b {
+ command "b";
+ prerequisites (c);
+}
+component c {
+ command "c";
+ prerequisites (d);
+}
+component d {
+ command "d";
+ prerequisites (a);
+}
+])
+pies --config-file test.conf --dump-depmap | trimws
+],
+[0],
+[No components defined
+],
+[pies: cyclic dependencies detected:
+pies: a -> c -> d -> a
+pies: a -> b -> c -> d -> a
+])
+
AT_CLEANUP
diff --git a/tests/env.at b/tests/env.at
index dba80a3..88412fd 100644
--- a/tests/env.at
+++ b/tests/env.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2020-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/envglobal.at b/tests/envglobal.at
new file mode 100644
index 0000000..357649b
--- a/dev/null
+++ b/tests/envglobal.at
@@ -0,0 +1,86 @@
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2020-2021 Sergey Poznyakoff
+#
+# GNU pies is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU pies is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU pies. If not, see <http://www.gnu.org/licenses/>.
+dnl ENVTEST(NAME,KW,ENV,OUT)
+m4_pushdef([ENVTEST],
+[AT_SETUP([$1])
+AT_KEYWORDS([env $2])
+AT_CHECK([
+PIES_XFAIL_CHECK
+PIES_CONTROL_INIT
+cat > envtest.conf <<_EOT
+env {
+ $3
+}
+component envtest {
+ 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])
+
+dnl #############################
+dnl Start tests
+dnl #############################
+
+AT_BANNER([Global environment statement])
+
+ENVTEST([clear],[clear],[clear;],[])
+
+ENVTEST([keep],[keep],[keep "LC_*";],
+[LC_ALL="C"
+LC_CTYPE="C"
+LC_MESSAGES="C"
+LC_NUMERIC="C"
+])
+
+ENVTEST([set],[set],[set "FOO=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],[unset "LC_*"; unset PWD;],
+[HOME="/home/user"
+LOGIN="user"
+PATH="/usr/local/bin:/usr/bin:/bin"
+PIES_INSTANCE="pies"
+USER="user"
+])
+
+m4_popdef([ENVTEST])
+
diff --git a/tests/envop.at b/tests/envop.at
index 5575772..3cdd43e 100644
--- a/tests/envop.at
+++ b/tests/envop.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2020-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/envtest.c b/tests/envtest.c
index 45d69a2..7c65f2a 100644
--- a/tests/envtest.c
+++ b/tests/envtest.c
@@ -1,5 +1,5 @@
/* Environment test program for GNU Pies.
- Copyright (C) 2019-2020 Sergey Poznyakoff
+ Copyright (C) 2019-2021 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/tests/expandenv.at b/tests/expandenv.at
new file mode 100644
index 0000000..70c6a26
--- a/dev/null
+++ b/tests/expandenv.at
@@ -0,0 +1,50 @@
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
+#
+# GNU pies is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU pies is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU pies. If not, see <http://www.gnu.org/licenses/>.
+
+AT_SETUP([flags expandenv])
+
+AT_CHECK([
+PIES_XFAIL_CHECK
+PIES_CONTROL_INIT
+statefile=$PWD/state
+cat > pies.conf <<EOT
+component test {
+ mode respawn;
+ flags expandenv;
+ command "\$auxdir/respawn \$statefile 3";
+ chdir "$PWD";
+ return-code 1 {
+ action disable;
+ exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
+ }
+}
+EOT
+
+export auxdir
+export statefile
+
+set -e
+to 5 \
+ pies --foreground --stderr \
+ --config-file control.conf --config-file pies.conf --debug 4 2>errlog
+
+cat state
+],
+[0],
+[3
+])
+
+AT_CLEANUP
diff --git a/tests/inet.at b/tests/inet.at
index cc4fceb..c40ee59 100644
--- a/tests/inet.at
+++ b/tests/inet.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/iobuf.h b/tests/iobuf.h
index df5f3ba..823c034 100644
--- a/tests/iobuf.h
+++ b/tests/iobuf.h
@@ -1,5 +1,5 @@
/* This file is part of GNU Pies.
- Copyright (C) 2019-2020 Sergey Poznyakoff
+ Copyright (C) 2019-2021 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/tests/lines.c b/tests/lines.c
index 0ad9d13..f667ed4 100644
--- a/tests/lines.c
+++ b/tests/lines.c
@@ -1,5 +1,5 @@
/* This file is part of GNU Pies testsuite.
- Copyright (C) 2019-2020 Sergey Poznyakoff
+ Copyright (C) 2019-2021 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/tests/maxinst.at b/tests/maxinst.at
index f389e0b..23f3ea7 100644
--- a/tests/maxinst.at
+++ b/tests/maxinst.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2019-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2019-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/nt.c b/tests/nt.c
index 258970f..74ab6ba 100644
--- a/tests/nt.c
+++ b/tests/nt.c
@@ -1,5 +1,5 @@
/* This file is part of GNU Pies testsuite.
- Copyright (C) 2019-2020 Sergey Poznyakoff
+ Copyright (C) 2019-2021 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/tests/passfd.at b/tests/passfd.at
index 74d5ab3..3a829f1 100644
--- a/tests/passfd.at
+++ b/tests/passfd.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/readtime.c b/tests/readtime.c
index ed3f2f8..b6142f3 100644
--- a/tests/readtime.c
+++ b/tests/readtime.c
@@ -1,5 +1,5 @@
/* This file is part of GNU Pies testsuite.
- Copyright (C) 2019-2020 Sergey Poznyakoff
+ Copyright (C) 2019-2021 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/tests/recvfd.c b/tests/recvfd.c
index 8e0ec79..0bc8335 100644
--- a/tests/recvfd.c
+++ b/tests/recvfd.c
@@ -1,5 +1,5 @@
/* This file is part of GNU Pies testsuite.
- Copyright (C) 2019-2020 Sergey Poznyakoff
+ Copyright (C) 2019-2021 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/tests/redirect.at b/tests/redirect.at
index 5cc5548..04bb724 100644
--- a/tests/redirect.at
+++ b/tests/redirect.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/respawn.at b/tests/respawn.at
index 68da448..7698d92 100644
--- a/tests/respawn.at
+++ b/tests/respawn.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/ret-exec.at b/tests/ret-exec.at
index 8f6152e..c875a36 100644
--- a/tests/ret-exec.at
+++ b/tests/ret-exec.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/ret-notify.at b/tests/ret-notify.at
index 29ff677..9be2dd4 100644
--- a/tests/ret-notify.at
+++ b/tests/ret-notify.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/shell.at b/tests/shell.at
index 8375e22..15017a6 100644
--- a/tests/shell.at
+++ b/tests/shell.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/shutdown.at b/tests/shutdown.at
index d89f6f9..3c79192 100644
--- a/tests/shutdown.at
+++ b/tests/shutdown.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2019-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2019-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/startup.at b/tests/startup.at
index 5a6b19a..b0a6c28 100644
--- a/tests/startup.at
+++ b/tests/startup.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2019-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2019-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/testsuite.at b/tests/testsuite.at
index eab643d..731c4c3 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -69,6 +69,7 @@ m4_include([ret-notify.at])
m4_include([startup.at])
m4_include([shutdown.at])
m4_include([shell.at])
+m4_include([expandenv.at])
m4_include([inet.at])
m4_include([maxinst.at])
m4_include([builtin.at])
@@ -77,3 +78,4 @@ m4_include([accept.at])
m4_include([envop.at])
m4_include([env.at]) \ No newline at end of file
+m4_include([envglobal.at])
diff --git a/tests/to.c b/tests/to.c
index 2e87133..b89db5e 100644
--- a/tests/to.c
+++ b/tests/to.c
@@ -1,5 +1,5 @@
/* This file is part of GNU Pies testsuite.
- Copyright (C) 2019-2020 Sergey Poznyakoff
+ Copyright (C) 2019-2021 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/tests/version.at b/tests/version.at
index c92cbaa..b0856c5 100644
--- a/tests/version.at
+++ b/tests/version.at
@@ -1,5 +1,5 @@
-# This file is part of GNU pies testsuite. -*- Autotest -*-
-# Copyright (C) 2016-2020 Sergey Poznyakoff
+# This file is part of GNU pies testsuite. -*- autotest -*-
+# Copyright (C) 2016-2021 Sergey Poznyakoff
#
# GNU pies is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

Return to:

Send suggestions and report system problems to the System administrator.