Initial commit
This commit is contained in:
commit
4eef3a1d5a
153 changed files with 178754 additions and 0 deletions
5
lib/uci/test/tests.d/000_import
Normal file
5
lib/uci/test/tests.d/000_import
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
test_import ()
|
||||
{
|
||||
${UCI} import < ${REF_DIR}/import.data
|
||||
assertSameFile ${REF_DIR}/import.result ${CONFIG_DIR}/import
|
||||
}
|
||||
6
lib/uci/test/tests.d/010_export
Normal file
6
lib/uci/test/tests.d/010_export
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
test_export ()
|
||||
{
|
||||
cp ${REF_DIR}/export.data ${CONFIG_DIR}/export
|
||||
${UCI} export > ${TMP_DIR}/export.result
|
||||
assertSameFile ${REF_DIR}/export.result ${TMP_DIR}/export.result
|
||||
}
|
||||
39
lib/uci/test/tests.d/020_get
Normal file
39
lib/uci/test/tests.d/020_get
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
test_get_parsing()
|
||||
{
|
||||
cp ${REF_DIR}/get_parsing.data ${CONFIG_DIR}/test
|
||||
|
||||
assertFailWithNoReturn "${UCI_Q} get test."
|
||||
assertFailWithNoReturn "${UCI_Q} get test.section."
|
||||
assertFailWithNoReturn "${UCI_Q} get test.section.opt."
|
||||
assertFailWithNoReturn "${UCI_Q} get test.section.opt.val."
|
||||
assertFailWithNoReturn "${UCI_Q} get test.section.opt.val.qsdf.qsd"
|
||||
assertFailWithNoReturn "${UCI_Q} get test.section.opt.valqsqsd"
|
||||
}
|
||||
|
||||
test_get_section_index_parsing()
|
||||
{
|
||||
cp ${REF_DIR}/get_parsing.data ${CONFIG_DIR}/test
|
||||
|
||||
assertFailWithNoReturn "${UCI_Q} get test.@"
|
||||
assertFailWithNoReturn "${UCI_Q} get test.@zer."
|
||||
assertFailWithNoReturn "${UCI_Q} get test.@."
|
||||
assertFailWithNoReturn "${UCI_Q} get test.@zer[1]"
|
||||
assertFailWithNoReturn "${UCI_Q} get test.@.opt"
|
||||
assertFailWithNoReturn "${UCI_Q} get test.@[28]"
|
||||
assertFailWithNoReturn "${UCI_Q} get test.@[1]."
|
||||
assertFailWithNoReturn "${UCI_Q} get test.@[1].val."
|
||||
}
|
||||
|
||||
test_get_option()
|
||||
{
|
||||
cp ${REF_DIR}/get.data ${CONFIG_DIR}/test
|
||||
value=$($UCI get test.section.opt)
|
||||
assertEquals 'val' "$value"
|
||||
}
|
||||
|
||||
test_get_section()
|
||||
{
|
||||
cp ${REF_DIR}/get.data ${CONFIG_DIR}/test
|
||||
type=$($UCI get test.section)
|
||||
assertEquals 'type' "$type"
|
||||
}
|
||||
30
lib/uci/test/tests.d/030_set
Normal file
30
lib/uci/test/tests.d/030_set
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
test_set_parsing()
|
||||
{
|
||||
cp ${REF_DIR}/set_parsing.data ${CONFIG_DIR}/test
|
||||
|
||||
assertFailWithNoReturn "${UCI_Q} set test.=val"
|
||||
assertFailWithNoReturn "${UCI_Q} set test.section.=val"
|
||||
assertFailWithNoReturn "${UCI_Q} set test.section.opt.=val"
|
||||
assertFailWithNoReturn "${UCI_Q} set test.section.opt.zflk=val"
|
||||
}
|
||||
|
||||
test_set_named_section()
|
||||
{
|
||||
touch ${CONFIG_DIR}/set
|
||||
${UCI} set set.section=named
|
||||
assertSameFile ${REF_DIR}/set_named_section.result ${CHANGES_DIR}/set
|
||||
}
|
||||
|
||||
test_set_nonexisting_option()
|
||||
{
|
||||
cp ${REF_DIR}/set_nonexisting_option.data ${CONFIG_DIR}/set
|
||||
${UCI} set set.section.opt=val
|
||||
assertSameFile ${REF_DIR}/set_nonexisting_option.result ${CHANGES_DIR}/set
|
||||
}
|
||||
|
||||
test_set_existing_option()
|
||||
{
|
||||
cp ${REF_DIR}/set_existing_option.data ${CONFIG_DIR}/set
|
||||
${UCI} set set.section.opt=val
|
||||
assertSameFile ${REF_DIR}/set_existing_option.result ${CHANGES_DIR}/set
|
||||
}
|
||||
8
lib/uci/test/tests.d/040_add
Normal file
8
lib/uci/test/tests.d/040_add
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
test_add_section()
|
||||
{
|
||||
touch ${CONFIG_DIR}/add
|
||||
section_name=$(${UCI} add add type)
|
||||
assertNotNull "uci add does not return a section name." $section_name
|
||||
sed 's/section/'$section_name'/' ${REF_DIR}/add_section.result > ${TMP_DIR}/add_section.result
|
||||
assertSameFile ${TMP_DIR}/add_section.result ${CHANGES_DIR}/add
|
||||
}
|
||||
11
lib/uci/test/tests.d/050_show
Normal file
11
lib/uci/test/tests.d/050_show
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
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"
|
||||
}
|
||||
9
lib/uci/test/tests.d/060-ucimap_example
Normal file
9
lib/uci/test/tests.d/060-ucimap_example
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
test_ucimap_example()
|
||||
{
|
||||
rm -rf ./save
|
||||
( cd ..; ./ucimap-example -s ) > "${TMP_DIR}/ucimap_example.result"
|
||||
assertSameFile "${TMP_DIR}/ucimap_example.result" "${REF_DIR}/ucimap_example_1.result"
|
||||
( cd ..; ./ucimap-example -s ) > "${TMP_DIR}/ucimap_example.result"
|
||||
assertSameFile "${TMP_DIR}/ucimap_example.result" "${REF_DIR}/ucimap_example_2.result"
|
||||
rm -rf ./save
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue