aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite_dfilter/group_bytes_ipv6.py
blob: fd3b007294dd3df1a2d7a3a61d766cd60d54d7b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
#
# SPDX-License-Identifier: GPL-2.0-or-later

import unittest
import fixtures
from suite_dfilter.dfiltertest import *


@fixtures.uses_fixtures
class case_bytes_ipv6(unittest.TestCase):
    trace_file = "ipv6.pcap"

    def test_eq_1(self, checkDFilterCount):
        dfilter = "ipv6.dst == ff05::9999"
        checkDFilterCount(dfilter, 1)

    def test_eq_2(self, checkDFilterCount):
        dfilter = "ipv6.dst == ff05::9990"
        checkDFilterCount(dfilter, 0)

    def test_ne_1(self, checkDFilterCount):
        dfilter = "ipv6.dst != ff05::9990"
        checkDFilterCount(dfilter, 1)

    def test_ne_2(self, checkDFilterCount):
        dfilter = "ipv6.dst != ff05::9999"
        checkDFilterCount(dfilter, 0)

    def test_gt_1(self, checkDFilterCount):
        dfilter = "ipv6.dst > ff05::0000"
        checkDFilterCount(dfilter, 1)

    def test_gt_2(self, checkDFilterCount):
        dfilter = "ipv6.dst > ff05::9999"
        checkDFilterCount(dfilter, 0)

    def test_ge_1(self, checkDFilterCount):
        dfilter = "ipv6.dst >= ff05::9999"
        checkDFilterCount(dfilter, 1)

    def test_ge_2(self, checkDFilterCount):
        dfilter = "ipv6.dst >= ff05::a000"
        checkDFilterCount(dfilter, 0)

    def test_lt_1(self, checkDFilterCount):
        dfilter = "ipv6.dst < ff05::a000"
        checkDFilterCount(dfilter, 1)

    def test_lt_2(self, checkDFilterCount):
        dfilter = "ipv6.dst < ff05::9999"
        checkDFilterCount(dfilter, 0)

    def test_le_1(self, checkDFilterCount):
        dfilter = "ipv6.dst <= ff05::9999"
        checkDFilterCount(dfilter, 1)

    def test_le_2(self, checkDFilterCount):
        dfilter = "ipv6.dst <= ff05::9998"
        checkDFilterCount(dfilter, 0)

    def test_cidr_eq_1(self, checkDFilterCount):
        dfilter = "ipv6.dst == ff05::9999/128"
        checkDFilterCount(dfilter, 1)

    def test_cidr_eq_2(self, checkDFilterCount):
        dfilter = "ipv6.dst == ff05::0/64"
        checkDFilterCount(dfilter, 1)

    def test_cidr_eq_3(self, checkDFilterCount):
        dfilter = "ipv6.dst == ff05::ffff/112"
        checkDFilterCount(dfilter, 1)

    def test_cidr_eq_4(self, checkDFilterCount):
        dfilter = "ipv6.dst == ff04::0/64"
        checkDFilterCount(dfilter, 0)

    def test_cidr_ne_1(self, checkDFilterCount):
        dfilter = "ipv6.dst != ff05::9999/128"
        checkDFilterCount(dfilter, 0)

    def test_cidr_ne_2(self, checkDFilterCount):
        dfilter = "ipv6.dst != ff05::0/64"
        checkDFilterCount(dfilter, 0)

    def test_cidr_ne_3(self, checkDFilterCount):
        dfilter = "ipv6.dst != ff05::ffff/112"
        checkDFilterCount(dfilter, 0)

    def test_cidr_ne_4(self, checkDFilterCount):
        dfilter = "ipv6.dst != ff04::00/64"
        checkDFilterCount(dfilter, 1)

    def test_slice_1(self, checkDFilterCount):
        dfilter = "ipv6.dst[14:2] == 99:99"
        checkDFilterCount(dfilter, 1)

    def test_slice_2(self, checkDFilterCount):
        dfilter = "ipv6.dst[14:2] == 00:00"
        checkDFilterCount(dfilter, 0)

    def test_slice_3(self, checkDFilterCount):
        dfilter = "ipv6.dst[15:1] == 99"
        checkDFilterCount(dfilter, 1)

    def test_slice_4(self, checkDFilterCount):
        dfilter = "ipv6.dst[15:1] == 00"
        checkDFilterCount(dfilter, 0)