summaryrefslogtreecommitdiffstats
path: root/tests/06_includes/03_script_includes
blob: 3eeea3105bbfc7d428b28687a4835787fdc95daa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Testing the execution of include scripts.

-- Testcase --
{%
	include("./root/usr/share/firewall4/main.uc", {
		TRACE_CALLS: "stderr",

		getenv: function(varname) {
			switch (varname) {
			case 'ACTION':
				return 'includes';
			}
		}
	})
%}
-- End --

-- File fs/open~_var_run_fw4_state.txt --
{
	"includes": [
		{
			"enabled": true,
			"path": "/usr/share/miniupnpd/firewall.include",
			"type": "script",
			"fw4_compatible": true,
			"position": "table-append"
		},

		{
			"enabled": true,
			"path": "/etc/example.sh",
			"type": "script",
			"fw4_compatible": true,
			"position": "table-append"
		}
	]
}
-- End --

-- Expect stderr --
[call] fs.open path </var/run/fw4.state> mode <r>
[call] system command <[ "sh", "-c", "exec 1000>&-; config() { echo \"You cannot use UCI in firewall in..." ]> timeout <30000>
[call] system command <[ "sh", "-c", "exec 1000>&-; config() { echo \"You cannot use UCI in firewall in..." ]> timeout <30000>
-- End --