030_set 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. test_set_parsing()
  2. {
  3. cp ${REF_DIR}/set_parsing.data ${CONFIG_DIR}/test
  4. assertFailWithNoReturn "${UCI_Q} set test.=val"
  5. assertFailWithNoReturn "${UCI_Q} set test.section.=val"
  6. assertFailWithNoReturn "${UCI_Q} set test.section.opt.=val"
  7. assertFailWithNoReturn "${UCI_Q} set test.section.opt.zflk=val"
  8. }
  9. test_set_named_section()
  10. {
  11. touch ${CONFIG_DIR}/set
  12. ${UCI} set set.section=named
  13. assertSameFile ${REF_DIR}/set_named_section.result ${CHANGES_DIR}/set
  14. }
  15. test_set_nonexisting_option()
  16. {
  17. cp ${REF_DIR}/set_nonexisting_option.data ${CONFIG_DIR}/set
  18. ${UCI} set set.section.opt=val
  19. assertSameFile ${REF_DIR}/set_nonexisting_option.result ${CHANGES_DIR}/set
  20. }
  21. test_set_nonexisting_option_multiline()
  22. {
  23. cp ${REF_DIR}/set_nonexisting_option.data ${CONFIG_DIR}/set
  24. ${UCI} set set.section.opt="Hello,\'
  25. World\""
  26. assertSameFile ${REF_DIR}/set_nonexisting_option_multiline.result ${CHANGES_DIR}/set
  27. }
  28. test_set_existing_option()
  29. {
  30. cp ${REF_DIR}/set_existing_option.data ${CONFIG_DIR}/set
  31. ${UCI} set set.section.opt=val
  32. assertSameFile ${REF_DIR}/set_existing_option.result ${CHANGES_DIR}/set
  33. }
  34. test_set_existing_option_multiline()
  35. {
  36. cp ${REF_DIR}/set_existing_option.data ${CONFIG_DIR}/set
  37. ${UCI} set set.section.opt="Hello,\'
  38. World\""
  39. assertSameFile ${REF_DIR}/set_existing_option_multiline.result ${CHANGES_DIR}/set
  40. }