Testing usteer 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": {
		"steer" : {
			"debug_level" : 0,
			"enabled" : 1,
			"network" : "wan"
		}
	}
}
-- End --

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

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

-- Expect stdout --
set usteer.@usteer[-1].enabled='1'
set usteer.@usteer[-1].network='wan'
set usteer.@usteer[-1].debug_level='0'
set firewall.usteer_wan='rule'
set firewall.usteer_wan.name='Allow-uSteer-WAN'
set firewall.usteer_wan.src='wan'
set firewall.usteer_wan.proto='udp'
set firewall.usteer_wan.target='ACCEPT'
set firewall.usteer_wan.dest_port='16720'
-- End --
