ce0eafc913437df809d56b1495093373d7925be8
[project/uci.git] / test / tests.d / 050_show
1 test_get_parsing()
2 {
3         cp ${REF_DIR}/show_parsing.data ${CONFIG_DIR}/test
4
5         assertFailWithNoReturn "${UCI_Q} show test."
6         assertFailWithNoReturn "${UCI_Q} show test.section."
7         assertFailWithNoReturn "${UCI_Q} show test.section.opt."
8         assertFailWithNoReturn "${UCI_Q} show test.section.opt.val."
9         assertFailWithNoReturn "${UCI_Q} show test.section.opt.val.qsdf.qsd"
10         assertFailWithNoReturn "${UCI_Q} show test.section.opt.valqsqsd"
11 }
12
13 prepare_get_parsing_multiline() {
14         cp ${REF_DIR}/show_parsing_multiline.data ${CONFIG_DIR}/sockd
15 }
16
17 test_get_parsing_multiline_package()
18 {
19         prepare_get_parsing_multiline
20
21         value=$(${UCI_Q} show sockd)
22         value_ref=$(cat ${REF_DIR}/show_parsing_multiline_package.result)
23         assertEquals "$value_ref" "$value"
24 }
25
26 test_get_parsing_multiline_section()
27 {
28         prepare_get_parsing_multiline
29
30         value=$(${UCI_Q} show sockd.instance0)
31         value_ref=$(cat ${REF_DIR}/show_parsing_multiline_section.result)
32         assertEquals "$value_ref" "$value"
33 }
34
35 test_get_parsing_multiline_option()
36 {
37         prepare_get_parsing_multiline
38
39         value=$(${UCI_Q} show sockd.instance0.extra_config)
40         value_ref=$(cat ${REF_DIR}/show_parsing_multiline_option.result)
41         assertEquals "$value_ref" "$value"
42 }