03_script_includes 961 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Testing the execution of include scripts.
  2. -- Testcase --
  3. {%
  4. include("./root/usr/share/firewall4/main.uc", {
  5. TRACE_CALLS: "stderr",
  6. getenv: function(varname) {
  7. switch (varname) {
  8. case 'ACTION':
  9. return 'includes';
  10. }
  11. }
  12. })
  13. %}
  14. -- End --
  15. -- File fs/open~_var_run_fw4_state.txt --
  16. {
  17. "includes": [
  18. {
  19. "enabled": true,
  20. "path": "/usr/share/miniupnpd/firewall.include",
  21. "type": "script",
  22. "fw4_compatible": true,
  23. "position": "table-append"
  24. },
  25. {
  26. "enabled": true,
  27. "path": "/etc/example.sh",
  28. "type": "script",
  29. "fw4_compatible": true,
  30. "position": "table-append"
  31. }
  32. ]
  33. }
  34. -- End --
  35. -- Expect stderr --
  36. [call] fs.open path </var/run/fw4.state> mode <r>
  37. [call] system command <[ "sh", "-c", "exec 1000>&-; config() { echo \"You cannot use UCI in firewall in..." ]> timeout <30000>
  38. [call] system command <[ "sh", "-c", "exec 1000>&-; config() { echo \"You cannot use UCI in firewall in..." ]> timeout <30000>
  39. -- End --