050_show 1.3 KB

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