aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite-wslua.sh
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2014-03-26 02:24:51 -0400
committerAnders Broman <a.broman58@gmail.com>2014-03-26 07:37:34 +0000
commit8c2bb805742c918b933923947a533d098774da75 (patch)
treeb3859068c4fdd09bd26ab01168835a042715644b /test/suite-wslua.sh
parentda1af6e549856c8e213dadc1ec37a41a50246e1d (diff)
Add various functions for Lua directory handling and path info
This adds new functions to get plugins path info, find out if a directory exists, make a new one, remove one, etc. It also creates a file environment for user-supplied Lua scripts, to prevent global variable contamination as well as supply the script-specific file name. Some other minor cleanup was done as I found them. A new testsuite was added to test the existing and new directory functions. Change-Id: I19bd587b5e8a73d89b8521af73670e023314fb33 Reviewed-on: https://code.wireshark.org/review/832 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'test/suite-wslua.sh')
-rwxr-xr-xtest/suite-wslua.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/suite-wslua.sh b/test/suite-wslua.sh
index d6c2244746..d4eaa60489 100755
--- a/test/suite-wslua.sh
+++ b/test/suite-wslua.sh
@@ -22,6 +22,22 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
+wslua_step_dir_test() {
+ if [ $HAVE_LUA -ne 0 ]; then
+ test_step_skipped
+ return
+ fi
+
+ # Tshark catches lua script failures, so we have to parse the output.
+ $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/dir.lua > testout.txt 2>&1
+ if grep -q "All tests passed!" testout.txt; then
+ test_step_ok
+ else
+ cat testout.txt
+ test_step_failed "didn't find pass marker"
+ fi
+}
+
wslua_step_dissector_test() {
if [ $HAVE_LUA -ne 0 ]; then
test_step_skipped
@@ -358,6 +374,7 @@ wslua_cleanup_step() {
wslua_suite() {
test_step_set_pre wslua_cleanup_step
test_step_set_post wslua_cleanup_step
+ test_step_add "wslua dir" wslua_step_dir_test
test_step_add "wslua dissector" wslua_step_dissector_test
test_step_add "wslua field/fieldinfo" wslua_step_field_test
test_step_add "wslua file" wslua_step_file_test