當前位置: 首頁>>代碼示例>>Python>>正文


Python setools.IoportconQuery類代碼示例

本文整理匯總了Python中setools.IoportconQuery的典型用法代碼示例。如果您正苦於以下問題:Python IoportconQuery類的具體用法?Python IoportconQuery怎麽用?Python IoportconQuery使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了IoportconQuery類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_045_range_proper_superset3

    def test_045_range_proper_superset3(self):
        """Portcon query with context range proper superset match (equal low)"""
        q = IoportconQuery(self.p,
                           range_="s5:c1 - s5:c1.c4", range_superset=True, range_proper=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(45, 45)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:7,代碼來源:ioportconquery.py

示例2: test_044_range_proper_subset4

    def test_044_range_proper_subset4(self):
        """Portcon query with context range proper subset match (equal high only)"""
        q = IoportconQuery(self.p,
                           range_="s4:c1,c2 - s4:c1.c3", range_subset=True, range_proper=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(44, 44)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:7,代碼來源:ioportconquery.py

示例3: test_058_single_proper_superset_edge3

    def test_058_single_proper_superset_edge3(self):
        """Portcon query with single port proper superset, high equal edge case"""
        q = IoportconQuery(
            self.p, ports=(50800, 50801), ports_superset=True, ports_proper=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(50801, 50801)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:7,代碼來源:ioportconquery.py

示例4: test_059_range_proper_superset_edge3

    def test_059_range_proper_superset_edge3(self):
        """Portcon query with range proper superset, equal low port edge case"""
        q = IoportconQuery(
            self.p, ports=(50901, 50911), ports_superset=True, ports_proper=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(50901, 50910)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:7,代碼來源:ioportconquery.py

示例5: test_055_range_proper_subset_edge3

    def test_055_range_proper_subset_edge3(self):
        """Portcon query with range proper subset, high equal edge case"""
        q = IoportconQuery(
            self.p, ports=(50501, 50510), ports_subset=True, ports_proper=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(50500, 50510)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:7,代碼來源:ioportconquery.py

示例6: test_054_single_proper_subset

    def test_054_single_proper_subset(self):
        """Portcon query with single port proper subset"""
        q = IoportconQuery(
            self.p, ports=(50400, 50400), ports_subset=True, ports_proper=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:7,代碼來源:ioportconquery.py

示例7: test_000_unset

    def test_000_unset(self):
        """Ioportcon query with no criteria"""
        # query with no parameters gets all ports.
        rules = sorted(self.p.ioportcons())

        q = IoportconQuery(self.p)
        q_rules = sorted(q.results())

        self.assertListEqual(rules, q_rules)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:9,代碼來源:ioportconquery.py

示例8: test_062_range_overlap_high_half

    def test_062_range_overlap_high_half(self):
        """Portcon query with range overlap, high half match"""
        q = IoportconQuery(self.p, ports=(60205, 60211), ports_overlap=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(60200, 60210)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:ioportconquery.py

示例9: test_061_range_overlap_low_half

    def test_061_range_overlap_low_half(self):
        """Portcon query with range overlap, low half match"""
        q = IoportconQuery(self.p, ports=(60100, 60105), ports_overlap=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(60101, 60110)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:ioportconquery.py

示例10: test_060_single_overlap_edge3

    def test_060_single_overlap_edge3(self):
        """Portcon query with single overlap, range match proper superset"""
        q = IoportconQuery(self.p, ports=(60000, 60002), ports_overlap=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(60001, 60001)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:ioportconquery.py

示例11: test_010_user_exact

    def test_010_user_exact(self):
        """Portcon query with context user exact match"""
        q = IoportconQuery(self.p, user="user10", user_regex=False)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(10, 10)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:ioportconquery.py

示例12: test_051_range_equal

    def test_051_range_equal(self):
        """Portcon query with port range exact match"""
        q = IoportconQuery(self.p, ports=(50100, 50110))

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(50100, 50110)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:ioportconquery.py

示例13: test_020_role_exact

    def test_020_role_exact(self):
        """Portcon query with context role exact match"""
        q = IoportconQuery(self.p, role="role20_r", role_regex=False)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(20, 20)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:ioportconquery.py

示例14: test_065_range_overlap_superset

    def test_065_range_overlap_superset(self):
        """Portcon query with range overlap, superset match"""
        q = IoportconQuery(self.p, ports=(60500, 60510), ports_overlap=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(60501, 60509)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:ioportconquery.py

示例15: test_057_range_superset_edge1

    def test_057_range_superset_edge1(self):
        """Portcon query with range superset, equal edge case"""
        q = IoportconQuery(self.p, ports=(50700, 50710), ports_superset=True)

        ports = sorted(p.ports for p in q.results())
        self.assertListEqual([(50700, 50710)], ports)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:ioportconquery.py


注:本文中的setools.IoportconQuery類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。