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


Python setools.NodeconQuery類代碼示例

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


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

示例1: test_000_unset

    def test_000_unset(self):
        """Nodecon query with no criteria"""
        # query with no parameters gets all nodecons.
        nodecons = sorted(self.p.nodecons())

        q = NodeconQuery(self.p)
        q_nodecons = sorted(q.results())

        self.assertListEqual(nodecons, q_nodecons)
開發者ID:TresysTechnology,項目名稱:setools,代碼行數:9,代碼來源:nodeconquery.py

示例2: test_053_range_superset1

    def test_053_range_superset1(self):
        """Nodecon query with context range superset match"""
        q = NodeconQuery(self.p, range_="s3 - s3:c0.c4", range_superset=True)

        nodecons = sorted(n.address for n in q.results())
        self.assertListEqual(["10.1.53.1"], nodecons)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例3: test_050_range_exact

    def test_050_range_exact(self):
        """Nodecon query with context range exact match"""
        q = NodeconQuery(self.p, range_="s0:c1 - s0:c0.c4")

        nodecons = sorted(n.network for n in q.results())
        self.assertListEqual([IPv4Network("10.1.50.1/32")], nodecons)
開發者ID:TresysTechnology,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例4: test_040_type_exact

    def test_040_type_exact(self):
        """Nodecon query with context type exact match"""
        q = NodeconQuery(self.p, type_="type40", type_regex=False)

        nodecons = sorted(n.network for n in q.results())
        self.assertListEqual([IPv4Network("10.1.40.1/32")], nodecons)
開發者ID:TresysTechnology,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例5: test_030_role_exact

    def test_030_role_exact(self):
        """Nodecon query with context role exact match"""
        q = NodeconQuery(self.p, role="role30_r", role_regex=False)

        nodecons = sorted(n.network for n in q.results())
        self.assertListEqual([IPv4Network("10.1.30.1/32")], nodecons)
開發者ID:TresysTechnology,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例6: test_020_user_exact

    def test_020_user_exact(self):
        """Nodecon query with context user exact match"""
        q = NodeconQuery(self.p, user="user20", user_regex=False)

        nodecons = sorted(n.network for n in q.results())
        self.assertListEqual([IPv4Network("10.1.20.1/32")], nodecons)
開發者ID:TresysTechnology,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例7: test_110_v6network_equal

    def test_110_v6network_equal(self):
        """Nodecon query with IPv6 equal network"""
        q = NodeconQuery(self.p, network="1100::/16", network_overlap=False)

        nodecons = sorted(n.network for n in q.results())
        self.assertListEqual([IPv6Network("1100::/16")], nodecons)
開發者ID:TresysTechnology,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例8: test_021_user_regex

    def test_021_user_regex(self):
        """Nodecon query with context user regex match"""
        q = NodeconQuery(self.p, user="user21(a|b)", user_regex=True)

        nodecons = sorted(n.address for n in q.results())
        self.assertListEqual(["10.1.21.1", "10.1.21.2"], nodecons)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例9: test_031_role_regex

    def test_031_role_regex(self):
        """Nodecon query with context role regex match"""
        q = NodeconQuery(self.p, role="role31(a|c)_r", role_regex=True)

        nodecons = sorted(n.address for n in q.results())
        self.assertListEqual(["10.1.31.1", "10.1.31.3"], nodecons)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例10: test_101_v4network_overlap

    def test_101_v4network_overlap(self):
        """Nodecon query with IPv4 network overlap"""
        q = NodeconQuery(self.p, network="10.1.101.128/25", network_overlap=True)

        nodecons = sorted(n.address for n in q.results())
        self.assertListEqual(["10.1.101.0"], nodecons)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例11: test_001_ip_version

    def test_001_ip_version(self):
        """Nodecon query with IP version match."""
        q = NodeconQuery(self.p, ip_version=AF_INET6)

        nodecons = sorted(n.address for n in q.results())
        self.assertListEqual(["1100::", "1110::"], nodecons)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例12: test_100_v4network_equal

    def test_100_v4network_equal(self):
        """Nodecon query with IPv4 equal network"""
        q = NodeconQuery(self.p, network="10.1.100.0/24", network_overlap=False)

        nodecons = sorted(n.address for n in q.results())
        self.assertListEqual(["10.1.100.0"], nodecons)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例13: test_055_range_proper_superset3

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

        nodecons = sorted(n.address for n in q.results())
        self.assertListEqual(["10.1.55.1"], nodecons)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例14: test_054_range_proper_subset4

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

        nodecons = sorted(n.address for n in q.results())
        self.assertListEqual(["10.1.54.1"], nodecons)
開發者ID:GitForNeo,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py

示例15: test_100_v4network_equal

    def test_100_v4network_equal(self):
        """Nodecon query with IPv4 equal network"""
        q = NodeconQuery(self.p, network="192.168.1.0/24", network_overlap=False)

        nodecons = sorted(n.network for n in q.results())
        self.assertListEqual([IPv4Network("192.168.1.0/24")], nodecons)
開發者ID:TresysTechnology,項目名稱:setools,代碼行數:6,代碼來源:nodeconquery.py


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