blob: f77cd012a8ea7a36c937dbd37fa676c33b072138 [file] [log] [blame]
support .override files
2011-06-06 James Hunt <james.hunt@ubuntu.com>
Add override file support.
* init/conf.c:
- conf_reload_path(): Now takes an extra override_path parameter.
- is_conf_file() / is_conf_file_std() / is_conf_file_override(): New
functions to determine type of given file path.
- toggle_conf_name(): New function which convert a conf file
name to an override name and vice versa.
- majority of remaining functions updated to handle override
files.
* init/conf.h: Prototypes.
* init/job_class.c: Whitespace.
* init/man/init.5: Updated to document override file support.
* init/man/init.8: Added reference to control-alt-delete(7) man page.
* init/paths.h: New macros CONF_EXT_OVERRIDE, CONF_EXT_STD,
IS_CONF_FILE_OVERRIDE and IS_CONF_FILE_STD.
* init/parse_conf.c: Added assertion to remind us forcibly to add
override-handling code for directories if we ever allow content in
'init.conf'.
* init/parse_job.c (parse_job): Additional parameter 'update' to
allow override files to replace existing Job details.
* init/parse_job.h: Updated parse_job() prototype.
* init/test_conf.c
- New macros TEST_ENSURE_CLEAN_ENV() and
TEST_FORCE_WATCH_UPDATE().
- test_override(): New function.
- test_toggle_conf_name(): New function.
* init/test_parse_job.c:
- Updated for extra parse_job() parameter.
- added a test feature to test_parse_job() to exercise new
parameter to parse_job().
* util/man/initctl.8: Clarified what it means to restart a job.
=== modified file 'init/conf.c'
--- init/conf.c 2011-06-03 11:02:18 +0000
+++ init/conf.c 2011-06-06 13:16:33 +0000
@@ -48,7 +48,7 @@
#include "parse_conf.h"
#include "conf.h"
#include "errors.h"
-
+#include "paths.h"
/* Prototypes for static functions */
static int conf_source_reload_file (ConfSource *source)
@@ -70,9 +70,18 @@
struct stat *statbuf)
__attribute__ ((warn_unused_result));
-static int conf_reload_path (ConfSource *source, const char *path)
- __attribute__ ((warn_unused_result));
-
+static int conf_reload_path (ConfSource *source, const char *path,
+ const char *override_path)
+ __attribute__ ((warn_unused_result));
+
+static inline int is_conf_file (const char *path)
+ __attribute__ ((warn_unused_result));
+
+static inline int is_conf_file_std (const char *path)
+ __attribute__ ((warn_unused_result));
+
+static inline int is_conf_file_override(const char *path)
+ __attribute__ ((warn_unused_result));
/**
* conf_sources:
@@ -85,6 +94,115 @@
/**
+ * is_conf_file_std:
+ * @path: path to check.
+ *
+ * Determine if specified path contains a legitimate
+ * configuration file name.
+ *
+ * Returns: TRUE if @path contains a valid configuration file name,
+ * else FALSE.
+ *
+ **/
+static inline int
+is_conf_file_std (const char *path)
+{
+ char *ptr = strrchr (path, '.');
+
+ if (ptr && IS_CONF_EXT_STD (ptr))
+ return TRUE;
+
+ return FALSE;
+}
+
+/**
+ * is_conf_file_override:
+ * @path: path to check.
+ *
+ * Determine if specified path contains a legitimate
+ * override file name.
+ *
+ * Returns: TRUE if @path contains a valid override file name,
+ * else FALSE.
+ *
+ **/
+static inline int
+is_conf_file_override (const char *path)
+{
+ char *ptr = strrchr (path, '.');
+
+ if (ptr && IS_CONF_EXT_OVERRIDE (ptr))
+ return TRUE;
+
+ return FALSE;
+}
+
+/**
+ * is_conf_file:
+ * @path: path to check.
+ *
+ * Determine if specified path contains a legitimate
+ * configuration file or override file name.
+ *
+ * Returns: TRUE if @path contains a valid configuration
+ * file or override file name, else FALSE.
+ *
+ **/
+static inline int
+is_conf_file (const char *path)
+{
+ char *ptr = strrchr (path, '.');
+
+ if (ptr && (ptr > path) && (ptr[-1] != '/') && IS_CONF_EXT (ptr))
+ return TRUE;
+
+ return FALSE;
+}
+
+/**
+ * Convert a configuration file name to an override file name and vice
+ * versa.
+ *
+ * For example, if @path is "foo.conf", this function will return
+ * "foo.override", whereas if @path is "foo.override", it will return
+ * "foo.conf".
+ *
+ * Note that this function should be static, but isn't to allow the
+ * tests to access it.
+ *
+ * @parent: parent of returned path,
+ * @path: path to a configuration file.
+ *
+ * Returns: newly allocated toggled path, or NULL on error.
+ **/
+char *
+toggle_conf_name (const void *parent,
+ const char *path)
+{
+ char *new_path;
+ char *ext;
+ char *new_ext;
+ size_t len;
+
+ ext = strrchr (path, '.');
+ if (!ext)
+ return NULL;
+
+ new_ext = IS_CONF_EXT_STD (ext)
+ ? CONF_EXT_OVERRIDE
+ : CONF_EXT_STD;
+
+ len = strlen (new_ext);
+
+ new_path = NIH_MUST (nih_strndup (parent, path, (ext - path) + len));
+
+ memcpy (new_path + (ext - path), new_ext, len);
+
+ return new_path;
+}
+
+
+/**
* conf_init:
*
* Initialise the conf_sources list.
@@ -329,10 +447,16 @@
conf_source_reload_file (ConfSource *source)
{
NihError *err = NULL;
+ nih_local char *override_path = NULL;
+
+ struct stat statbuf;
nih_assert (source != NULL);
nih_assert (source->type == CONF_FILE);
+ /* this function should only be called for standard
+ * configuration files.
+ */
if (! source->watch) {
nih_local char *dpath = NULL;
char *dname;
@@ -361,7 +485,7 @@
/* Parse the file itself. If this fails, then we can discard the
* inotify error, since this one will be better.
*/
- if (conf_reload_path (source, source->path) < 0) {
+ if (conf_reload_path (source, source->path, NULL) < 0) {
if (err)
nih_free (err);
@@ -382,6 +506,23 @@
nih_free (err);
}
+ if (! is_conf_file_std (source->path))
+ return 0;
+
+ override_path = toggle_conf_name (NULL, source->path);
+
+ if (stat (override_path, &statbuf) != 0)
+ return 0;
+
+ nih_debug ("Updating configuration for %s from %s",
+ source->path, override_path);
+ if (conf_reload_path (source, source->path, override_path) < 0) {
+ if (err)
+ nih_free (err);
+
+ return -1;
+ }
+
return 0;
}
@@ -501,19 +642,18 @@
* @is_dir: TRUE of @path is a directory.
*
* This is the file filter used for the jobs directory, we only care
- * about paths with the ".conf" extension. Directories that
- * match the nih_file_ignore() function are also ignored.
- *
- * Returns: FALSE if @path ends in ".conf", or is the original source,
- * TRUE otherwise.
+ * about paths with particular extensions (see IS_CONF_EXT).
+ *
+ * Directories that match the nih_file_ignore() function are also ignored.
+ *
+ * Returns: FALSE if @path ends in ".conf" or ".override",
+ * or is the original source, TRUE otherwise.
**/
static int
conf_dir_filter (ConfSource *source,
const char *path,
int is_dir)
{
- char *ptr;
-
nih_assert (source != NULL);
nih_assert (path != NULL);
@@ -523,8 +663,7 @@
if (is_dir)
return nih_file_ignore (NULL, path);
- ptr = strrchr (path, '.');
- if (ptr && (ptr > path) && (ptr[-1] != '/') && (! strcmp (ptr, ".conf")))
+ if (is_conf_file (path))
return FALSE;
return TRUE;
@@ -546,29 +685,92 @@
* After checking that it was a regular file that was changed, we reload it;
* we expect this to fail sometimes since the file may be only partially
* written.
- **/
+ **/
static void
conf_create_modify_handler (ConfSource *source,
NihWatch *watch,
const char *path,
struct stat *statbuf)
{
+ ConfFile *file = NULL;
+ const char *error_path = path;
+ nih_local char *new_path = NULL;
+ int ret;
+
nih_assert (source != NULL);
nih_assert (watch != NULL);
nih_assert (path != NULL);
nih_assert (statbuf != NULL);
+ /* note that symbolic links are ignored */
if (! S_ISREG (statbuf->st_mode))
return;
- if (conf_reload_path (source, path) < 0) {
+ new_path = toggle_conf_name (NULL, path);
+ file = (ConfFile *)nih_hash_lookup (source->files, new_path);
+
+ if (is_conf_file_override (path)) {
+ if (! file) {
+ /* override file has no corresponding conf file */
+ nih_debug ("Ignoring orphan override file %s", path);
+ return;
+ }
+
+ /* reload conf file */
+ nih_debug ("Loading configuration file %s", new_path);
+ ret = conf_reload_path (source, new_path, NULL);
+ if (ret < 0) {
+ error_path = new_path;
+ goto error;
+ }
+
+ /* overlay override settings */
+ nih_debug ("Loading override file %s for %s", path, new_path);
+ ret = conf_reload_path (source, new_path, path);
+ if (ret < 0) {
+ error_path = path;
+ goto error;
+ }
+ } else {
+ nih_debug ("Loading configuration and override files for %s", path);
+
+ /* load conf file */
+ nih_debug ("Loading configuration file %s", path);
+ ret = conf_reload_path (source, path, NULL);
+ if (ret < 0) {
+ error_path = path;
+ goto error;
+ }
+
+ /* ensure we ignore directory changes (which won't have overrides. */
+ if (is_conf_file_std (path)) {
+ struct stat st;
+ if (stat (new_path, &st) == 0) {
+ /* overlay override settings */
+ nih_debug ("Loading override file %s for %s", new_path, path);
+ ret = conf_reload_path (source, path, new_path);
+ if (ret < 0) {
+ error_path = new_path;
+ goto error;
+ }
+ }
+
+ }
+ }
+
+ return;
+
+error:
+ {
NihError *err;
err = nih_error_get ();
- nih_error ("%s: %s: %s", path,
- _("Error while loading configuration file"),
- err->message);
+ nih_error ("%s: %s: %s", error_path,
+ _("Error while loading configuration file"),
+ err->message);
nih_free (err);
+ if (file)
+ nih_unref (file, source);
}
}
@@ -585,13 +787,14 @@
*
* We lookup the file in our hash table, and if we can find it, perform
* the usual deletion of it.
- **/
+ **/
static void
conf_delete_handler (ConfSource *source,
NihWatch *watch,
const char *path)
{
ConfFile *file;
+ nih_local char *new_path = NULL;
nih_assert (source != NULL);
nih_assert (watch != NULL);
@@ -603,7 +806,11 @@
* it's probably a directory or something, so just ignore it.
*/
file = (ConfFile *)nih_hash_lookup (source->files, path);
- if (! file) {
+ /* Note we have to be careful to consider deletion of directories too.
+ * This is handled implicitly by the override check which will return
+ * false if passed a directory in this case.
+ */
+ if (! file && ! is_conf_file_override (path)) {
if (! strcmp (watch->path, path)) {
nih_warn ("%s: %s", source->path,
_("Configuration directory deleted"));
@@ -614,7 +821,30 @@
return;
}
- nih_unref (file, source);
+ /* non-override files (and directories) are the simple case, so handle
+ * them and leave.
+ */
+ if (! is_conf_file_override (path)) {
+ nih_unref (file, source);
+ return;
+ }
+
+ /* if an override file is deleted for which there is a corresponding
+ * conf file, reload the conf file to remove any modifications
+ * introduced by the override file.
+ */
+ new_path = toggle_conf_name (NULL, path);
+ file = (ConfFile *)nih_hash_lookup (source->files, new_path);
+
+ if (file) {
+ nih_debug ("Reloading configuration for %s on deletion of overide (%s)",
+ new_path, path);
+
+ if ( conf_reload_path (source, new_path, NULL) < 0 ) {
+ nih_warn ("%s: %s", new_path,
+ _("Unable to reload configuration after override deletion"));
+ }
+ }
}
/**
@@ -637,22 +867,61 @@
const char *path,
struct stat *statbuf)
{
+ ConfFile *file = NULL;
+ nih_local char *new_path = NULL;
+
nih_assert (source != NULL);
nih_assert (dirname != NULL);
nih_assert (path != NULL);
nih_assert (statbuf != NULL);
+ /* We assume that CONF_EXT_STD files are visited before
+ * CONF_EXT_OVERRIDE files. Happily, this assumption is currently
+ * valid since CONF_EXT_STD comes before CONF_EXT_OVERRIDE if ordered
+ * alphabetically.
+ *
+ * If this were ever to change (for example if we decided to
+ * rename the CONF_EXT_OVERRIDE files to end in ".abc", say), the logic
+ * in this function would be erroneous since it would never be possible when
+ * visiting an override file (before a conf file) to lookup a conf file
+ * in the hash, since the conf file would not yet have been seen and thus would
+ * not exist in the hash (yet).
+ */
+ nih_assert (CONF_EXT_STD[1] < CONF_EXT_OVERRIDE[1]);
+
if (! S_ISREG (statbuf->st_mode))
return 0;
- if (conf_reload_path (source, path) < 0) {
- NihError *err;
-
- err = nih_error_get ();
- nih_error ("%s: %s: %s", path,
- _("Error while loading configuration file"),
- err->message);
- nih_free (err);
+ if (is_conf_file_std (path)) {
+ if (conf_reload_path (source, path, NULL) < 0) {
+ NihError *err;
+
+ err = nih_error_get ();
+ nih_error ("%s: %s: %s", path,
+ _("Error while loading configuration file"),
+ err->message);
+ nih_free (err);
+ }
+ return 0;
+ }
+
+ new_path = toggle_conf_name (NULL, path);
+ file = (ConfFile *)nih_hash_lookup (source->files, new_path);
+
+ if (file) {
+ /* we're visiting an override file with an associated conf file that
+ * has already been loaded, so just overlay the override file. If
+ * there is no corresponding conf file, we ignore the override file.
+ */
+ if (conf_reload_path (source, new_path, path) < 0) {
+ NihError *err;
+
+ err = nih_error_get ();
+ nih_error ("%s: %s: %s", new_path,
+ _("Error while reloading configuration file"),
+ err->message);
+ nih_free (err);
+ }
}
return 0;
@@ -662,16 +931,20 @@
/**
* conf_reload_path:
* @source: configuration source,
- * @path: path of file to be reloaded.
+ * @path: path of conf file to be reloaded.
+ * @override_path: if not NULL and @path refers to a path associated with @source,
+ * overlay the contents of @path into the existing @source entry for
+ * @path. If FALSE, discard any existing knowledge of @path.
*
- * This function is used to parse the file at @path in the context of the
- * given configuration @source. Necessary ConfFile structures are allocated
- * and attached to @source as appropriate. CONF_FILE sources always have
- * a single ConfFile when the file exists.
+ * This function is used to parse the file at @path (or @override_path) in the
+ * context of the given configuration @source. Necessary ConfFile structures
+ * are allocated and attached to @source as appropriate. CONF_FILE sources
+ * always have a single ConfFile when the file exists.
*
* If the file has been parsed before, then the existing item is deleted and
* freed if the file fails to load, or after the new item has been parsed.
- * Items are not reused between reloads.
+ * Items are only reused between reloads if @override_path is
+ * non-NULL.
*
* Physical errors are returned, parse errors are not.
*
@@ -679,36 +952,47 @@
**/
static int
conf_reload_path (ConfSource *source,
- const char *path)
+ const char *path,
+ const char *override_path)
{
- ConfFile *file;
+ ConfFile *file = NULL;
nih_local char *buf = NULL;
const char *start, *end;
nih_local char *name = NULL;
size_t len, pos, lineno;
NihError *err = NULL;
+ const char *path_to_load;
nih_assert (source != NULL);
nih_assert (path != NULL);
- /* Look up the old file in memory, and then free it. In cases
- * of failure, we discard it anyway, so there's no particular reason
+ path_to_load = (override_path ? override_path : path);
+
+ /* If there is no corresponding override file, look up the old
+ * conf file in memory, and then free it. In cases of failure,
+ * we discard it anyway, so there's no particular reason
* to keep it around anymore.
+ *
+ * Note: if @override_path has been specified, do not
+ * free the file if found, since we want to _update_ the
+ * existing entry.
*/
file = (ConfFile *)nih_hash_lookup (source->files, path);
- if (file)
+ if (! override_path && file)
nih_unref (file, source);
/* Read the file into memory for parsing, if this fails we don't
* bother creating a new ConfFile structure for it and bail out
* now.
*/
- buf = nih_file_read (NULL, path, &len);
+ buf = nih_file_read (NULL, path_to_load, &len);
if (! buf)
return -1;
- /* Parse the file, storing the item in a new ConfFile structure. */
- file = NIH_MUST (conf_file_new (source, path));
+ /* Create a new ConfFile structure (if no @override_path specified) */
+ file = (ConfFile *)nih_hash_lookup (source->files, path);
+ if (! file)
+ file = NIH_MUST (conf_file_new (source, path));
pos = 0;
lineno = 1;
@@ -717,7 +1001,14 @@
case CONF_FILE:
case CONF_DIR:
/* Simple file of options; usually no item attached to it. */
- nih_debug ("Loading configuration from %s", path);
+ if (override_path) {
+ nih_debug ("Updating configuration for %s from %s",
+ path, override_path);
+ } else {
+ nih_debug ("Loading configuration from %s %s",
+ (source->type == CONF_DIR ? "directory" : "file"), path);
+ }
+
if (parse_conf (file, buf, len, &pos, &lineno) < 0)
err = nih_error_get ();
@@ -735,7 +1026,7 @@
start++;
end = strrchr (start, '.');
- if (end && (! strcmp (end, ".conf"))) {
+ if (end && IS_CONF_EXT (end)) {
name = NIH_MUST (nih_strndup (NULL, start, end - start));
} else {
name = NIH_MUST (nih_strdup (NULL, start));
@@ -744,8 +1035,16 @@
/* Create a new job item and parse the buffer to produce
* the job definition.
*/
- nih_debug ("Loading %s from %s", name, path);
- file->job = parse_job (NULL, name, buf, len, &pos, &lineno);
+ if (override_path) {
+ nih_debug ("Updating %s (%s) with %s",
+ name, path, override_path);
+ } else {
+ nih_debug ("Loading %s from %s", name, path);
+ }
+
+ file->job = parse_job (NULL, file->job,
+ name, buf, len, &pos, &lineno);
+
if (file->job) {
job_class_consider (file->job);
} else {
@@ -780,7 +1078,7 @@
case PARSE_EXPECTED_OPERATOR:
case PARSE_EXPECTED_VARIABLE:
case PARSE_MISMATCHED_PARENS:
- nih_error ("%s:%zi: %s", path, lineno, err->message);
+ nih_error ("%s:%zi: %s", path_to_load, lineno, err->message);
nih_free (err);
err = NULL;
break;
@@ -887,3 +1185,149 @@
return NULL;
}
+
+#ifdef DEBUG
+
+size_t
+debug_count_list_entries (const NihList *list)
+{
+ size_t i = 0;
+ NIH_LIST_FOREACH (list, iter) {
+ i++;
+ }
+ return i;
+}
+
+size_t
+debug_count_hash_entries (const NihHash *hash)
+{
+ size_t i = 0;
+ NIH_HASH_FOREACH_SAFE (hash, iter) {
+ i++;
+ }
+ return i;
+}
+
+void
+debug_show_job_class (const JobClass *job)
+{
+ int i;
+ char **env = (char **)job->env;
+ char **export = (char **)job->export;
+
+ nih_assert (job);
+
+ nih_debug ("JobClass %p: name='%s', path='%s', task=%d, "
+ "respawn=%d, console=%x, deleted=%d, debug=%d",
+ job, job->name, job->path, job->task,
+ job->respawn, job->console, job->deleted, job->debug);
+
+ nih_debug ("\tstart_on=%p, stop_on=%p, emits=%p, process=%p",
+ job->start_on, job->stop_on, job->emits, job->process);
+
+ nih_debug ("\tauthor='%s', description='%s'",
+ job->author, job->description);
+
+ if (env && *env) {
+ nih_debug ("\tenv:");
+ i = 0;
+ while ( *env ) {
+ nih_debug ("\t\tenv[%d]='%s' (len=%u+1)",
+ i, *env, strlen (*env));
+ env++;
+ ++i;
+ }
+ } else {
+ nih_debug ("\tenv: none.");
+ }
+
+
+ if (export && *export) {
+ nih_debug ("\texport:");
+ i = 0;
+ while ( *export ) {
+ nih_debug ("\t\tenv[%d]='%s' (len=%u+1)",
+ i, *export, strlen (*export));
+ export++;
+ ++i;
+ }
+ }
+ else {
+ nih_debug ("\texport: none");
+ }
+}
+
+void
+debug_show_job_classes (void)
+{
+ nih_debug ("job_classes:");
+
+ NIH_HASH_FOREACH_SAFE (job_classes, iter) {
+ JobClass *job = (JobClass *)iter;
+ debug_show_job_class (job);
+ }
+}
+
+void
+debug_show_event (const Event *event)
+{
+ nih_assert (event);
+
+ nih_debug ("Event %p: name='%s', progress=%x, failed=%d, "
+ "blockers=%d, blocking=%p",
+ event, event->name, event->progress, event->failed,
+ event->blockers, (void *)&event->blocking);
+}
+
+void
+debug_show_conf_file (const ConfFile *file)
+{
+ nih_assert (file);
+
+ nih_debug ("ConfFile %p: path='%s', source=%p, flag=%x, job=%p",
+ file, file->path, file->source, file->flag, file->job);
+
+ /* Some ConfFile objects won't have any JobClass details, for example,
+ * the ConfFile object associated with "/etc/init.conf".
+ */
+ if (! file->job) {
+ nih_debug ("ConfFile %p: job: no JobClass object.", file);
+ return;
+ }
+
+ nih_debug ("ConfFile %p: job:", file);
+ debug_show_job_class (file->job);
+}
+
+void
+debug_show_conf_source (const ConfSource *source)
+{
+ nih_assert (source);
+
+ nih_debug ("ConfSource %p: path='%s', type=%x, flag=%x",
+ source, source->path, source->type, source->flag);
+
+ nih_debug ("ConfSource %p files (%d):", source,
+ debug_count_hash_entries (source->files));
+
+ NIH_HASH_FOREACH (source->files, file_iter) {
+ ConfFile *file = (ConfFile *)file_iter;
+ debug_show_conf_file (file);
+ }
+}
+
+void
+debug_show_conf_sources (void)
+{
+ nih_assert (conf_sources);
+
+ nih_debug ("conf_sources:");
+
+ NIH_LIST_FOREACH (conf_sources, iter) {
+ ConfSource *source = (ConfSource *)iter;
+ debug_show_conf_source (source);
+ }
+}
+
+#endif /* DEBUG */
+
=== modified file 'init/conf.h'
--- init/conf.h 2011-05-15 12:53:17 +0000
+++ init/conf.h 2011-06-06 12:52:08 +0000
@@ -127,6 +127,46 @@
JobClass * conf_select_job (const char *name);
+char *toggle_conf_name (const void *parent, const char *path)
+ __attribute__ ((warn_unused_result, malloc));
+
+#ifdef DEBUG
+
+/* used for debugging only */
+
+size_t
+debug_count_hash_entries (const NihHash *hash);
+
+size_t
+debug_count_list_entries (const NihList *list)
+ __attribute__ ((unused));
+
+void
+debug_show_job_class (const JobClass *job)
+ __attribute__ ((unused));
+
+void
+debug_show_job_classes (void)
+ __attribute__ ((unused));
+
+void
+debug_show_event (const Event *event)
+ __attribute__ ((unused));
+
+void
+debug_show_conf_file(const ConfFile *file)
+ __attribute__ ((unused));
+
+void
+debug_show_conf_source(const ConfSource *source)
+ __attribute__ ((unused));
+
+void
+debug_show_conf_sources(void)
+ __attribute__ ((unused));
+
+#endif
+
NIH_END_EXTERN
#endif /* INIT_CONF_H */
=== modified file 'init/man/init.5'
--- init/man/init.5 2011-06-02 10:03:18 +0000
+++ init/man/init.5 2011-06-06 13:16:33 +0000
@@ -4,7 +4,7 @@
init \- Upstart init daemon job configuration
.\"
.SH SYNOPSIS
-.B /etc/init
+.B /etc/init/
.\"
.SH DESCRIPTION
On startup, the Upstart
@@ -14,24 +14,58 @@
directory, and watches for future changes to these files using
.BR inotify (7).
-Files in this directory must end in
+To be considered by Upstart, files in this directory must have a
+recognized suffix and may also be present in sub-directories. There are
+two recognized suffixes:
+
+.IP \(bu 4
+Files ending in
.I .conf
-and may also be present in sub-directories.
-
-Each file defines a single service or task, with the name taken from its
-relative path within the directory without the extension. For example a
-job defined in
+are called configuration files, or simply "conf files" for short.
+These are the primary vehicle for specifying a job.
+.IP \(bu 4
+Files ending in
+.I .override
+are called override files. If an override file is present, the stanzas
+it contains take precedence over those equivalently named stanzas in the
+corresponding configuration file contents for a particular job.
+The main use for override files is to modify how a job will run without
+having to modify its configuration file directly. See the section
+\fBOverride File Handling\fP below for further details.
+.P
+A job can thus be defined by either:
+.IP \[bu] 2
+A single configuration file.
+.IP \[bu]
+A single configuration file \fBand\fP a single override file.
+.P
+Unless explicitly stated otherwise, any reference to a jobs
+configuration can refer both to a configuration file or an override
+file.
+
+Each configuration file defines the template for a single \fIservice\fP
+(long-running process or daemon) or \fItask\fP (short-lived process).
+
+Note that a configuration file is not itself a job: it is a description
+of an environmenta job could be run in. A job is the runtime embodiment
+of a configuration file.
+
+The configuration file name as displayed by Upstart and associated
+tooling is taken from its relative path within the directory without the
+extension. For example a configuration file
.I /etc/init/rc-sysinit.conf
is named
.IR rc-sysinit ,
-while a job defined in
+while a configuration file
.I /etc/init/net/apache.conf
is named
.IR net/apache .
+Since override files only modify the way a configuration file is
+interpreted, they are not named.
-These files are plain text and should not be executable.
+Configuration files are plain text and should not be executable.
.\"
-.SS Format
+.SS Configuration File Format
Each line begins with a configuration stanza and continues until either
the end of the line or a line containing a closing stanza. Line breaks
within a stanza are permitted within single or double quotes, or if
@@ -571,6 +605,46 @@
.B unlimited
may be specified for either.
.\"
+.SS Override File Handling
+Override files allow a jobs environment to be changed without modifying
+the jobs configuration file. Rules governing override files:
+
+.IP \[bu] 2
+If a job is embodied with only a configuration file, the contents of
+this file define the job.
+.IP \[bu]
+If an override files exists where there is no existing cofiguration
+file, the override file is ignored.
+.IP \[bu]
+If both a configuration file \fBand\fP an override file exist for a job
+and both files are syntactically correct:
+.RS
+.IP \[bu] 2
+stanzas in the override file will take precedence over stanzas present
+in the corresponding configuration file.
+.IP \[bu]
+stanzas in the override file which are not present in the corresponding
+configuration file will be honoured when the job runs.
+.RE
+.IP \[bu]
+If both a configuration file and an override file exist for a job and
+subsequently the override file is deleted, the configuration file is
+automatically reloaded with the effect that any changes introduced by
+the override file are undone and the configuration file alone now defines
+the job.
+.IP \[bu]
+If both a configuration file and an override file exist for a job and
+subsequently the configuration file is deleted, a new instance of the
+job can no longer be started (since without a corresponding
+configuration file an override file is ignored).
+.IP \[bu]
+If both a configuration file and an override file exist for a job and
+any of the contents of the override file are invalid, the override file
+is ignored and only the contents of the configuration file are
+considered.
+.P
+
+.\"
.SS Miscellaneous
.TP
.B kill signal \fISIGNAL
@@ -588,7 +662,7 @@
Specifies the interval between sending the job's main process the
"stopping" (see above) and
.I SIGKILL
-signals when stopping the running job.
+signals when stopping the running job. Default is 5 seconds.
.\"
.TP
.B expect stop
=== modified file 'init/parse_conf.c'
--- init/parse_conf.c 2009-06-23 09:29:35 +0000
+++ init/parse_conf.c 2011-01-17 15:32:36 +0000
@@ -74,6 +74,12 @@
nih_assert (file != NULL);
nih_assert (pos != NULL);
+ /* If we update 'stanzas' to allow content in init.conf, this
+ * function must be updated in a similar manner to parse_job()
+ * to handle overrides files.
+ */
+ nih_assert (sizeof(stanzas) / sizeof(stanzas[0]) == 1);
+
if (nih_config_parse_file (file, len, pos, lineno,
stanzas, conffile) < 0)
return -1;
=== modified file 'init/parse_job.c'
--- init/parse_job.c 2011-05-15 12:57:29 +0000
+++ init/parse_job.c 2011-06-06 12:52:08 +0000
@@ -264,6 +264,7 @@
/**
* parse_job:
* @parent: parent object for new job,
+ * @update: If not NULL, update the existing specified JobClass,
* @name: name of new job,
* @file: file or string to parse,
* @len: length of @file,
@@ -279,10 +280,12 @@
* of the returned job are freed, the returned job will also be
* freed.
*
- * Returns: new JobClass structure on success, NULL on raised error.
+ * Returns: if @update is NULL, returns new JobClass structure on success, NULL on raised error.
+ * If @update is not NULL, returns @update or NULL on error.
**/
JobClass *
parse_job (const void *parent,
+ JobClass *update,
const char *name,
const char *file,
size_t len,
@@ -296,13 +299,22 @@
nih_assert (file != NULL);
nih_assert (pos != NULL);
- class = job_class_new (parent, name);
- if (! class)
- nih_return_system_error (NULL);
+ if (update) {
+ class = update;
+ nih_debug ("Reusing JobClass %s (%s)",
+ class->name, class->path);
+ } else {
+ nih_debug ("Creating new JobClass %s",
+ name);
+ class = job_class_new (parent, name);
+ if (! class)
+ nih_return_system_error (NULL);
+ }
if (nih_config_parse_file (file, len, pos, lineno,
- stanzas, class) < 0) {
- nih_free (class);
+ stanzas, class) < 0) {
+ if (!update)
+ nih_free (class);
return NULL;
}
=== modified file 'init/parse_job.h'
--- init/parse_job.h 2010-12-10 03:02:57 +0000
+++ init/parse_job.h 2011-06-06 12:52:08 +0000
@@ -29,7 +29,7 @@
NIH_BEGIN_EXTERN
-JobClass *parse_job (const void *parent, const char *name,
+JobClass *parse_job (const void *parent, JobClass *update, const char *name,
const char *file, size_t len,
size_t *pos, size_t *lineno)
__attribute__ ((warn_unused_result, malloc));
=== modified file 'init/paths.h'
--- init/paths.h 2011-06-03 11:02:18 +0000
+++ init/paths.h 2011-06-06 12:52:08 +0000
@@ -126,5 +126,55 @@
#define TELINIT SBINDIR "/telinit"
#endif
+/**
+ * File extension for standard configuration files.
+ **/
+#define CONF_EXT_STD ".conf"
+
+/**
+ * File extension for override files.
+ *
+ * Note that override files are not stored in the ConfSource 'files' hash:
+ * all JobClass information from override files is added to the JobClass for
+ * the corresponding (CONF_EXT_STD) object.
+ **/
+#define CONF_EXT_OVERRIDE ".override"
+
+/**
+ * Determine if specified path extension representes a standard
+ * configuration file.
+ *
+ * @period: pointer to last period in path to check.
+ *
+ * Returns 1 if specified path extension matches that for a
+ * standard configuration file, else return 0.
+ **/
+#define IS_CONF_EXT_STD(period) \
+ (!strcmp (period, CONF_EXT_STD))
+
+/**
+ * Determine if specified path extension representes an
+ * override file.
+ *
+ * @period: pointer to last period in path to check.
+ *
+ * Returns 1 if specified path extension matches that for
+ * an override file, else return 0.
+ **/
+#define IS_CONF_EXT_OVERRIDE(period) \
+ (!strcmp (period, CONF_EXT_OVERRIDE))
+
+/**
+ * Determine if specified filename has a valid configuration
+ * file name extension.
+ *
+ * @period: pointer to last period in filename.
+ *
+ * Returns: TRUE if extension beyond @period is one of the
+ * recognized types, else FALSE.
+ **/
+#define IS_CONF_EXT(period) \
+ (IS_CONF_EXT_STD(period) || \
+ IS_CONF_EXT_OVERRIDE(period))
#endif /* INIT_PATHS_H */
=== modified file 'init/tests/test_conf.c'
--- init/tests/test_conf.c 2011-06-03 11:02:18 +0000
+++ init/tests/test_conf.c 2011-06-06 12:52:08 +0000
@@ -46,6 +46,50 @@
#include "job.h"
#include "conf.h"
+/* macro to try and ensure the environment is as pristine as possible
+ * (to avoid follow-on errors caused by not freeing objects in a
+ * previous test, say)
+ */
+#define TEST_ENSURE_CLEAN_ENV() \
+{ \
+ setvbuf(stdout, NULL, _IONBF, 0); \
+ \
+ if (job_classes) { \
+ TEST_HASH_EMPTY (job_classes); \
+ } \
+ \
+ if (conf_sources) { \
+ TEST_LIST_EMPTY (conf_sources); \
+ } \
+ \
+ if (nih_io_watches) { \
+ TEST_LIST_EMPTY (nih_io_watches); \
+ } \
+ \
+ if (nih_timers) { \
+ TEST_LIST_EMPTY (nih_timers); \
+ } \
+ \
+ if (events) { \
+ TEST_LIST_EMPTY (events); \
+ } \
+}
+
+/* Force an inotify watch update */
+#define TEST_FORCE_WATCH_UPDATE() \
+{ \
+ int nfds = 0; \
+ fd_set readfds, writefds, exceptfds; \
+ \
+ FD_ZERO (&readfds); \
+ FD_ZERO (&writefds); \
+ FD_ZERO (&exceptfds); \
+ \
+ nih_debug("calling nih_io_select_fds"); \
+ nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); \
+ nih_debug("calling nih_io_handle_fds"); \
+ nih_io_handle_fds (&readfds, &writefds, &exceptfds); \
+}
void
test_source_new (void)
@@ -2416,6 +2460,1255 @@
}
}
+void
+test_toggle_conf_name (void)
+{
+ char override_ext[] = ".override";
+ char dirname[PATH_MAX];
+ char filename[PATH_MAX];
+ JobClass *job;
+ char *f;
+ char *p;
+
+ TEST_FUNCTION_FEATURE ("toggle_conf_name",
+ "changing conf to override");
+
+ TEST_FILENAME (dirname);
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ f = toggle_conf_name (NULL, filename);
+ TEST_NE_P (f, NULL);
+
+ p = strstr (f, ".override");
+ TEST_NE_P (p, NULL);
+ TEST_EQ_P (p, f+strlen (f) - strlen (override_ext));
+ nih_free (f);
+
+ TEST_FEATURE ("changing override to conf");
+ strcpy (filename, dirname);
+ strcat (filename, "/bar.override");
+ f = toggle_conf_name (NULL, filename);
+ TEST_NE_P (f, NULL);
+
+ p = strstr (f, ".conf");
+ TEST_NE_P (p, NULL);
+ TEST_EQ_P (p, f+strlen (f) - strlen (".conf"));
+ nih_free (f);
+
+ /* test parent param */
+ job = job_class_new (NULL, "foo");
+ TEST_NE_P (job, NULL);
+
+ f = toggle_conf_name (job, filename);
+ TEST_NE_P (f, NULL);
+
+ TEST_EQ (TRUE, nih_alloc_parent (f, job));
+
+ nih_free (job);
+}
+
+void
+test_override (void)
+{
+ ConfSource *source;
+ ConfFile *file;
+ FILE *f;
+ int ret, fd[4096], i = 0;
+ char dirname[PATH_MAX];
+ char filename[PATH_MAX], override[PATH_MAX];
+ JobClass *job;
+ NihError *err;
+
+ program_name = "test";
+ nih_log_set_priority (NIH_LOG_FATAL);
+
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_GROUP ("override files");
+
+ /* Make sure that we have inotify before performing some tests... */
+ if ((fd[0] = inotify_init ()) < 0) {
+ printf ("SKIP: inotify not available\n");
+ goto no_inotify;
+ }
+ close (fd[0]);
+
+
+ /* Explicit test of behaviour prior to introduction of override files.
+ *
+ * conf with no override before watch:
+ * create conf
+ * create watch
+ * ensure conf loaded
+ * update conf
+ * ensure conf updated
+ * delete conf
+ * ensure conf deleted
+ */
+ TEST_FEATURE ("with pre-override environment (conf with no override before watch)");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create conf */
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "emits hello\n");
+ fclose (f);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ /* ensure conf loaded */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_NE_P (job->start_on, NULL);
+
+ /* update conf */
+ f = fopen (filename, "a");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf updated */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (job->start_on, NULL);
+
+ /* delete conf */
+ unlink (filename);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+ TEST_HASH_EMPTY (job_classes);
+ TEST_HASH_EMPTY (source->files);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf deleted */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+
+ nih_free (source);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ /* Explicit test of behaviour prior to introduction of override files.
+ *
+ * conf with no override after watch:
+ * create watch
+ * create conf
+ * ensure conf loaded
+ * update conf
+ * ensure conf updated
+ * delete conf
+ * ensure conf deleted
+ */
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FEATURE ("with pre-override environment (conf with no override after watch)");
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ /* create conf */
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "emits hello\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf loaded */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+
+ /* update conf */
+ f = fopen (filename, "a");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf updated */
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (job->start_on, NULL);
+
+ /* delete conf */
+ unlink (filename);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf deleted */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ nih_free (source);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ TEST_FEATURE ("ensure lone override ignored before watch");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create override */
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.override");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fclose (f);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure no conf object created */
+ TEST_HASH_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+
+ /* update override */
+ f = fopen (filename, "a");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "author \"me\"\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure no conf object created */
+ TEST_HASH_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+
+ /* delete override */
+ unlink (filename);
+ nih_free (source);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ TEST_FEATURE ("ensure lone override ignored after watch");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ strcpy (filename, dirname);
+ strcat (filename, "/bar.override");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure no conf object created */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "bar");
+ TEST_EQ_P (job, NULL);
+
+ /* delete override */
+ unlink (filename);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure override still not present */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "bar");
+ TEST_EQ_P (job, NULL);
+
+ nih_free (source);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ TEST_FEATURE ("create conf, watch, then create/modify/delete override");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create conf */
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "emits hello\n");
+ fclose (f);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ /* ensure conf loaded */
+ TEST_HASH_NOT_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_EQ_P ((job->emits)[1], NULL);
+ TEST_NE_P (job->start_on, NULL);
+
+ /* create override */
+ strcpy (override, dirname);
+ strcat (override, "/foo.override");
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fclose (f);
+
+ TEST_HASH_NOT_EMPTY (source->files);
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf updated */
+ TEST_HASH_NOT_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (job->start_on, NULL);
+
+ /* ensure no override in hash */
+ file = (ConfFile *)nih_hash_lookup (source->files, override);
+ TEST_EQ_P (file, NULL);
+
+ /* modify override */
+ f = fopen (override, "a");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "emits world\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf updated */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_EQ_STR ((job->emits)[1], "world");
+
+ /* delete override */
+ unlink (override);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf reverted */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_NE_P (job->start_on, NULL);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_EQ_P ((job->emits)[1], NULL);
+
+ nih_free (source);
+ unlink (filename);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ TEST_FEATURE ("create watch, conf, then create/modify/delete override");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ /* create conf */
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "emits hello\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf loaded */
+ TEST_HASH_NOT_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_EQ_P ((job->emits)[1], NULL);
+ TEST_NE_P (job->start_on, NULL);
+
+ /* create override */
+ strcpy (override, dirname);
+ strcat (override, "/foo.override");
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fclose (f);
+
+ TEST_HASH_NOT_EMPTY (source->files);
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf updated */
+ TEST_HASH_NOT_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (job->start_on, NULL);
+
+ /* ensure no override in hash */
+ file = (ConfFile *)nih_hash_lookup (source->files, override);
+ TEST_EQ_P (file, NULL);
+
+ /* modify override */
+ f = fopen (override, "a");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "emits world\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf updated */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_EQ_STR ((job->emits)[1], "world");
+
+ /* delete override */
+ unlink (override);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf reverted */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_NE_P (job->start_on, NULL);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_EQ_P ((job->emits)[1], NULL);
+
+ nih_free (source);
+ unlink (filename);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ TEST_FEATURE ("create override, watch, then create/modify/delete conf");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ strcpy (override, dirname);
+ strcat (override, "/foo.override");
+
+ /* create override */
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fprintf (f, "author \"bar\"\n");
+ fclose (f);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure no conf object created */
+ TEST_HASH_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+
+ /* create conf */
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "emits hello\n");
+ fprintf (f, "author \"foo\"\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf loaded */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+
+ /* should pick up override, *NOT* conf */
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR (job->author, "bar");
+
+ /* modify conf */
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on wibble\n");
+ fprintf (f, "emits moo\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf reloaded and updated with override */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "moo");
+
+ /* should pick up override, *NOT* conf */
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR (job->author, "bar");
+
+ /* delete conf */
+ unlink (filename);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf object deleted */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ TEST_HASH_EMPTY (source->files);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+ file = (ConfFile *)nih_hash_lookup (source->files, override);
+ TEST_EQ_P (file, NULL);
+
+ unlink (override);
+
+ /* ensure no conf object still */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ TEST_HASH_EMPTY (source->files);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+ file = (ConfFile *)nih_hash_lookup (source->files, override);
+ TEST_EQ_P (file, NULL);
+
+ nih_free (source);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ TEST_FEATURE ("create watch, override, then create/modify/delete conf");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ strcpy (override, dirname);
+ strcat (override, "/foo.override");
+
+ /* create override */
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fprintf (f, "author \"bar\"\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure no conf object created */
+ TEST_HASH_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+
+ /* create conf */
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "emits hello\n");
+ fprintf (f, "author \"foo\"\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf loaded */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+
+ /* should pick up override, *NOT* conf */
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR (job->author, "bar");
+
+ /* modify conf */
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on wibble\n");
+ fprintf (f, "emits moo\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf reloaded and updated with override */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "moo");
+
+ /* should pick up override, *NOT* conf */
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR (job->author, "bar");
+
+ /* delete conf */
+ unlink (filename);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf object deleted */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ TEST_HASH_EMPTY (source->files);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+ file = (ConfFile *)nih_hash_lookup (source->files, override);
+ TEST_EQ_P (file, NULL);
+
+ unlink (override);
+
+ /* ensure no conf object still */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ TEST_HASH_EMPTY (source->files);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+ file = (ConfFile *)nih_hash_lookup (source->files, override);
+ TEST_EQ_P (file, NULL);
+
+ nih_free (source);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ TEST_FEATURE ("create override, watch, conf, then modify/delete override");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ strcpy (override, dirname);
+ strcat (override, "/foo.override");
+
+ /* create override */
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fprintf (f, "author \"bar\"\n");
+ fclose (f);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure no conf object created */
+ TEST_HASH_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+
+ /* create conf */
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "emits hello\n");
+ fprintf (f, "author \"foo\"\n");
+ fclose (f);
+
+ /* FIXME: crashes here */
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf loaded */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+
+ /* should pick up override, *NOT* conf */
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR (job->author, "bar");
+
+ /* modify override */
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "author \"meh\"\n");
+ fprintf (f, "env wibble=wobble\n");
+ fprintf (f, "manual\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf reloaded and updated with override */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+
+ /* should pick up override, *NOT* conf */
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR (job->author, "meh");
+ TEST_EQ_STR ((job->env)[0], "wibble=wobble");
+
+ /* delete override */
+ unlink (override);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf object reverted */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_NE_P (job->start_on, NULL);
+ TEST_EQ_STR (job->author, "foo");
+ TEST_EQ_P (job->env, NULL);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+
+ unlink (filename);
+ nih_free (source);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ TEST_FEATURE ("create watch, override, conf, then modify/delete override");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ strcpy (override, dirname);
+ strcat (override, "/foo.override");
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* create override */
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fprintf (f, "author \"bar\"\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* create conf */
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "emits hello\n");
+ fprintf (f, "author \"foo\"\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf loaded */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+
+ /* should pick up override, *NOT* conf */
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR (job->author, "bar");
+
+ /* update override */
+ f = fopen (override, "a");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "author \"me\"\n");
+ fprintf (f, "env wibble=wobble\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf reloaded and updated with override */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+
+ /* should pick up override, *NOT* conf */
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR (job->author, "me");
+ TEST_EQ_STR ((job->env)[0], "wibble=wobble");
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* delete override */
+ unlink (override);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf loaded */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR (job->author, "foo");
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_NE_P (job->start_on, NULL);
+ TEST_EQ_P (job->env, NULL);
+
+ unlink (filename);
+ nih_free (source);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ TEST_FEATURE ("create both conf+override files, watch, then modify/delete conf");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create conf */
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "author \"me\"\n");
+ fprintf (f, "env foo=bar\n");
+ fprintf (f, "emits hello\n");
+ fclose (f);
+
+ /* create override */
+ strcpy (override, dirname);
+ strcat (override, "/foo.override");
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fprintf (f, "author \"you\"\n");
+ fclose (f);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf loaded */
+ TEST_HASH_NOT_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_EQ_STR (job->author, "you");
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR ((job->env)[0], "foo=bar");
+ TEST_EQ_P (job->export, NULL);
+
+ /* modify conf */
+ f = fopen (filename, "a");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "export foo\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf updated */
+ TEST_HASH_NOT_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_STR ((job->env)[0], "foo=bar");
+ TEST_NE_P (job->export, NULL);
+ TEST_EQ_STR ((job->export)[0], "foo");
+
+ /* delete conf */
+ unlink (filename);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf object deleted */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_EQ_P (file, NULL);
+ TEST_HASH_EMPTY (source->files);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_EQ_P (job, NULL);
+ file = (ConfFile *)nih_hash_lookup (source->files, override);
+ TEST_EQ_P (file, NULL);
+
+ unlink (override);
+ nih_free (source);
+ TEST_EQ (rmdir (dirname), 0);
+
+ TEST_FEATURE ("create both conf+override files, watch, then modify/delete override");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create conf */
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "author \"me\"\n");
+ fprintf (f, "env foo=bar\n");
+ fprintf (f, "emits hello\n");
+ fclose (f);
+
+ /* create override */
+ strcpy (override, dirname);
+ strcat (override, "/foo.override");
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fprintf (f, "author \"you\"\n");
+ fclose (f);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf loaded */
+ TEST_HASH_NOT_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_EQ_STR (job->author, "you");
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR ((job->env)[0], "foo=bar");
+ TEST_EQ_P (job->export, NULL);
+
+ /* modify override */
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "description \"hello world\"\n");
+ fprintf (f, "author \"ubuntu\"\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf updated */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR (job->author, "ubuntu");
+ TEST_NE_P (job->description, NULL);
+ TEST_EQ_STR (job->description, "hello world");
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_NE_P (job->start_on, NULL);
+
+ /* delete override */
+ unlink (override);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf updated */
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_NE_P (job->start_on, NULL);
+ TEST_EQ_STR ((job->env)[0], "foo=bar");
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_EQ_STR (job->author, "me");
+ TEST_EQ_P (job->description, NULL);
+
+ nih_free (source);
+ unlink (filename);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ TEST_FEATURE ("create conf, watch, then create invalid override, delete override");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create conf */
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "author \"wibble\"\n");
+ fprintf (f, "emits hello\n");
+ fclose (f);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf loaded */
+ TEST_HASH_NOT_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_NE_P (job->start_on, NULL);
+
+ /* create (partially) invalid override (which should be
+ * fully ignored)
+ */
+ strcpy (override, dirname);
+ strcat (override, "/foo.override");
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fprintf (f, "bleaugh!\n");
+ fprintf (f, "wha...?\n");
+ fprintf (f, "author \"moo\"\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ unlink (override);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf still loaded */
+ TEST_HASH_NOT_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_NE_P (job->start_on, NULL);
+ TEST_EQ_STR (job->author, "wibble");
+
+ nih_free (source);
+ unlink (filename);
+ TEST_EQ (rmdir (dirname), 0);
+
+ TEST_FEATURE ("ensure override ignored for CONF_FILE");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create empty conf */
+ strcpy (filename, dirname);
+ strcat (filename, "/init.conf");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fclose (f);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_FILE);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+
+ /* We expect conf_source_reload to fail in this situation since
+ * although "init.conf" is a supported config file, it is not
+ * allowed to contain any stanzas, implying that it can only
+ * contain comments. In fact, if the file exists but is zero
+ * size that is currently an error since upstart blindly calls
+ * nih_file_read(), which will fail since there are no bytes to
+ * read.
+ */
+ TEST_NE (ret, 0);
+ err = nih_error_steal ();
+ TEST_EQ (err->number, EILSEQ);
+ nih_free (err);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf NOT loaded */
+ TEST_HASH_EMPTY (source->files);
+
+ /* create override */
+ strcpy (override, dirname);
+ strcat (override, "/init.override");
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fclose (f);
+
+ TEST_FORCE_WATCH_UPDATE();
+
+ /* ensure conf still NOT loaded */
+ TEST_HASH_EMPTY (source->files);
+
+ nih_free (source);
+ unlink (filename);
+ unlink (override);
+ TEST_EQ (rmdir (dirname), 0);
+
+ /* Consume all available inotify instances so that the following
+ * tests run without inotify.
+ */
+ for (i = 0; i < 4096; i++)
+ if ((fd[i] = inotify_init ()) < 0)
+ break;
+
+no_inotify:
+ /* If you don't have inotify, any override file must exist
+ * before the system boots.
+ */
+
+ TEST_FEATURE ("both conf+override files with no inotify support");
+ TEST_ENSURE_CLEAN_ENV ();
+ TEST_FILENAME (dirname);
+ TEST_EQ (mkdir (dirname, 0755), 0);
+
+ /* create conf */
+ strcpy (filename, dirname);
+ strcat (filename, "/foo.conf");
+ f = fopen (filename, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "start on started\n");
+ fprintf (f, "author \"me\"\n");
+ fprintf (f, "env foo=bar\n");
+ fprintf (f, "emits hello\n");
+ fclose (f);
+
+ /* create override */
+ strcpy (override, dirname);
+ strcat (override, "/foo.override");
+ f = fopen (override, "w");
+ TEST_NE_P (f, NULL);
+ fprintf (f, "manual\n");
+ fprintf (f, "author \"you\"\n");
+ fclose (f);
+
+ /* create watch */
+ source = conf_source_new (NULL, dirname, CONF_JOB_DIR);
+ TEST_NE_P (source, NULL);
+ ret = conf_source_reload (source);
+ TEST_EQ (ret, 0);
+
+ /* ensure conf loaded */
+ TEST_HASH_NOT_EMPTY (source->files);
+ file = (ConfFile *)nih_hash_lookup (source->files, filename);
+ TEST_NE_P (file, NULL);
+ job = (JobClass *)nih_hash_lookup (job_classes, "foo");
+ TEST_NE_P (job, NULL);
+ TEST_EQ_P (file->job, job);
+ TEST_EQ_STR ((job->emits)[0], "hello");
+ TEST_EQ_STR (job->author, "you");
+ TEST_EQ_P (job->start_on, NULL);
+ TEST_EQ_STR ((job->env)[0], "foo=bar");
+ TEST_EQ_P (job->export, NULL);
+
+ nih_free (source);
+ unlink (filename);
+ unlink (override);
+ TEST_EQ (rmdir (dirname), 0);
+
+
+ nih_log_set_priority (NIH_LOG_MESSAGE);
+
+ /* Release consumed instances */
+ for (i = 0; i < 4096; i++) {
+ if (fd[i] < 0)
+ break;
+
+ close (fd[i]);
+ }
+}
void
test_source_reload_file (void)
@@ -2968,8 +4261,6 @@
TEST_HASH_EMPTY (source->files);
nih_free (source);
-
-
/* Consume all available inotify instances so that the following
* tests run without inotify.
*/
@@ -3458,6 +4749,8 @@
test_source_reload_conf_dir ();
test_source_reload_file ();
test_source_reload ();
+ test_toggle_conf_name ();
+ test_override ();
test_file_destroy ();
test_select_job ();
=== modified file 'init/tests/test_parse_job.c'
--- init/tests/test_parse_job.c 2011-05-15 13:16:00 +0000
+++ init/tests/test_parse_job.c 2011-06-06 12:52:08 +0000
@@ -64,7 +64,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -110,7 +110,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -131,6 +131,45 @@
nih_free (job);
}
+
+ TEST_FEATURE ("with non-NULL update parameter (override)");
+ {
+ JobClass *tmp = NULL;
+
+ strcpy (buf, "start on starting\n");
+ strcat (buf, "author \"me\"\n");
+
+ pos = 0;
+ lineno = 1;
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
+ &pos, &lineno);
+
+ TEST_NE_P (job, NULL);
+ TEST_EQ_STR (job->author, "me");
+ TEST_NE_P (job->start_on, NULL);
+
+ strcat (buf, "author \"you\"\n");
+ strcat (buf, "manual\n");
+ strcat (buf, "description \"my description\"\n");
+
+ pos = 0;
+ lineno = 1;
+ tmp = parse_job (NULL, job, "test", buf, strlen (buf),
+ &pos, &lineno);
+ TEST_NE_P (tmp, NULL);
+
+ /* if passed a job, the same object should be returned.
+ */
+ TEST_EQ_P (tmp, job);
+
+ TEST_EQ_STR (tmp->author, "you");
+ TEST_EQ_P (tmp->start_on, NULL);
+ TEST_NE_P (tmp->description, NULL);
+
+ TEST_EQ_STR (tmp->description, "my description");
+
+ nih_free (job);
+ }
}
void
@@ -153,7 +192,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -190,7 +229,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -229,7 +268,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -266,7 +305,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -299,7 +338,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -340,7 +379,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -379,7 +418,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -416,7 +455,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -447,7 +486,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -484,7 +523,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -524,7 +563,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -565,7 +604,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -604,7 +643,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -643,7 +682,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -680,7 +719,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -699,7 +738,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -718,7 +757,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -737,7 +776,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -768,7 +807,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -805,7 +844,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -845,7 +884,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -886,7 +925,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -925,7 +964,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -964,7 +1003,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1001,7 +1040,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1020,7 +1059,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1039,7 +1078,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1058,7 +1097,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1089,7 +1128,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1126,7 +1165,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1166,7 +1205,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1207,7 +1246,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1246,7 +1285,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1285,7 +1324,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1322,7 +1361,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1341,7 +1380,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1360,7 +1399,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1379,7 +1418,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1410,7 +1449,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1447,7 +1486,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1487,7 +1526,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1528,7 +1567,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1567,7 +1606,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1606,7 +1645,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1643,7 +1682,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1662,7 +1701,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1681,7 +1720,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1700,7 +1739,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -1731,7 +1770,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1776,7 +1815,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1828,7 +1867,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1879,7 +1918,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -1942,7 +1981,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2012,7 +2051,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2090,7 +2129,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2170,7 +2209,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2249,7 +2288,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2291,7 +2330,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2310,7 +2349,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2329,7 +2368,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2348,7 +2387,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2367,7 +2406,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2384,7 +2423,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2403,7 +2442,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2422,7 +2461,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2441,7 +2480,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2460,7 +2499,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2479,7 +2518,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2498,7 +2537,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2517,7 +2556,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -2551,7 +2590,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2586,7 +2625,7 @@
TEST_FEATURE ("manual stanza after start on");
strcpy (buf, "start on wibble\nmanual\n");
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
TEST_NE_P (job, NULL);
@@ -2616,7 +2655,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2661,7 +2700,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2713,7 +2752,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2764,7 +2803,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2827,7 +2866,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2897,7 +2936,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -2975,7 +3014,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3055,7 +3094,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3134,7 +3173,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3176,7 +3215,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3195,7 +3234,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3214,7 +3253,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3233,7 +3272,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3252,7 +3291,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3269,7 +3308,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3288,7 +3327,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3307,7 +3346,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3326,7 +3365,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3345,7 +3384,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3364,7 +3403,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3383,7 +3422,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3402,7 +3441,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3432,7 +3471,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3465,7 +3504,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3498,7 +3537,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3517,7 +3556,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3547,7 +3586,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3580,7 +3619,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3613,7 +3652,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3632,7 +3671,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3662,7 +3701,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3695,7 +3734,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3728,7 +3767,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3747,7 +3786,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3777,7 +3816,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3814,7 +3853,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3857,7 +3896,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3899,7 +3938,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -3929,7 +3968,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3962,7 +4001,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -3995,7 +4034,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4028,7 +4067,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4061,7 +4100,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4093,7 +4132,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4112,7 +4151,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4131,7 +4170,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4159,7 +4198,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4193,7 +4232,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4226,7 +4265,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4260,7 +4299,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4293,7 +4332,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4326,7 +4365,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4345,7 +4384,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4364,7 +4403,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4383,7 +4422,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4402,7 +4441,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4421,7 +4460,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4440,7 +4479,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4459,7 +4498,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4478,7 +4517,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4497,7 +4536,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4516,7 +4555,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4535,7 +4574,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4565,7 +4604,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4597,7 +4636,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4629,7 +4668,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4659,7 +4698,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4693,7 +4732,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4726,7 +4765,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4745,7 +4784,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4775,7 +4814,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4808,7 +4847,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4841,7 +4880,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4872,7 +4911,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -4904,7 +4943,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4923,7 +4962,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4942,7 +4981,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4961,7 +5000,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4980,7 +5019,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -4999,7 +5038,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5018,7 +5057,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5037,7 +5076,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5056,7 +5095,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5076,7 +5115,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5096,7 +5135,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5127,7 +5166,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5166,7 +5205,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5205,7 +5244,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5249,7 +5288,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5290,7 +5329,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5309,7 +5348,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5328,7 +5367,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5347,7 +5386,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5366,7 +5405,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5385,7 +5424,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5415,7 +5454,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5448,7 +5487,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5481,7 +5520,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5514,7 +5553,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5545,7 +5584,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5564,7 +5603,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5582,7 +5621,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5612,7 +5651,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5650,7 +5689,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5687,7 +5726,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5706,7 +5745,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5736,7 +5775,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5773,7 +5812,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5816,7 +5855,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5858,7 +5897,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5888,7 +5927,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5921,7 +5960,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -5953,7 +5992,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5972,7 +6011,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -5991,7 +6030,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6010,7 +6049,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6029,7 +6068,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6049,7 +6088,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6079,7 +6118,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6112,7 +6151,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6145,7 +6184,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6177,7 +6216,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6196,7 +6235,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6215,7 +6254,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6234,7 +6273,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6253,7 +6292,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6272,7 +6311,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6304,7 +6343,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6333,7 +6372,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6365,7 +6404,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6394,7 +6433,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6427,7 +6466,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6460,7 +6499,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6493,7 +6532,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6523,7 +6562,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6556,7 +6595,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6586,7 +6625,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6618,7 +6657,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6637,7 +6676,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6656,7 +6695,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6671,7 +6710,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6690,7 +6729,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6705,7 +6744,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6724,7 +6763,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6739,7 +6778,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6758,7 +6797,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6773,7 +6812,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6792,7 +6831,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6807,7 +6846,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -6836,7 +6875,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6870,7 +6909,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6904,7 +6943,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6938,7 +6977,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -6972,7 +7011,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7007,7 +7046,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7042,7 +7081,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7076,7 +7115,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7111,7 +7150,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7145,7 +7184,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7179,7 +7218,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7213,7 +7252,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7248,7 +7287,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7282,7 +7321,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7318,7 +7357,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7357,7 +7396,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7392,7 +7431,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7427,7 +7466,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7461,7 +7500,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7480,7 +7519,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7499,7 +7538,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7518,7 +7557,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7537,7 +7576,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7556,7 +7595,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7575,7 +7614,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7594,7 +7633,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7613,7 +7652,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7632,7 +7671,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7651,7 +7690,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7681,7 +7720,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7715,7 +7754,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7748,7 +7787,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7767,7 +7806,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7797,7 +7836,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7831,7 +7870,7 @@
TEST_ALLOC_FAIL {
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf),
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf),
&pos, &lineno);
if (test_alloc_failed) {
@@ -7864,7 +7903,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);
@@ -7883,7 +7922,7 @@
pos = 0;
lineno = 1;
- job = parse_job (NULL, "test", buf, strlen (buf), &pos, &lineno);
+ job = parse_job (NULL, NULL, "test", buf, strlen (buf), &pos, &lineno);
TEST_EQ_P (job, NULL);