• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/uci/tests/cram/test_ucilua.t

  1 set LUA_CPATH and ucilua for convenience:
  2 
  3   $ export LC_ALL=C
  4   $ [ -n "$UCI_LUA" ] && export LUA_CPATH="$(dirname "$UCI_LUA")/?.so"
  5   $ alias ucilua="valgrind --quiet --leak-check=full lua -luci"
  6 
  7 check available methods:
  8 
  9   $ ucilua -e 'table.foreach(uci,function(m) print(m) end)'
 10   add_history
 11   add_delta
 12   close
 13   set_confdir
 14   save
 15   cursor
 16   get_all
 17   foreach
 18   __gc
 19   set_savedir
 20   revert
 21   delete
 22   reorder
 23   set
 24   get_conf2dir
 25   get_savedir
 26   changes
 27   set_conf2dir
 28   get_confdir
 29   list_configs
 30   commit
 31   unload
 32   rename
 33   add
 34   load
 35   get
 36 
 37 run basic Lua tests:
 38 
 39   $ cp -R "$TESTDIR/config" .
 40   $ export CONFIG_DIR=$(pwd)/config
 41   $ ucilua $TESTDIR/lua/basic.lua
 42   ---------------
 43   enabled: off
 44   .anonymous: false
 45   ipaddr: 2.3.4.5
 46   .index: 2
 47   .name: lan
 48   test: 123
 49   .type: interface
 50   ifname: eth0
 51   proto: static
 52   ---------------
 53   .name: wan
 54   .type: interface
 55   .index: 3
 56   enabled: on
 57   ifname: eth1
 58   proto: dhcp
 59   .anonymous: false
 60   aliases: c d
 61   nil\tuci: Parse error (EOF with unterminated ') at line 1, byte 18 (esc)

This page was automatically generated by LXR 0.3.1.  •  OpenWrt