Testing rtty 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": {
		"rtty" : {
			"enable": 1,
			"host" : "websocket.example.org",
			"interface" : "wan",
			"token" : "00000000000000000000000000000000"
		}
	}
}
-- End --

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

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

-- Expect stdout --
set rtty.@rtty[-1].enable='1'
set rtty.@rtty[-1].host='websocket.example.org'
set rtty.@rtty[-1].token='00000000000000000000000000000000'
set rtty.@rtty[-1].interface='wan'
-- End --
