test: lua: add a test for invalid ethernet address

Wslua converts an invalid ethernet address to all 0's. Add a test for
this case.

Change-Id: I59bd1f9e0b94805c563fe891b22cadd32ae054d8
Reviewed-on: https://code.wireshark.org/review/30791
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Martin Kaiser 2018-11-25 19:00:33 +01:00 committed by Anders Broman
parent 1d9aff7740
commit 7f80b7a2ad
1 changed files with 5 additions and 1 deletions

View File

@ -54,7 +54,7 @@ end
-- number of verifyFields() * (1 + number of fields) +
-- number of verifyResults() * (1 + 2 * number of values)
--
local taptests = { [FRAME]=4, [OTHER]=333 }
local taptests = { [FRAME]=4, [OTHER]=335 }
local function getResults()
print("\n-----------------------------\n")
@ -582,12 +582,16 @@ function test_proto.dissector(tvbuf,pktinfo,root)
testing(OTHER, "tree:add ether")
local tvb = ByteArray.new("010203040506"):tvb("Ether")
local tvb0 = ByteArray.new("000000000000"):tvb("Ether0")
local ether = testfield.basic.ETHER
local ether_match_fields = {}
execute ("ether", pcall (callTreeAdd, tree, ether, tvb:range(0,6)))
addMatchFields(ether_match_fields, Address.ether('01:02:03:04:05:06'))
execute ("ether0", pcall (callTreeAdd, tree, ether, tvb0:range(0,6)))
addMatchFields(ether_match_fields, Address.ether('11:22:33'))
verifyFields("basic.ETHER", ether_match_fields)
----------------------------------------