Hello community,
here is the log from the commit of package cfengine for openSUSE:Factory checked in at 2014-06-25 21:20:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cfengine (Old)
and /work/SRC/openSUSE:Factory/.cfengine.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cfengine"
Changes:
--------
--- /work/SRC/openSUSE:Factory/cfengine/cfengine.changes 2014-06-01 19:41:26.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.cfengine.new/cfengine.changes 2014-06-25 21:20:44.000000000 +0200
@@ -1,0 +2,8 @@
+Wed Jun 18 13:36:37 UTC 2014 - kkaempf@suse.com
+
+- Upgrade to 3.6.0 final
+ Bugfixes
+
+- remove drop-revision.patch, included upstream
+
+-------------------------------------------------------------------
Old:
----
core-3.6rc2-build1.tar.gz
drop-revision.patch
New:
----
core-3.6.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cfengine.spec ++++++
--- /var/tmp/diff_new_pack.0Js2vW/_old 2014-06-25 21:20:46.000000000 +0200
+++ /var/tmp/diff_new_pack.0Js2vW/_new 2014-06-25 21:20:46.000000000 +0200
@@ -17,7 +17,7 @@
Name: cfengine
-%define srcname core-3.6rc2-build1
+%define srcname core-3.6.0
%define libname libpromises
%define libsoname %{libname}3
@@ -32,7 +32,7 @@
Summary: CFEngine automates large-scale IT computing infrastructure
License: GPL-3.0
Group: Productivity/Networking/System
-Version: 3.6.0rc2
+Version: 3.6.0
Release: 0
Url: http://www.cfengine.org/
Source: %{srcname}.tar.gz
@@ -66,10 +66,6 @@
# SLE 11 or RHEL5 autoconf does not support AM_SUBST_NOTMAKE, kkaempf@suse.de
Patch2: remove-am_subst_notmake.patch
-# drop revision from configure.ac, autotools will evaluate it as 'unkwown'
-# kkaempf@suse.de
-Patch3: drop-revision.patch
-
# PATCH-FIX-UPSTREAM add 'suse' class for consistency with other vendor classes
# PATCH-FEATURE-UPSTREAM better /etc/SuSE-release parsing, upstream #5423
# kkaempf@suse.de
@@ -190,7 +186,6 @@
%if 0%{?rhel_version} >= 500 && 0%{?rhel_version} < 600
%patch2 -p1
%endif
-%patch3 -p1
%patch5 -p1
%patch6 -p1
++++++ core-3.6rc2-build1.tar.gz -> core-3.6.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/ChangeLog new/core-3.6.0/ChangeLog
--- old/core-3.6rc2-build1/ChangeLog 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/ChangeLog 2014-06-12 15:06:46.000000000 +0200
@@ -1,4 +1,4 @@
-3.6 Release Candidate
+3.6.0
Changes:
- Changes to logging output
@@ -29,14 +29,19 @@
- including the same file multiple times in 'body control inputs' is not an error
- portnumber in body copy_from now supports service names like
"cfengine", "pop3" etc, check /etc/services for more.
- - The failsafe.cf policy, run on bootstrap and in some other
- unusual cases, has been extracted from C code into libpromises/failsafe.cf
+ - The failsafe.cf policy, run on bootstrap and in some other
+ unusual cases, has been extracted from C code into libpromises/failsafe.cf
- masterfiles
- cf_promises_validated is now in JSON format
- timestamp key is timestamp (sec since unix epoch) of last time validated
- the masterfiles now come from https://github.com/cfengine/masterfiles and are
not in the core repository
- cf-serverd calls cf-agent with -Dcfruncommand when executing cf-runagent requests
+ - Mark as removed: promise_notkept_log_include, promise_notkept_log_exclude, promise_repaired_log_include,
+ promise_repaired_log_exclude, classes_include, classes_exclude, variables_include,
+ variables_exclude attributes from report_data_select body (syntax is valid but not functional).
+ They have been replaced by the following attributes: promise_handle_include,
+ promise_handle_exclude, metatags_include, metatags_exclude.
New features:
- New promise type "users" for managing local user accounts.
@@ -94,7 +99,7 @@
"deny_keys".
- New "shortcut" attribute in bundle server access_rules used to
dynamically expand non-absolute request paths.
- - masterfiles
+ - masterfiles
- standard library split: lib/3.5 (compatibility) and lib/3.6 (mainline)
- many standard library bundles and bodies, especially packages- and file-related,
were revised and fixed
@@ -104,15 +109,15 @@
- cf_promises_release_id contains the policy release ID which is the GIT HEAD SHA
if available or hash of tree
- a bunch'o'bundles to make starting with CFEngine easier:
- - file-related: file_mustache, file_mustache_jsonstring, file_tidy, dir_sync, file_copy,
+ - file-related: file_mustache, file_mustache_jsonstring, file_tidy, dir_sync, file_copy,
file_link, file_hardlink, file_empty, file_make
- - packages-related: package_absent, package_present, package_latest,
+ - packages-related: package_absent, package_present, package_latest,
package_specific_present, package_specific_absent, package_specific_latest, package_specific
- - XML-related: xml_insert_tree_nopath, xml_insert_tree, xml_set_value, xml_set_attribute
- - VCS-related: git_init, git_add, git_checkout, git_checkout_new_branch,
+ - XML-related: xml_insert_tree_nopath, xml_insert_tree, xml_set_value, xml_set_attribute
+ - VCS-related: git_init, git_add, git_checkout, git_checkout_new_branch,
git_clean, git_stash, git_stash_and_clean, git_commit, git
- - process-related: process_kill
- - other: cmerge, url_ping, logrotate, prunedir
+ - process-related: process_kill
+ - other: cmerge, url_ping, logrotate, prunedir
- New command line options for agent binaries
- New options to cf-promises
- '--show-classes' and '--show-vars'
@@ -143,7 +148,7 @@
- 'getvariablemetatags' - returns list of meta tags for a variable
- 'body file control' has an 'inputs' attribute to include library files and other
dependencies
- - bundlesequences can be built with bundlesmatching() based on bundle name and tags
+ - bundlesequences can be built with bundlesmatching() based on bundle name and tags
- New attributes in existing promise types and bodies
- New option 'preserve_all_lines' for insert_type in insert_lines promises
- Caching of expensive system functions to avoid multiple executions of
@@ -200,19 +205,20 @@
Deprecations:
- 'splitstring' - deprecated by 'string_split'
- - 'track_value'
- - 'skipverify'
+ - 'track_value'
+ - 'skipverify'
Bug fixes: for a complete list of fixed bugs, see Redmine at https://cfengine.com/dev
- various fixes in evaluation and variable resolution
- Improve performance of list iteration (Redmine #1875)
- Removed limitation of input length to internal buffer sizes
- - directories ending with "/" are not ignored
- - lsdir() always return a list now, never a scalar
+ - directories ending with "/" are not ignored
+ - lsdir() always return a list now, never a scalar
- 'abortclasses' fixed to work in common bundles and other cases
- namespaced 'edit_line' bundles now work (Redmine#3781)
- lists are interpolated in correct order (Redmine#3122)
- cf-serverd reloads policies properly when they change
+ - lots of leaks (memory and file descriptor) fixed
3.5.3
Changes:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/cf-agent/verify_exec.c new/core-3.6.0/cf-agent/verify_exec.c
--- old/core-3.6rc2-build1/cf-agent/verify_exec.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/cf-agent/verify_exec.c 2014-06-12 15:06:46.000000000 +0200
@@ -291,11 +291,12 @@
}
#endif /* !__MINGW32__ */
+ const char *open_mode = a.module ? "rt" : "r";
if (a.contain.shelltype == SHELL_TYPE_POWERSHELL)
{
#ifdef __MINGW32__
pfp =
- cf_popen_powershell_setuid(cmdline, "r", a.contain.owner, a.contain.group, a.contain.chdir, a.contain.chroot,
+ cf_popen_powershell_setuid(cmdline, open_mode, a.contain.owner, a.contain.group, a.contain.chdir, a.contain.chroot,
a.transaction.background);
#else // !__MINGW32__
Log(LOG_LEVEL_ERR, "Powershell is only supported on Windows");
@@ -305,13 +306,13 @@
else if (a.contain.shelltype == SHELL_TYPE_USE)
{
pfp =
- cf_popen_shsetuid(cmdline, "r", a.contain.owner, a.contain.group, a.contain.chdir, a.contain.chroot,
+ cf_popen_shsetuid(cmdline, open_mode, a.contain.owner, a.contain.group, a.contain.chdir, a.contain.chroot,
a.transaction.background);
}
else
{
pfp =
- cf_popensetuid(cmdline, "r", a.contain.owner, a.contain.group, a.contain.chdir, a.contain.chroot,
+ cf_popensetuid(cmdline, open_mode, a.contain.owner, a.contain.group, a.contain.chdir, a.contain.chroot,
a.transaction.background);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/cf-agent/verify_users.c new/core-3.6.0/cf-agent/verify_users.c
--- old/core-3.6rc2-build1/cf-agent/verify_users.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/cf-agent/verify_users.c 2014-06-12 15:06:46.000000000 +0200
@@ -60,7 +60,7 @@
switch (result) {
case PROMISE_RESULT_NOOP:
- cfPS(ctx, LOG_LEVEL_INFO, PROMISE_RESULT_NOOP, pp, a, "User promise kept");
+ cfPS(ctx, LOG_LEVEL_VERBOSE, PROMISE_RESULT_NOOP, pp, a, "User promise kept");
break;
case PROMISE_RESULT_FAIL:
case PROMISE_RESULT_DENIED:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/cf-key/cf-key-functions.c new/core-3.6.0/cf-key/cf-key-functions.c
--- old/core-3.6rc2-build1/cf-key/cf-key-functions.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/cf-key/cf-key-functions.c 2014-06-12 15:06:46.000000000 +0200
@@ -129,6 +129,8 @@
return (ok? 0 : 1);
}
+extern bool cf_key_interrupted;
+
bool ShowHost(const char *hostkey, const char *address, bool incoming,
const KeyHostSeen *quality, void *ctx)
{
@@ -144,7 +146,7 @@
address, (ret != -1) ? hostname : "-",
cf_strtimestamp_local(quality->lastseen, timebuf), hostkey);
- return true;
+ return !cf_key_interrupted;
}
void ShowLastSeenHosts()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/cf-key/cf-key.c new/core-3.6.0/cf-key/cf-key.c
--- old/core-3.6rc2-build1/cf-key/cf-key.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/cf-key/cf-key.c 2014-06-12 15:06:46.000000000 +0200
@@ -36,6 +36,7 @@
#include
#include
#include
+#include
#include
@@ -97,6 +98,26 @@
/*****************************************************************************/
+typedef void (*CfKeySigHandler)(int signum);
+bool cf_key_interrupted = false;
+
+static void handleShowKeysSignal(int signum)
+{
+ cf_key_interrupted = true;
+
+ signal(signum, handleShowKeysSignal);
+}
+
+static void ThisAgentInit(CfKeySigHandler sighandler)
+{
+ signal(SIGINT, sighandler);
+ signal(SIGTERM, sighandler);
+ signal(SIGHUP, SIG_IGN);
+ signal(SIGPIPE, SIG_IGN);
+ signal(SIGUSR1, HandleSignalsForAgent);
+ signal(SIGUSR2, HandleSignalsForAgent);
+}
+
int main(int argc, char *argv[])
{
GenericAgentConfig *config = CheckOpts(argc, argv);
@@ -107,6 +128,7 @@
if (SHOWHOSTS)
{
+ ThisAgentInit(handleShowKeysSignal);
ShowLastSeenHosts();
return 0;
}
@@ -116,6 +138,7 @@
return PrintDigest(print_digest_arg);
}
+ ThisAgentInit(HandleSignalsForAgent);
if (REMOVEKEYS)
{
int status;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/cf-serverd/tls_server.c new/core-3.6.0/cf-serverd/tls_server.c
--- old/core-3.6rc2-build1/cf-serverd/tls_server.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/cf-serverd/tls_server.c 2014-06-12 15:06:46.000000000 +0200
@@ -165,13 +165,13 @@
}
else if (got == 0)
{
- Log(LOG_LEVEL_NOTICE,
+ Log(LOG_LEVEL_INFO,
"Peer closed TCP connection without sending data!");
return -1;
}
else if (got < peek_size)
{
- Log(LOG_LEVEL_NOTICE,
+ Log(LOG_LEVEL_INFO,
"Peer sent only %lld bytes! Considering the protocol as Classic",
(long long)got);
ConnectionInfoSetProtocolVersion(conn_info, CF_PROTOCOL_CLASSIC);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/configure.ac new/core-3.6.0/configure.ac
--- old/core-3.6rc2-build1/configure.ac 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/configure.ac 2014-06-12 15:06:46.000000000 +0200
@@ -25,7 +25,7 @@
dnl
_AM_SET_OPTION([tar-ustar])
-AM_INIT_AUTOMAKE(cfengine, 3.6.0.revision)
+AM_INIT_AUTOMAKE(cfengine, 3.6.0)
AM_MAINTAINER_MODE([enable])
AC_DEFINE(BUILD_YEAR, esyscmd([date +%Y | tr -d '\n']), "Software build year")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/examples/container_key_iteration.cf new/core-3.6.0/examples/container_key_iteration.cf
--- old/core-3.6rc2-build1/examples/container_key_iteration.cf 1970-01-01 01:00:00.000000000 +0100
+++ new/core-3.6.0/examples/container_key_iteration.cf 2014-06-12 15:06:46.000000000 +0200
@@ -0,0 +1,73 @@
+# Copyright (C) Cfengine AS
+
+# This file is part of Cfengine 3 - written and maintained by Cfengine AS.
+
+# This program 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; version 3.
+
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+# To the extent this program is licensed as part of the Enterprise
+# versions of Cfengine, the applicable Commercial Open Source License
+# (COSL) may apply to this file if you as a licensee so wish it. See
+# included file COSL.txt.
+
+#+begin_src cfengine3
+body common control
+{
+ bundlesequence => { run };
+}
+
+bundle agent run
+{
+ vars:
+ "animals" data => parsejson('
+ {
+ "dog": { "legs": 4, "tail": true, "names": [ "Fido", "Cooper", "Sandy" ] },
+ "cat": { "legs": 4, "tail": true, "names": [ "Fluffy", "Snowball", "Tabby" ] },
+ "dolphin": { "legs": 0, "tail": true, "names": [ "Flipper", "Duffy" ] },
+ "hamster": { "legs": 4, "tail": true, "names": [ "Skullcrusher", "Kimmy", "Fluffadoo" ] },
+ }');
+
+ "keys_unsorted" slist => getindices("animals");
+ "keys" slist => sort(keys_unsorted, "lex");
+
+ "animals_$(keys)" data => mergedata("animals[$(keys)]");
+
+ methods:
+ # pass the container and a key inside it
+ "any" usebundle => analyze(@(animals), $(keys));
+}
+
+bundle agent analyze(animals, a)
+{
+ vars:
+ "names" slist => getvalues("animals[$(a)][names]");
+ "names_str" string => format("%S", names);
+
+ reports:
+ "$(this.bundle): possible names for animal '$(a)': $(names_str)";
+ "$(this.bundle): describe animal '$(a)' => name = $(a), legs = $(animals[$(a)][legs]), tail = $(animals[$(a)][tail])";
+}
+#+end_src
+###############################################################################
+#+begin_src example_output
+#@ ```
+#@ R: analyze: possible names for animal 'cat': { "Fluffy", "Snowball", "Tabby" }
+#@ R: analyze: describe animal 'cat' => name = cat, legs = 4, tail = true
+#@ R: analyze: possible names for animal 'dog': { "Fido", "Cooper", "Sandy" }
+#@ R: analyze: describe animal 'dog' => name = dog, legs = 4, tail = true
+#@ R: analyze: possible names for animal 'dolphin': { "Flipper", "Duffy" }
+#@ R: analyze: describe animal 'dolphin' => name = dolphin, legs = 0, tail = true
+#@ R: analyze: possible names for animal 'hamster': { "Skullcrusher", "Kimmy", "Fluffadoo" }
+#@ R: analyze: describe animal 'hamster' => name = hamster, legs = 4, tail = true
+#@ ```
+#+end_src
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/examples/readtcp.cf new/core-3.6.0/examples/readtcp.cf
--- old/core-3.6rc2-build1/examples/readtcp.cf 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/examples/readtcp.cf 2014-06-12 15:06:46.000000000 +0200
@@ -30,7 +30,7 @@
{
vars:
- "my80" string => readtcp("cfengine.com","80","GET /wp-includes/js/jquery/jquery.color.min.js HTTP/1.1$(const.r)$(const.n)Host: cfengine.com$(const.r)$(const.n)$(const.r)$(const.n)",20);
+ "my80" string => readtcp("myserver.com","80","GET /index.html HTTP/1.1$(const.r)$(const.n)Host: myserver.com$(const.r)$(const.n)$(const.r)$(const.n)",20);
classes:
@@ -47,9 +47,3 @@
"Server is not responding - got $(my80)";
}
#+end_src
-###############################################################################
-#+begin_src example_output
-#@ ```
-#@ R: Server is alive
-#@ ```
-#+end_src
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/examples/some.cf new/core-3.6.0/examples/some.cf
--- old/core-3.6rc2-build1/examples/some.cf 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/examples/some.cf 2014-06-12 15:06:46.000000000 +0200
@@ -29,12 +29,25 @@
bundle agent test
{
classes:
+
+ # This is an easy way to check if a list is empty, better than
+ # expression => strcmp(length(x), "0")
+
+ # Note that if you use length() or none() or every() they will
+ # go through all the elements!!! some() returns as soon as any
+ # element matches.
+ "empty_x" not => some(".*", x);
+ "empty_y" not => some(".*", y);
+
"some11" expression => some("long string", test1);
"some12" expression => some("none", test1);
"some21" expression => some("long string", test2);
"some22" expression => some("none", test2);
vars:
+ "x" slist => { "a", "b" };
+ "y" slist => { };
+
"test1" slist => {
1,2,3,
"one", "two", "three",
@@ -51,6 +64,12 @@
"one", "two", "three",]');
reports:
+ empty_x::
+ "x has no elements";
+ empty_y::
+ "y has no elements";
+
+ any::
"The test1 list is $(test1)";
some11::
"some() test1 1 passed";
@@ -76,6 +95,7 @@
###############################################################################
#+begin_src example_output
#@ ```
+#@ R: y has no elements
#@ R: The test1 list is 1
#@ R: The test1 list is 2
#@ R: The test1 list is 3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/libcfnet/net.c new/core-3.6.0/libcfnet/net.c
--- old/core-3.6rc2-build1/libcfnet/net.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/libcfnet/net.c 2014-06-12 15:06:46.000000000 +0200
@@ -330,7 +330,7 @@
if (ret == -1)
{
Log(LOG_LEVEL_ERR,
- "Could not set socket to non-blocking mode. (fcntl: %s)",
+ "Failed to set socket to non-blocking mode (fcntl: %s)",
GetErrorStr());
}
@@ -339,7 +339,7 @@
{
if (errno != EINPROGRESS)
{
- Log(LOG_LEVEL_INFO, "Error connecting to server. (connect: %s)",
+ Log(LOG_LEVEL_INFO, "Failed to connect to server (connect: %s)",
GetErrorStr());
return false;
}
@@ -372,9 +372,17 @@
}
if (ret == -1)
{
- Log(LOG_LEVEL_ERR,
- "Error while waiting for connection (select: %s)",
- GetErrorStr());
+ if (errno == EINTR)
+ {
+ Log(LOG_LEVEL_ERR,
+ "Socket connect was interrupted by signal");
+ }
+ else
+ {
+ Log(LOG_LEVEL_ERR,
+ "Failure while connecting (select: %s)",
+ GetErrorStr());
+ }
return false;
}
@@ -390,7 +398,7 @@
if (errcode != 0)
{
- Log(LOG_LEVEL_INFO, "Error connecting to server: %s",
+ Log(LOG_LEVEL_INFO, "Failed to connect to server: %s",
GetErrorStrFromCode(errcode));
return false;
}
@@ -401,7 +409,7 @@
if (ret == -1)
{
Log(LOG_LEVEL_ERR,
- "Could not set socket back to blocking mode (fcntl: %s)",
+ "Failed to set socket back to blocking mode (fcntl: %s)",
GetErrorStr());
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/libcfnet/tls_generic.c new/core-3.6.0/libcfnet/tls_generic.c
--- old/core-3.6rc2-build1/libcfnet/tls_generic.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/libcfnet/tls_generic.c 2014-06-12 15:06:46.000000000 +0200
@@ -536,10 +536,41 @@
* for SSL_read() and SSL_write(). */
const char *errstr2 = TLSSecondarySSLError(code);
- Log(level, "%s: (%d %s) %s %s",
- prepend, code, errstr1,
- (errstr2 == NULL) ? "" : errstr2, /* most likely empty */
- syserr);
+ /* We know the socket is always blocking. However our blocking sockets
+ * have a timeout set via means of setsockopt(SO_RCVTIMEO), so internally
+ * OpenSSL can still get the EWOULDBLOCK error code from recv(). In that
+ * case OpenSSL gives us SSL_ERROR_WANT_READ despite the socket being
+ * blocking. So we log a proper error message! */
+ if (errcode == SSL_ERROR_WANT_READ)
+ {
+ Log(level, "%s: receive timeout", prepend);
+ }
+ else if (errcode == SSL_ERROR_WANT_WRITE)
+ {
+ Log(level, "%s: send timeout", prepend);
+ }
+ else
+ {
+ Log(level, "%s: (%d %s) %s %s",
+ prepend, code, errstr1,
+ (errstr2 == NULL) ? "" : errstr2, /* most likely empty */
+ syserr);
+ }
+}
+
+static void assert_SSLIsBlocking(const SSL *ssl)
+{
+#ifndef NDEBUG
+ int fd = SSL_get_fd(ssl);
+ if (fd >= 0)
+ {
+ int flags = fcntl(fd, F_GETFL, 0);
+ if (flags != -1 && (flags & O_NONBLOCK) != 0)
+ {
+ ProgrammingError("OpenSSL socket is non-blocking!");
+ }
+ }
+#endif
}
/**
@@ -559,6 +590,7 @@
int TLSSend(SSL *ssl, const char *buffer, int length)
{
assert(length >= 0);
+ assert_SSLIsBlocking(ssl);
if (length == 0)
{
@@ -606,6 +638,7 @@
{
assert(length > 0);
assert(length < CF_BUFSIZE);
+ assert_SSLIsBlocking(ssl);
int received = SSL_read(ssl, buffer, length);
if (received < 0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/libpromises/dbm_lmdb.c new/core-3.6.0/libpromises/dbm_lmdb.c
--- old/core-3.6rc2-build1/libpromises/dbm_lmdb.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/libpromises/dbm_lmdb.c 2014-06-12 15:06:46.000000000 +0200
@@ -134,9 +134,16 @@
static void AbortTransaction(DBPriv *db)
{
DBTxn *db_txn = pthread_getspecific(db->txn_key);
- mdb_txn_abort(db_txn->txn);
- db_txn->txn = NULL;
- db_txn->rw_txn = false;
+ if (db_txn != NULL)
+ {
+ if (db_txn->txn != NULL)
+ {
+ mdb_txn_abort(db_txn->txn);
+ }
+
+ pthread_setspecific(db->txn_key, NULL);
+ free(db_txn);
+ }
}
static void DestroyTransaction(void *ptr)
@@ -258,10 +265,15 @@
void DBPrivCloseDB(DBPriv *db)
{
+ /* Abort LMDB transaction of the current thread. There should only be some
+ * transaction open when the signal handler or atexit() hook is called. */
+ AbortTransaction(db);
+
if (db->env)
{
mdb_env_close(db->env);
}
+
pthread_key_delete(db->txn_key);
free(db);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/libpromises/eval_context.c new/core-3.6.0/libpromises/eval_context.c
--- old/core-3.6rc2-build1/libpromises/eval_context.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/libpromises/eval_context.c 2014-06-12 15:06:46.000000000 +0200
@@ -1198,8 +1198,6 @@
LoggingPrivSetLevels(CalculateLogLevel(pexp), CalculateReportLevel(pexp));
- EvalContextVariablePutSpecial(ctx, SPECIAL_SCOPE_THIS, "promiser", pexp->promiser, CF_DATA_TYPE_STRING, "source=promise");
-
return pexp;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/libpromises/lastseen.c new/core-3.6.0/libpromises/lastseen.c
--- old/core-3.6rc2-build1/libpromises/lastseen.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/libpromises/lastseen.c 2014-06-12 15:06:46.000000000 +0200
@@ -482,29 +482,18 @@
/*****************************************************************************/
bool ScanLastSeenQuality(LastSeenQualityCallback callback, void *ctx)
{
- DBHandle *db;
- DBCursor *cursor;
-
- if (!OpenDB(&db, dbid_lastseen))
- {
- Log(LOG_LEVEL_ERR, "Unable to open lastseen database");
- return false;
- }
-
- if (!NewDBCursor(db, &cursor))
+ StringMap *lastseen_db = LoadDatabaseToStringMap(dbid_lastseen);
+ if (!lastseen_db)
{
- Log(LOG_LEVEL_ERR, "Unable to create lastseen database cursor");
- CloseDB(db);
return false;
}
+ MapIterator it = MapIteratorInit(lastseen_db->impl);
+ MapKeyValue *item;
- char *key;
- void *value;
- int ksize, vsize;
Seq *hostkeys = SeqNew(100, free);
-
- while (NextDB(cursor, &key, &ksize, &value, &vsize))
+ while ((item = MapIteratorNext(&it)) != NULL)
{
+ char *key = item->key;
/* Only look for "keyhost" entries */
if (key[0] != 'k')
{
@@ -513,17 +502,15 @@
SeqAppend(hostkeys, xstrdup(key + 1));
}
-
- DeleteDBCursor(cursor);
-
for (int i = 0; i < SeqLength(hostkeys); ++i)
{
const char *hostkey = SeqAt(hostkeys, i);
char keyhost_key[CF_BUFSIZE];
snprintf(keyhost_key, CF_BUFSIZE, "k%s", hostkey);
- char address[CF_BUFSIZE];
- if (!ReadDB(db, keyhost_key, &address, sizeof(address)))
+ char *address = NULL;
+ address = (char*)StringMapGet(lastseen_db, keyhost_key);
+ if (!address)
{
Log(LOG_LEVEL_ERR, "Failed to read address for key '%s'.", hostkey);
continue;
@@ -531,10 +518,11 @@
char incoming_key[CF_BUFSIZE];
snprintf(incoming_key, CF_BUFSIZE, "qi%s", hostkey);
- KeyHostSeen incoming;
- if (ReadDB(db, incoming_key, &incoming, sizeof(incoming)))
+ KeyHostSeen *incoming = NULL;
+ incoming = (KeyHostSeen*)StringMapGet(lastseen_db, incoming_key);
+ if (incoming)
{
- if (!(*callback)(hostkey, address, true, &incoming, ctx))
+ if (!(*callback)(hostkey, address, true, incoming, ctx))
{
break;
}
@@ -542,20 +530,20 @@
char outgoing_key[CF_BUFSIZE];
snprintf(outgoing_key, CF_BUFSIZE, "qo%s", hostkey);
- KeyHostSeen outgoing;
- if (ReadDB(db, outgoing_key, &outgoing, sizeof(outgoing)))
+ KeyHostSeen *outgoing = NULL;
+ outgoing = (KeyHostSeen*)StringMapGet(lastseen_db, outgoing_key);
+ if (outgoing)
{
- if (!(*callback)(hostkey, address, false, &outgoing, ctx))
+ if (!(*callback)(hostkey, address, false, outgoing, ctx))
{
break;
}
}
}
+ StringMapDestroy(lastseen_db);
SeqDestroy(hostkeys);
- CloseDB(db);
-
return true;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/libpromises/promises.c new/core-3.6.0/libpromises/promises.c
--- old/core-3.6rc2-build1/libpromises/promises.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/libpromises/promises.c 2014-06-12 15:06:46.000000000 +0200
@@ -284,6 +284,13 @@
Rval returnval = ExpandPrivateRval(ctx, NULL, "this", pp->promiser, RVAL_TYPE_SCALAR);
pcopy->promiser = RvalScalarValue(returnval);
+ if ((strcmp("files", pp->parent_promise_type->name) != 0) &&
+ (strcmp("storage", pp->parent_promise_type->name) != 0))
+ {
+ EvalContextVariablePutSpecial(ctx, SPECIAL_SCOPE_THIS, "promiser", pcopy->promiser,
+ CF_DATA_TYPE_STRING, "source=promise");
+ }
+
if (pp->promisee.item)
{
pcopy->promisee = EvaluateFinalRval(ctx, PromiseGetPolicy(pp), NULL, "this", pp->promisee, true, pp);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/01_vars/01_basic/staging/this_promises_in_command_args.cf new/core-3.6.0/tests/acceptance/01_vars/01_basic/staging/this_promises_in_command_args.cf
--- old/core-3.6rc2-build1/tests/acceptance/01_vars/01_basic/staging/this_promises_in_command_args.cf 1970-01-01 01:00:00.000000000 +0100
+++ new/core-3.6.0/tests/acceptance/01_vars/01_basic/staging/this_promises_in_command_args.cf 2014-06-12 15:06:46.000000000 +0200
@@ -0,0 +1,32 @@
+#######################################################
+#
+# Redmine#5959
+#
+#######################################################
+
+body common control
+{
+ inputs => { "../../default.cf.sub" };
+ bundlesequence => { default("$(this.promise_filename)") };
+ version => "1.0";
+}
+
+#######################################################
+
+bundle agent test
+{
+ commands:
+ # should expand to "touch testfile touch testfile.2"
+ "$(G.touch) $(G.testfile)"
+ args => "$(this.promiser).2";
+}
+
+#######################################################
+
+bundle agent check
+{
+ methods:
+ "" usebundle => dcs_passif_fileexists("$(G.testfile).2",
+ $(this.promise_filename));
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/001.cf new/core-3.6.0/tests/acceptance/08_commands/01_modules/001.cf
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/001.cf 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/001.cf 2014-06-12 15:06:46.000000000 +0200
@@ -6,7 +6,7 @@
body common control
{
- inputs => { "../../default.cf.sub" };
+ inputs => { "../../default.cf.sub", "../../plucked.cf.sub" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
@@ -16,46 +16,42 @@
bundle agent init
{
vars:
- "script_name" string => "$(this.promise_filename).script";
+ "script_name" string => "$(this.promise_filename).txt";
}
#######################################################
bundle agent test
{
- meta:
- "test_suppress_fail" string => "windows",
- meta => { "redmine1884" };
-
- classes:
- "matched" expression => regextract(".+/([^/]+)$",
- "${init.script_name}",
- "script_basename");
+ vars:
+ !windows::
+ "cat_prefix" string => "cat";
+ windows::
+ "cat_prefix" string => "cat_exe";
commands:
- "$(init.script_name)" module => "true";
+ "$(G.cat) $(init.script_name)"
+ contain => in_shell,
+ module => "true";
}
#######################################################
bundle agent check
{
- vars:
- "canonical_script_basename" string => canonify("${test.script_basename[1]}");
-
classes:
CLASSTOBEDEFINED.!UNDEFINEDCLASS::
"classok" expression => "any";
any::
- "varok" expression => strcmp("${${canonical_script_basename}.answer}", "42");
+ "varok" expression => strcmp("${$(test.cat_prefix).answer}", "42");
"ok" and => { "classok", "varok" };
reports:
DEBUG::
- "${${canonical_script_basename}.answer} =?= 42";
+ "${$(test.cat_prefix).answer} =?= 42";
ok::
"$(this.promise_filename) Pass";
!ok::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/001.cf.script new/core-3.6.0/tests/acceptance/08_commands/01_modules/001.cf.script
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/001.cf.script 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/001.cf.script 1970-01-01 01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-echo +CLASSTOBEDEFINED
-echo -UNDEFINEDCLASS
-echo =answer=42
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/001.cf.txt new/core-3.6.0/tests/acceptance/08_commands/01_modules/001.cf.txt
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/001.cf.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/001.cf.txt 2014-06-12 15:06:46.000000000 +0200
@@ -0,0 +1,3 @@
++CLASSTOBEDEFINED
+-UNDEFINEDCLASS
+=answer=42
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/002.cf new/core-3.6.0/tests/acceptance/08_commands/01_modules/002.cf
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/002.cf 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/002.cf 2014-06-12 15:06:46.000000000 +0200
@@ -6,7 +6,7 @@
body common control
{
- inputs => { "../../default.cf.sub" };
+ inputs => { "../../default.cf.sub", "../../plucked.cf.sub" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
@@ -15,24 +15,23 @@
bundle agent init
{
vars:
- "script_name" string => "$(this.promise_filename).script";
+ "script_name" string => "$(this.promise_filename).txt";
}
#######################################################
bundle agent test
{
- meta:
- "test_suppress_fail" string => "windows",
- meta => { "redmine1884" };
-
- classes:
- "matched" expression => regextract(".+/([^/]+)$",
- "${init.script_name}",
- "script_basename");
+ vars:
+ !windows::
+ "cat_prefix" string => "cat";
+ windows::
+ "cat_prefix" string => "cat_exe";
commands:
- "$(init.script_name)" module => "true";
+ "$(G.cat) $(init.script_name)"
+ contain => in_shell,
+ module => "true";
}
#######################################################
@@ -40,18 +39,16 @@
bundle agent check
{
vars:
- "canonical_script_basename" string => canonify("${test.script_basename[1]}");
-
- "generated_indices" slist => getindices("${canonical_script_basename}.answer");
+ "generated_indices" slist => getindices("$(test.cat_prefix).answer");
classes:
- "ok" and => { strcmp("${${canonical_script_basename}.answer[42]}", "Yes"),
- strcmp("${${canonical_script_basename}.answer[41]}", "No") };
+ "ok" and => { strcmp("${$(test.cat_prefix).answer[42]}", "Yes"),
+ strcmp("${$(test.cat_prefix).answer[41]}", "No") };
reports:
DEBUG::
- "${${canonical_script_basename}.answer[${generated_indices}]}";
+ "${$(test.cat_prefix).answer[${generated_indices}]}";
ok::
"$(this.promise_filename) Pass";
!ok::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/002.cf.script new/core-3.6.0/tests/acceptance/08_commands/01_modules/002.cf.script
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/002.cf.script 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/002.cf.script 1970-01-01 01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-echo =answer[42]=Yes
-echo =answer[41]=No
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/002.cf.txt new/core-3.6.0/tests/acceptance/08_commands/01_modules/002.cf.txt
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/002.cf.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/002.cf.txt 2014-06-12 15:06:46.000000000 +0200
@@ -0,0 +1,2 @@
+=answer[42]=Yes
+=answer[41]=No
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/003.cf new/core-3.6.0/tests/acceptance/08_commands/01_modules/003.cf
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/003.cf 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/003.cf 2014-06-12 15:06:46.000000000 +0200
@@ -6,7 +6,7 @@
body common control
{
- inputs => { "../../default.cf.sub" };
+ inputs => { "../../default.cf.sub", "../../plucked.cf.sub" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
@@ -16,39 +16,35 @@
bundle agent init
{
vars:
- "script_name" string => "$(this.promise_filename).script";
+ "script_name" string => "$(this.promise_filename).txt";
}
#######################################################
bundle agent test
{
- meta:
- "test_suppress_fail" string => "windows",
- meta => { "redmine1884" };
-
- classes:
- "matched" expression => regextract(".+/([^/]+)$",
- "${init.script_name}",
- "script_basename");
+ vars:
+ !windows::
+ "cat_prefix" string => "cat";
+ windows::
+ "cat_prefix" string => "cat_exe";
commands:
- "$(init.script_name)" module => "true";
+ "$(G.cat) $(init.script_name)"
+ contain => in_shell,
+ module => "true";
}
#######################################################
bundle agent check
{
- vars:
- "canonical_script_basename" string => canonify("${test.script_basename[1]}");
-
classes:
- "ok" expression => strcmp("$($(canonical_script_basename).myvar[dot.dash-test])", "42");
+ "ok" expression => strcmp("$($(test.cat_prefix).myvar[dot.dash-test])", "42");
reports:
DEBUG::
- "${${canonical_script_basename}.myvar[dot.dash-test]} =?= 42";
+ "${$(test.cat_prefix).myvar[dot.dash-test]} =?= 42";
ok::
"$(this.promise_filename) Pass";
!ok::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/003.cf.script new/core-3.6.0/tests/acceptance/08_commands/01_modules/003.cf.script
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/003.cf.script 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/003.cf.script 1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo =myvar[dot.dash-test]=42
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/003.cf.txt new/core-3.6.0/tests/acceptance/08_commands/01_modules/003.cf.txt
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/003.cf.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/003.cf.txt 2014-06-12 15:06:46.000000000 +0200
@@ -0,0 +1 @@
+=myvar[dot.dash-test]=42
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/004.cf new/core-3.6.0/tests/acceptance/08_commands/01_modules/004.cf
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/004.cf 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/004.cf 2014-06-12 15:06:46.000000000 +0200
@@ -6,7 +6,7 @@
body common control
{
- inputs => { "../../default.cf.sub" };
+ inputs => { "../../default.cf.sub", "../../plucked.cf.sub" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
@@ -16,7 +16,7 @@
bundle agent init
{
vars:
- "script_name" string => "$(this.promise_filename).script";
+ "script_name" string => "$(this.promise_filename).txt";
}
@@ -24,18 +24,16 @@
bundle agent test
{
- meta:
- "test_suppress_fail" string => "windows",
- meta => { "redmine1884" };
-
- classes:
- "matched" expression => regextract(".+/([^/]+)$",
- "${init.script_name}",
- "script_basename");
+ vars:
+ !windows::
+ "cat_prefix" string => "cat";
+ windows::
+ "cat_prefix" string => "cat_exe";
commands:
- "$(init.script_name)" module => "true";
-
+ "$(G.cat) $(init.script_name)"
+ contain => in_shell,
+ module => "true";
}
#######################################################
@@ -53,12 +51,10 @@
"actual2" string => join(":", "list2");
"actual3" string => join(":", "list3");
- "canonical_script_basename" string => canonify("${test.script_basename[1]}");
-
- "joined0" string => join(":", "${canonical_script_basename}.mylist");
- "joined1" string => join(":", "${canonical_script_basename}.myalist");
- "joined2" string => join(":", "${canonical_script_basename}.myblist");
- "joined3" string => join(":", "${canonical_script_basename}.myclist");
+ "joined0" string => join(":", "$(test.cat_prefix).mylist");
+ "joined1" string => join(":", "$(test.cat_prefix).myalist");
+ "joined2" string => join(":", "$(test.cat_prefix).myblist");
+ "joined3" string => join(":", "$(test.cat_prefix).myclist");
classes:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/004.cf.script new/core-3.6.0/tests/acceptance/08_commands/01_modules/004.cf.script
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/004.cf.script 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/004.cf.script 1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-echo "@mylist={\"abc\", \"def\", \"ghi\"}"
-echo "@myalist={\"{{abc}}\", \" ' def}\", \"ghi'''\"}"
-echo "@myblist={'{{a,bc}}', ' \" de,f}', 'gh,,i\"\"\"'}"
-echo "@myclist={\"{{a'bc',,}}\", ' \",, d\"ef}', \"ghi,},'''\"}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/004.cf.txt new/core-3.6.0/tests/acceptance/08_commands/01_modules/004.cf.txt
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/004.cf.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/004.cf.txt 2014-06-12 15:06:46.000000000 +0200
@@ -0,0 +1,4 @@
+@mylist={"abc", "def", "ghi"}
+@myalist={"{{abc}}", " ' def}", "ghi'''"}
+@myblist={'{{a,bc}}', ' " de,f}', 'gh,,i"""'}
+@myclist={"{{a'bc',,}}", ' ",, d"ef}', "ghi,},'''"}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-context.cf new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-context.cf
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-context.cf 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-context.cf 2014-06-12 15:06:46.000000000 +0200
@@ -7,7 +7,7 @@
body common control
{
- inputs => { "../../default.cf.sub" };
+ inputs => { "../../default.cf.sub", "../../plucked.cf.sub" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
@@ -17,7 +17,7 @@
bundle agent init
{
vars:
- "script_name" string => "$(this.promise_filename).script";
+ "script_name" string => "$(this.promise_filename).txt";
}
@@ -25,18 +25,10 @@
bundle agent test
{
- meta:
- "test_suppress_fail" string => "windows",
- meta => { "redmine1884" };
-
- classes:
- "matched" expression => regextract(".+/([^/]+)$",
- "${init.script_name}",
- "script_basename");
-
commands:
- "$(init.script_name)" module => "true";
-
+ "$(G.cat) $(init.script_name)"
+ contain => in_shell,
+ module => "true";
}
#######################################################
@@ -54,8 +46,6 @@
"actual2" string => join(":", "list2");
"actual3" string => join(":", "list3");
- "canonical_script_basename" string => canonify("${test.script_basename[1]}");
-
"joined0" string => join(":", "xyz.mylist");
"joined1" string => join(":", "xyz.myalist");
"joined2" string => join(":", "xyz.myblist");
@@ -85,7 +75,7 @@
"ok_c6" expression => strcmp($(e6) , $(c6));
"ok" and => { "myclass", "var0ok", "var1ok", "var2ok", "var3ok", "var4ok",
- "ok_c1", "ok_c2", "ok_c3", "ok_c4", };
+ "ok_c1", "ok_c2", "ok_c3", "ok_c4", "ok_c5", "ok_c6" };
reports:
DEBUG::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-context.cf.script new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-context.cf.script
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-context.cf.script 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-context.cf.script 1970-01-01 01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-echo "^context=xyz"
-echo "+myclass"
-echo "=myvar=hello there"
-echo "@mylist={\"abc\", \"def\", \"ghi\"}"
-echo "@myalist={\"{{abc}}\", \" ' def}\", \"ghi'''\"}"
-echo "@myblist={'{{a,bc}}', ' \" de,f}', 'gh,,i\"\"\"'}"
-echo "@myclist={\"{{a'bc',,}}\", ' \",, d\"ef}', \"ghi,},'''\"}"
-echo '%mycontainer1={"x":[456,789]}'
-echo '%mycontainer2={"x":"y"'
-echo '%mycontainer3="long string here"'
-echo '%mycontainer4=null'
-echo '%mycontainer5=["read", "some", "strings"]'
-echo '%mycontainer6={"mix": ["match"], "ping": "pong", "paddle": true, "nothing": null}'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-context.cf.txt new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-context.cf.txt
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-context.cf.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-context.cf.txt 2014-06-12 15:06:46.000000000 +0200
@@ -0,0 +1,13 @@
+^context=xyz
++myclass
+=myvar=hello there
+@mylist={"abc", "def", "ghi"}
+@myalist={"{{abc}}", " ' def}", "ghi'''"}
+@myblist={'{{a,bc}}', ' " de,f}', 'gh,,i"""'}
+@myclist={"{{a'bc',,}}", ' ",, d"ef}', "ghi,},'''"}
+%mycontainer1={"x":[456,789]}
+%mycontainer2={"x":"y"
+%mycontainer3="long string here"
+%mycontainer4=null
+%mycontainer5=["read", "some", "strings"]
+%mycontainer6={"mix": ["match"], "ping": "pong", "paddle": true, "nothing": null}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-tags.cf new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-tags.cf
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-tags.cf 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-tags.cf 2014-06-12 15:06:46.000000000 +0200
@@ -6,7 +6,7 @@
body common control
{
- inputs => { "../../default.cf.sub" };
+ inputs => { "../../default.cf.sub", "../../plucked.cf.sub" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
@@ -16,7 +16,7 @@
bundle common init
{
vars:
- "script_name" string => "$(this.promise_filename).script";
+ "script_name" string => "$(this.promise_filename).txt";
}
@@ -24,13 +24,10 @@
bundle agent test
{
- meta:
- "test_suppress_fail" string => "windows",
- meta => { "redmine1884" };
-
commands:
- "$(init.script_name)" module => "true";
-
+ "$(G.cat) $(init.script_name)"
+ contain => in_shell,
+ module => "true";
}
#######################################################
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-tags.cf.script new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-tags.cf.script
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-tags.cf.script 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-tags.cf.script 1970-01-01 01:00:00.000000000 +0100
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-echo "^context=xyz"
-echo "^meta=xyz,abc=def,,??what is this??"
-echo "+myclass"
-echo "=myvar=hello there"
-echo "@mylist={\"abc\", \"def\", \"ghi\"}"
-echo "@myalist={\"{{abc}}\", \" ' def}\", \"ghi'''\"}"
-echo "^meta=1,2,3"
-echo "@myblist={'{{a,bc}}', ' \" de,f}', 'gh,,i\"\"\"'}"
-echo "+mybclass"
-echo "^meta=a,b,c"
-echo "@myclist={\"{{a'bc',,}}\", ' \",, d\"ef}', \"ghi,},'''\"}"
-echo "+mycclass"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-tags.cf.txt new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-tags.cf.txt
--- old/core-3.6rc2-build1/tests/acceptance/08_commands/01_modules/set-tags.cf.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/core-3.6.0/tests/acceptance/08_commands/01_modules/set-tags.cf.txt 2014-06-12 15:06:46.000000000 +0200
@@ -0,0 +1,12 @@
+^context=xyz
+^meta=xyz,abc=def,,??what is this??
++myclass
+=myvar=hello there
+@mylist={"abc", "def", "ghi"}
+@myalist={"{{abc}}", " ' def}", "ghi'''"}
+^meta=1,2,3
+@myblist={'{{a,bc}}', ' " de,f}', 'gh,,i"""'}
++mybclass
+^meta=a,b,c
+@myclist={"{{a'bc',,}}", ' ",, d"ef}', "ghi,},'''"}
++mycclass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/18_examples/network/check_outputs.cf new/core-3.6.0/tests/acceptance/18_examples/network/check_outputs.cf
--- old/core-3.6rc2-build1/tests/acceptance/18_examples/network/check_outputs.cf 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/18_examples/network/check_outputs.cf 1970-01-01 01:00:00.000000000 +0100
@@ -1,96 +0,0 @@
-#######################################################
-#
-# Check the example outputs
-#
-#######################################################
-
-body common control
-{
- inputs => { "../../default.cf.sub" };
- bundlesequence => { default("$(this.promise_filename)") };
-}
-
-#######################################################
-
-bundle agent init
-{
- vars:
- "basedir" string => "../../examples";
- "checker" string => "$(basedir)/remake_outputs.pl";
- "all_examples" slist => findfiles("$(basedir)/*.cf");
-
- commands:
- # we need to avoid the cf-key messages
- "$(sys.cf_key)";
-
- reports:
- DEBUG_LOTS::
- "$(this.bundle): will consider example $(all_examples)";
-}
-
-#######################################################
-
-bundle agent test
-{
- meta:
- "test_skip_unsupported" string => "windows";
-
- vars:
- "examples" slist => { @(init.all_examples) };
- "canon[$(examples)]" string => canonify($(examples));
-
- classes:
- "has_output_block_$(canon[$(examples)])"
- expression => regline(".*example_output.*", $(examples));
-
- methods:
- "$(examples)" usebundle => test_example($(examples)),
- ifvarclass => "has_output_block_$(canon[$(examples)])";
-
- reports:
- DEBUG::
- "$(this.bundle): found example with output $(examples)"
- ifvarclass => "has_output_block_$(canon[$(examples)])";
-}
-
-bundle agent test_example(file)
-{
- vars:
- "cfile" string => canonify($(file));
-
- "checker" string => "$(G.perl) $(init.checker) --cfagent=$(sys.cf_agent) --workdir=$(G.testdir) -c";
-
- classes:
- "failure_$(cfile)" not => returnszero("$(checker) $(file)", "noshell"), scope => "namespace";
-
- methods:
- "with verbose" usebundle => verbose_output("$(checker) -v $(file)"),
- ifvarclass => "failure_$(cfile)";
-
- reports:
- "$(this.bundle): checker '$(checker) $(file)' returned error"
- ifvarclass => "failure_$(cfile)";
-
- DEBUG::
- "$(this.bundle): ran checker '$(checker) $(file)'";
-}
-
-bundle agent verbose_output(runme)
-{
- commands:
- "$(runme)";
-}
-
-#######################################################
-
-bundle agent check
-{
- classes:
- "ok" not => classmatch("failure.*");
-
- reports:
- ok::
- "$(this.promise_filename) Pass";
- !ok::
- "$(this.promise_filename) FAIL";
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/18_examples/ouputs/check_outputs.cf new/core-3.6.0/tests/acceptance/18_examples/ouputs/check_outputs.cf
--- old/core-3.6rc2-build1/tests/acceptance/18_examples/ouputs/check_outputs.cf 1970-01-01 01:00:00.000000000 +0100
+++ new/core-3.6.0/tests/acceptance/18_examples/ouputs/check_outputs.cf 2014-06-12 15:06:46.000000000 +0200
@@ -0,0 +1,96 @@
+#######################################################
+#
+# Check the example outputs
+#
+#######################################################
+
+body common control
+{
+ inputs => { "../../default.cf.sub" };
+ bundlesequence => { default("$(this.promise_filename)") };
+}
+
+#######################################################
+
+bundle agent init
+{
+ vars:
+ "basedir" string => "../../examples";
+ "checker" string => "$(basedir)/remake_outputs.pl";
+ "all_examples" slist => findfiles("$(basedir)/*.cf");
+
+ commands:
+ # we need to avoid the cf-key messages
+ "$(sys.cf_key)";
+
+ reports:
+ DEBUG_LOTS::
+ "$(this.bundle): will consider example $(all_examples)";
+}
+
+#######################################################
+
+bundle agent test
+{
+ meta:
+ "test_skip_unsupported" string => "windows";
+
+ vars:
+ "examples" slist => { @(init.all_examples) };
+ "canon[$(examples)]" string => canonify($(examples));
+
+ classes:
+ "has_output_block_$(canon[$(examples)])"
+ expression => regline(".*example_output.*", $(examples));
+
+ methods:
+ "$(examples)" usebundle => test_example($(examples)),
+ ifvarclass => "has_output_block_$(canon[$(examples)])";
+
+ reports:
+ DEBUG::
+ "$(this.bundle): found example with output $(examples)"
+ ifvarclass => "has_output_block_$(canon[$(examples)])";
+}
+
+bundle agent test_example(file)
+{
+ vars:
+ "cfile" string => canonify($(file));
+
+ "checker" string => "$(G.perl) $(init.checker) --cfagent=$(sys.cf_agent) --workdir=$(G.testdir) -c";
+
+ classes:
+ "failure_$(cfile)" not => returnszero("$(checker) $(file)", "noshell"), scope => "namespace";
+
+ methods:
+ "with verbose" usebundle => verbose_output("$(checker) -v $(file)"),
+ ifvarclass => "failure_$(cfile)";
+
+ reports:
+ "$(this.bundle): checker '$(checker) $(file)' returned error"
+ ifvarclass => "failure_$(cfile)";
+
+ DEBUG::
+ "$(this.bundle): ran checker '$(checker) $(file)'";
+}
+
+bundle agent verbose_output(runme)
+{
+ commands:
+ "$(runme)";
+}
+
+#######################################################
+
+bundle agent check
+{
+ classes:
+ "ok" not => classmatch("failure.*");
+
+ reports:
+ ok::
+ "$(this.promise_filename) Pass";
+ !ok::
+ "$(this.promise_filename) FAIL";
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/Makefile.am new/core-3.6.0/tests/acceptance/Makefile.am
--- old/core-3.6rc2-build1/tests/acceptance/Makefile.am 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/Makefile.am 2014-06-12 15:06:46.000000000 +0200
@@ -26,7 +26,7 @@
$(LIBXML2_LIBS)
endif
-EXTRA_DIST = default.cf.sub testall
+EXTRA_DIST = default.cf.sub dcs.cf.sub plucked.cf.sub testall
TESTS = testall
TESTS_ENVIRONMENT = env \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/acceptance/testall new/core-3.6.0/tests/acceptance/testall
--- old/core-3.6rc2-build1/tests/acceptance/testall 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/acceptance/testall 2014-06-12 15:06:46.000000000 +0200
@@ -214,7 +214,7 @@
echo
echo " --no-crashing disable tests that are expected to crash (for use with valgrind)."
echo
- echo " --printlog print the full test.log output immediately."
+ echo " --printlog print the full test.log output immediately. Override with $PRINTLOG"
echo
echo " --gdb Run test under GDB"
echo " --valgrind Run test under Valgrind"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/unit/Makefile.am new/core-3.6.0/tests/unit/Makefile.am
--- old/core-3.6rc2-build1/tests/unit/Makefile.am 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/unit/Makefile.am 2014-06-12 15:06:46.000000000 +0200
@@ -76,6 +76,7 @@
files_lib_test \
file_lib_test \
map_test \
+ parsemode_test \
parser_test \
policy_test \
sort_test \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/unit/cf_key_functions_test.c new/core-3.6.0/tests/unit/cf_key_functions_test.c
--- old/core-3.6rc2-build1/tests/unit/cf_key_functions_test.c 2014-05-26 18:01:14.000000000 +0200
+++ new/core-3.6.0/tests/unit/cf_key_functions_test.c 2014-06-12 15:06:46.000000000 +0200
@@ -5,6 +5,9 @@
#include
#include
+// Satisfy extern declared signal flag in cf-key-functions.c
+bool cf_key_interrupted = false;
+
static void test_RemoveKeys(void)
{
assert_true(1);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/core-3.6rc2-build1/tests/unit/parsemode_test.c new/core-3.6.0/tests/unit/parsemode_test.c
--- old/core-3.6rc2-build1/tests/unit/parsemode_test.c 1970-01-01 01:00:00.000000000 +0100
+++ new/core-3.6.0/tests/unit/parsemode_test.c 2014-06-12 15:06:46.000000000 +0200
@@ -0,0 +1,68 @@
+#include
+
+#include
+
+typedef struct {
+ char *string;
+ mode_t plus;
+ mode_t minus;
+} mode_definition;
+
+mode_definition modes[] = {
+ { "666", S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR|S_IWGRP|S_IWOTH, S_IXUSR|S_IXGRP|S_IXOTH|S_ISUID|S_ISGID|S_ISVTX },
+ { "g+w", S_IWGRP, 0 },
+ { "u+r,u+w,g-w,o-rw", S_IRUSR|S_IWUSR, S_IWGRP|S_IWOTH|S_IROTH },
+ { NULL, 0, 0 } // last case, still tested
+};
+
+void test_mode(void)
+{
+ int ret = false;
+ mode_t plus = 0;
+ mode_t minus = 0;
+
+ int mode = 0;
+ do {
+ ret = ParseModeString(modes[mode].string, &plus, &minus);
+ assert_true(ret);
+ assert_int_equal(modes[mode].plus, plus);
+ assert_int_equal(modes[mode].minus, minus);
+ } while (modes[mode++].string);
+}
+
+typedef struct {
+ char *string;
+ bool valid;
+} validation_mode;
+
+validation_mode validation_modes[] = {
+ { "", false },
+ { "abc", false },
+ { "222222", false },
+ { "22222", true },
+ { NULL, true } // last case, still tested
+};
+
+void test_validation(void)
+{
+ int ret = false;
+ mode_t minus = 0;
+ mode_t plus = 0;
+
+ int mode = 0;
+ do {
+ ret = ParseModeString( validation_modes[mode].string, &plus, &minus);
+ assert_int_equal(validation_modes[mode].valid, ret);
+ } while (validation_modes[mode++].string);
+}
+
+int main()
+{
+ PRINT_TEST_BANNER();
+ const UnitTest tests[] =
+ {
+ unit_test(test_validation),
+ unit_test(test_mode)
+ };
+ return run_tests(tests);
+}
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org