Testing system configuration generation.

-- Testcase --
{%
	let real_include = include;

	include("./cfg/ucentral.uc", {
		TRACE_CALLS: "stderr",

		/* wrap include() to fixup the include paths */
		include: function(path, scope) {
			path = replace(path, "/usr/share/ucentral/", "../cfg/");

			/* make path absolute */
			if (index(path, "/") != 0) {
				try {
					die();
				} catch(e) {
					path = replace(e.stacktrace[1].filename, /\/[^\/]+$/, '') + '/' + path;
				};
			}

			return real_include(path, scope);
		}
	})
%}
-- End --

-- Environment --
{
	"capab": {},
	"cfg": {
		"system" : {
			"timezone" : "CET-1CEST,M3.5.0,M10.5.0/3"
		}
	}
}
-- End --

-- File fs/stat~_usr_share_ucentral_cfg_system_uc.json --
{ "type": "file" }
-- End --

-- Expect stderr --
[call] fs.stat path </usr/share/ucentral/cfg_system.uc>
-- End --

-- Expect stdout --
set system.@system[-1].timezone='CET-1CEST,M3.5.0,M10.5.0/3'
-- End --
