tests: add test cases for showing nonexistent section and option.
authorYousong Zhou <yszhou4tech@gmail.com>
Sat, 24 Jan 2015 15:07:50 +0000 (23:07 +0800)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 24 Jan 2015 19:46:12 +0000 (20:46 +0100)
Also fix the false error message about absence of uci-static.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
test/tests.d/050_show
test/tests.sh

index ce0eafc..161bae0 100644 (file)
@@ -8,6 +8,9 @@ test_get_parsing()
        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.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() {
 }
 
 prepare_get_parsing_multiline() {
index 0afccf0..ee72c31 100644 (file)
@@ -8,7 +8,7 @@ FULL_SUITE=${TESTS_DIR}"/full_suite.sh"
 
 UCI_BIN="../uci"
 [ -x $UCI_BIN ] || {
 
 UCI_BIN="../uci"
 [ -x $UCI_BIN ] || {
-       echo "uci-static is not present."
+       echo "uci is not present." >&2
        return 1
 }
 UCI="${UCI_BIN} -c ${CONFIG_DIR} -p ${CHANGES_DIR}"
        return 1
 }
 UCI="${UCI_BIN} -c ${CONFIG_DIR} -p ${CHANGES_DIR}"