--- /dev/null
+config main
+ option version 1.4.1
+
+config sockd 'instance0'
+ option enabled 1
+ list internal_network vpn
+ list external_network wan
+
+ option extra_config '
+ user.unprivileged: nobody
+ client pass {
+ from: 0.0.0.0/0 to: 0.0.0.0/0
+ session.max: 64
+ log: error
+ }
+
+ socks pass {
+ from: 0.0.0.0/0 to: 0.0.0.0/0
+ log: connect
+ } '
--- /dev/null
+sockd.instance0.extra_config='
+ user.unprivileged: nobody
+ client pass {
+ from: 0.0.0.0/0 to: 0.0.0.0/0
+ session.max: 64
+ log: error
+ }
+
+ socks pass {
+ from: 0.0.0.0/0 to: 0.0.0.0/0
+ log: connect
+ } '
--- /dev/null
+sockd.@main[0]=main
+sockd.@main[0].version='1.4.1'
+sockd.instance0=sockd
+sockd.instance0.enabled='1'
+sockd.instance0.internal_network='vpn'
+sockd.instance0.external_network='wan'
+sockd.instance0.extra_config='
+ user.unprivileged: nobody
+ client pass {
+ from: 0.0.0.0/0 to: 0.0.0.0/0
+ session.max: 64
+ log: error
+ }
+
+ socks pass {
+ from: 0.0.0.0/0 to: 0.0.0.0/0
+ log: connect
+ } '
--- /dev/null
+sockd.instance0=sockd
+sockd.instance0.enabled='1'
+sockd.instance0.internal_network='vpn'
+sockd.instance0.external_network='wan'
+sockd.instance0.extra_config='
+ user.unprivileged: nobody
+ client pass {
+ from: 0.0.0.0/0 to: 0.0.0.0/0
+ session.max: 64
+ log: error
+ }
+
+ socks pass {
+ from: 0.0.0.0/0 to: 0.0.0.0/0
+ log: connect
+ } '
assertFailWithNoReturn "${UCI_Q} show test.section.opt.val.qsdf.qsd"
assertFailWithNoReturn "${UCI_Q} show test.section.opt.valqsqsd"
}
+
+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"
+}