forked from osmocom/wireshark
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:
parent
1d9aff7740
commit
7f80b7a2ad
|
@ -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)
|
||||
|
||||
----------------------------------------
|
||||
|
|
Loading…
Reference in New Issue