• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python setools.NodeconQuery类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中setools.NodeconQuery的典型用法代码示例。如果您正苦于以下问题:Python NodeconQuery类的具体用法?Python NodeconQuery怎么用?Python NodeconQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了NodeconQuery类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: test_041_type_regex

    def test_041_type_regex(self):
        """Nodecon query with context type regex match"""
        q = NodeconQuery(self.p, type_="type41(b|c)", type_regex=True)

        nodecons = sorted(n.address for n in q.results())
        self.assertListEqual(["10.1.41.2", "10.1.41.3"], nodecons)
开发者ID:GitForNeo,项目名称:setools,代码行数:6,代码来源:nodeconquery.py


示例17: test_101_v4network_overlap

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

        nodecons = sorted(n.network for n in q.results())
        self.assertListEqual([IPv4Network("192.168.200.0/22")], nodecons)
开发者ID:TresysTechnology,项目名称:setools,代码行数:6,代码来源:nodeconquery.py


示例18: 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.address for n in q.results())
        self.assertListEqual(["10.1.50.1"], nodecons)
开发者ID:GitForNeo,项目名称:setools,代码行数:6,代码来源:nodeconquery.py


示例19: test_111_v6network_overlap

    def test_111_v6network_overlap(self):
        """Nodecon query with IPv6 network overlap"""
        q = NodeconQuery(self.p, network="1110:8000::/17", network_overlap=True)

        nodecons = sorted(n.network for n in q.results())
        self.assertListEqual([IPv6Network("1110::/16")], nodecons)
开发者ID:TresysTechnology,项目名称:setools,代码行数:6,代码来源:nodeconquery.py


示例20: test_052_range_subset1

    def test_052_range_subset1(self):
        """Nodecon query with context range subset match"""
        q = NodeconQuery(self.p, range_="s2:c1,c2 - s2:c0.c3", range_overlap=True)

        nodecons = sorted(n.network for n in q.results())
        self.assertListEqual([IPv4Network("10.1.52.1/32")], nodecons)
开发者ID:TresysTechnology,项目名称:setools,代码行数:6,代码来源:nodeconquery.py



注:本文中的setools.NodeconQuery类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python setools.PermissionMap类代码示例发布时间:2022-05-27
下一篇:
Python setools.MLSRuleQuery类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap