Ejemplo n.º 1
0
 def test_filter_objs(self):
     dirName = os.path.dirname(os.path.realpath(__file__))
     path = os.path.join(dirName, "tc_filter_show.out")
     with open(path) as f:
         out = f.read()
     PARSED_FILTERS = (
         tc.Filter(
             prio=49149,
             handle='803::800',
             actions=[tc.MirredAction(target='tap1')],
         ),
         tc.Filter(
             prio=49150,
             handle='802::800',
             actions=[tc.MirredAction(target='tap2')],
         ),
         tc.Filter(
             prio=49152,
             handle='800::800',
             actions=[
                 tc.MirredAction(target='target'),
                 tc.MirredAction(target='target2'),
             ],
         ),
     )
     assert tuple(tc.filters('bridge', 'parent', out=out)) == PARSED_FILTERS
Ejemplo n.º 2
0
 def test_filter_objs(self):
     dirName = os.path.dirname(os.path.realpath(__file__))
     path = os.path.join(dirName, "tc_filter_show.out")
     with open(path) as f:
         out = f.read()
     PARSED_FILTERS = (
         tc.Filter(prio=49149, handle='803::800',
                   actions=[tc.MirredAction(target='tap1')]),
         tc.Filter(prio=49150, handle='802::800',
                   actions=[tc.MirredAction(target='tap2')]),
         tc.Filter(prio=49152, handle='800::800',
                   actions=[tc.MirredAction(target='target'),
                            tc.MirredAction(target='target2')]))
     self.assertEqual(tuple(tc.filters('bridge', 'parent', out=out)),
                      PARSED_FILTERS)