summaryrefslogtreecommitdiffstats
path: root/test/tests.d/050_show
blob: 161bae05cb2daf878b02a40f3905f0b2ed59c6a0 (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
45
test_get_parsing()
{
	cp ${REF_DIR}/show_parsing.data ${CONFIG_DIR}/test

	assertFailWithNoReturn "${UCI_Q} show test."
	assertFailWithNoReturn "${UCI_Q} show test.section."
	assertFailWithNoReturn "${UCI_Q} show test.section.opt."
	assertFailWithNoReturn "${UCI_Q} show test.section.opt.val."
	assertFailWithNoReturn "${UCI_Q} show test.section.opt.val.qsdf.qsd"
	assertFailWithNoReturn "${UCI_Q} show test.section.opt.valqsqsd"
	assertFailWithNoReturn "${UCI_Q} show test.nilsection"
	assertFailWithNoReturn "${UCI_Q} show test.nilsection.nilopt"
	assertFailWithNoReturn "${UCI_Q} show test.section.nilopt"
}

prepare_get_parsing_multiline() {
	cp ${REF_DIR}/show_parsing_multiline.data ${CONFIG_DIR}/sockd
}

test_get_parsing_multiline_package()
{
	prepare_get_parsing_multiline

	value=$(${UCI_Q} show sockd)
	value_ref=$(cat ${REF_DIR}/show_parsing_multiline_package.result)
	assertEquals "$value_ref" "$value"
}

test_get_parsing_multiline_section()
{
	prepare_get_parsing_multiline

	value=$(${UCI_Q} show sockd.instance0)
	value_ref=$(cat ${REF_DIR}/show_parsing_multiline_section.result)
	assertEquals "$value_ref" "$value"
}

test_get_parsing_multiline_option()
{
	prepare_get_parsing_multiline

	value=$(${UCI_Q} show sockd.instance0.extra_config)
	value_ref=$(cat ${REF_DIR}/show_parsing_multiline_option.result)
	assertEquals "$value_ref" "$value"
}