예제 #1
0
        if not check_feature(self, 'tcp'):
            return

        #  Probe a local port assumed to be open  (ssh)
        cmd = '80 send-probe ip-6 ::1 protocol tcp port 22'
        self.write_command(cmd)

        reply = self.parse_reply()
        self.assertEqual(reply.command_name, 'reply')


class TestProbeSCTP(mtrpacket.MtrPacketTest):
    'Test SCTP probes'

    def test_sctp_v4(self):
        'Test basic SCTP probes over IPv4'

        test_basic_probe(self, 4, 'sctp')

    @unittest.skipUnless(mtrpacket.HAVE_IPV6, 'No IPv6')
    def test_sctp_v6(self):
        'Test basic SCTP probes over IPv6'

        test_basic_probe(self, 6, 'sctp')


if __name__ == '__main__':
    mtrpacket.check_running_as_root()
    unittest.main()
예제 #2
0
파일: probe.py 프로젝트: russor/mtr
        if not check_feature(self, 'tcp'):
            return

        #  Probe a local port assumed to be open  (ssh)
        cmd = '80 send-probe ip-6 ::1 protocol tcp port 22'
        self.write_command(cmd)

        reply = self.parse_reply()
        self.assertEqual(reply.command_name, 'reply')


class TestProbeSCTP(mtrpacket.MtrPacketTest):
    'Test SCTP probes'

    def test_sctp_v4(self):
        'Test basic SCTP probes over IPv4'

        test_basic_probe(self, 4, 'sctp')

    @unittest.skipUnless(mtrpacket.HAVE_IPV6, 'No IPv6')
    def test_sctp_v6(self):
        'Test basic SCTP probes over IPv6'

        test_basic_probe(self, 6, 'sctp')


if __name__ == '__main__':
    mtrpacket.check_running_as_root()
    unittest.main()