def testRewriteDestPorts(self): match = Match('tcp', '--destination-port 1234') self.assertEqual(match.options(), {'dport': ['1234']})
def testRewriteDestPorts(self): match = Match('multiport', '--destination-ports 1,2,3') self.assertEqual(match.options(), {'dports': ['1,2,3']})
def testRewriteSourcePort(self): match = Match('tcp', '--source-port 1234') self.assertEqual(match.options(), {'sport': ['1234']})
def testRewriteSourcePorts(self): match = Match('multiport', '--source-ports 1,2,3') self.assertEqual(match.options(), {'sports': ['1,2,3']})
def testRewriteDestPort(self): print('Running Test Rewrite Dest Port...') match = Match('tcp', '--destination-port 1234') print('\tMatch: ' + str(match)) self.assertEqual(match.options(), {'dport': ['1234']}) print('...Done')
def testRewriteDestPorts(self): print('Runnning Test Rewrite Dest Ports...') match = Match('multiport', '--destination-ports 1,2,3') print('\tMatch: ' + str(match)) self.assertEqual(match.options(), {'dports': ['1,2,3']}) print('...Done')
def testRewriteDestPorts(self): match = Match("multiport", "--destination-ports 1,2,3") self.assertEqual(match.options(), {"dports": ["1,2,3"]})
def testRewriteSourcePort(self): print('Match Test Case Set:\nRunning Test Rewrite Source Port...') match = Match('tcp', '--source-port 1234') print('\tMatch: ' + str(match)) self.assertEqual(match.options(), {'sport': ['1234']}) print('...Done')
def testRewriteSourcePorts(self): match = Match("multiport", "--source-ports 1,2,3") self.assertEqual(match.options(), {"sports": ["1,2,3"]})
def testRewriteDestPorts(self): match = Match("tcp", "--destination-port 1234") self.assertEqual(match.options(), {"dport": ["1234"]})
def testRewriteSourcePort(self): match = Match("tcp", "--source-port 1234") self.assertEqual(match.options(), {"sport": ["1234"]})