1 # Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 from dftestlib
import dftest
22 class testRange(dftest
.DFTest
):
23 trace_file
= "ipx_rip.pcap"
25 def test_slice_1_pos(self
):
26 dfilter
= "ipx.src.node[1] == aa"
27 self
.assertDFilterCount(dfilter
, 1)
29 def test_slice_1_neg(self
):
30 dfilter
= "ipx.src.node[1] == bb"
31 self
.assertDFilterCount(dfilter
, 0)
33 def test_slice_1_hex_pos(self
):
34 dfilter
= "ipx.src.node[1] == 0xaa"
35 self
.assertDFilterCount(dfilter
, 1)
37 def test_slice_1_hex_neg(self
):
38 dfilter
= "ipx.src.node[1] == 0xbb"
39 self
.assertDFilterCount(dfilter
, 0)
41 def test_slice_2_pos(self
):
42 dfilter
= "ipx.src.node[3:2] == a3:e3"
43 self
.assertDFilterCount(dfilter
, 1)
45 def test_slice_2_neg(self
):
46 dfilter
= "ipx.src.node[3:2] == cc:dd"
47 self
.assertDFilterCount(dfilter
, 0)