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

Python dell.enable函数代码示例

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

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



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

示例1: test_access_vlan_that_doesnt_exist_prints_a_warning_and_config_is_unchanged

    def test_access_vlan_that_doesnt_exist_prints_a_warning_and_config_is_unchanged(self, t):
        enable(t)
        configure(t)

        t.write("interface ethernet 1/g1")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")

        t.write("switchport access vlan 1200")
        t.readln("Warning: The use of large numbers of VLANs or interfaces may cause significant")
        t.readln("delays in applying the configuration.")
        t.readln("")
        t.readln("")
        t.readln("VLAN ID not found.")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch#")

        assert_interface_configuration(t, 'ethernet 1/g1', [
            ""
        ])
开发者ID:idjaw,项目名称:fake-switches,代码行数:28,代码来源:test_configure_interface.py


示例2: test_show_running_config_on_empty_ethernet_port

    def test_show_running_config_on_empty_ethernet_port(self, t):
        enable(t)

        t.write("show running-config interface ethernet 1/g1")
        t.readln("")
        t.readln("")
        t.read("my_switch#")
开发者ID:emmurd,项目名称:fake-switches,代码行数:7,代码来源:test_enabled.py


示例3: test_show_vlan_id

    def test_show_vlan_id(self, t):
        enable(t)

        configuring_vlan(t, 1000)

        t.write("show vlan id 500")
        t.readln("")
        t.readln("ERROR: This VLAN does not exist.")
        t.readln("")
        t.read("my_switch#")

        t.write("show vlan id 1000")
        t.readln("")
        t.readln("VLAN       Name                         Ports          Type      Authorization")
        t.readln("-----  ---------------                  -------------  -----     -------------")
        t.readln("1000                                                   Static    Required     ")
        t.readln("")
        t.read("my_switch#")

        t.write("show vlan id bleh")
        t.readln("                     ^")
        t.readln("Invalid input. Please specify an integer in the range 1 to 4093.")
        t.readln("")
        t.read("my_switch#")

        t.write("show vlan id")
        t.readln("")
        t.readln("Command not found / Incomplete command. Use ? to list commands.")
        t.readln("")
        t.read("my_switch#")

        unconfigure_vlan(t, 1000)
开发者ID:emmurd,项目名称:fake-switches,代码行数:32,代码来源:test_enabled.py


示例4: test_editing_vlan

    def test_editing_vlan(self, t):
        enable(t)
        configure(t)

        t.write("interface vlan 1260")
        t.readln("VLAN ID not found.")
        t.readln("")

        t.read("my_switch(config)#")
        t.write("exit")
        t.readln("")
        t.read("my_switch#")

        configuring_vlan(t, 1260)

        configure(t)
        t.write("interface vlan 1260")
        t.readln("")
        t.read("my_switch(config-if-vlan1260)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")

        unconfigure_vlan(t, 1260)
开发者ID:fbouliane,项目名称:fake-switches,代码行数:25,代码来源:test_configure.py


示例5: test_unconfiguring_a_vlan_failing

    def test_unconfiguring_a_vlan_failing(self, t):
        enable(t)

        t.write("configure")
        t.readln("")
        t.read("my_switch(config)#")

        t.write("vlan database")
        t.readln("")
        t.read("my_switch(config-vlan)#")

        t.write("no vlan 3899")
        t.readln("Warning: The use of large numbers of VLANs or interfaces may cause significant")
        t.readln("delays in applying the configuration.")
        t.readln("")
        t.readln("")
        t.readln("These VLANs do not exist:  3899.")
        t.readln("")

        t.read("my_switch(config-vlan)#")
        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")
        t.write("exit")
        t.readln("")
        t.read("my_switch#")
开发者ID:emmurd,项目名称:fake-switches,代码行数:26,代码来源:test_configure_vlan.py


示例6: test_invalid_command

    def test_invalid_command(self, t):
        enable(t)

        t.write("shizzle")
        t.readln("          ^")
        t.readln("% Invalid input detected at '^' marker.")
        t.readln("")
开发者ID:emmurd,项目名称:fake-switches,代码行数:7,代码来源:test_enabled.py


示例7: test_show_interfaces_status

    def test_show_interfaces_status(self, t):
        enable(t)

        create_bond(t, 1)
        create_bond(t, 2)
        create_bond(t, 3)
        create_bond(t, 4)
        create_bond(t, 5)
        create_bond(t, 6)
        create_bond(t, 7)
        create_bond(t, 8)
        create_bond(t, 9)
        create_bond(t, 10)

        t.write("show interfaces status")
        t.readln("")
        t.readln("Port   Type                            Duplex  Speed    Neg  Link  Flow Control")
        t.readln("                                                             State Status")
        t.readln("-----  ------------------------------  ------  -------  ---- --------- ------------")
        t.readln("1/g1   Gigabit - Level                 Full    Unknown  Auto Down      Inactive")
        t.readln("1/g2   Gigabit - Level                 Full    Unknown  Auto Down      Inactive")
        t.readln("1/xg1  10G - Level                     Full    Unknown  Auto Down      Inactive")
        t.readln("2/g1   Gigabit - Level                 Full    Unknown  Auto Down      Inactive")
        t.readln("2/g2   Gigabit - Level                 Full    Unknown  Auto Down      Inactive")
        t.readln("2/xg1  10G - Level                     Full    Unknown  Auto Down      Inactive")
        t.readln("")
        t.readln("")
        t.readln("Ch   Type                            Link")
        t.readln("                                     State")
        t.readln("---  ------------------------------  -----")
        t.readln("ch1  Link Aggregate                  Down")
        t.readln("ch2  Link Aggregate                  Down")
        t.readln("ch3  Link Aggregate                  Down")
        t.readln("ch4  Link Aggregate                  Down")
        t.readln("ch5  Link Aggregate                  Down")
        t.readln("ch6  Link Aggregate                  Down")
        t.readln("ch7  Link Aggregate                  Down")
        t.readln("ch8  Link Aggregate                  Down")
        t.read("--More-- or (q)uit")
        t.write_raw("m")
        t.readln("")
        t.readln("ch9  Link Aggregate                  Down")
        t.readln("ch10 Link Aggregate                  Down")
        t.readln("")
        t.readln("Flow Control:Enabled")
        t.readln("")
        t.read("my_switch#")

        remove_bond(t, 1)
        remove_bond(t, 2)
        remove_bond(t, 3)
        remove_bond(t, 4)
        remove_bond(t, 5)
        remove_bond(t, 6)
        remove_bond(t, 7)
        remove_bond(t, 8)
        remove_bond(t, 9)
        remove_bond(t, 10)
开发者ID:idjaw,项目名称:fake-switches,代码行数:58,代码来源:test_configure_interface.py


示例8: test_no_switchport_mode_in_general_mode

    def test_no_switchport_mode_in_general_mode(self, t):
        enable(t)

        configuring_vlan(t, 1264)

        configure(t)
        t.write("interface ethernet 1/g1")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")
        t.write("switchport mode general")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")
        t.write("switchport general pvid 1264")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")

        t.write("switchport general allowed vlan add 1264")

        t.readln("Warning: The use of large numbers of VLANs or interfaces may cause significant")
        t.readln("delays in applying the configuration.")
        t.readln("")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch#")

        assert_interface_configuration(t, 'ethernet 1/g1', [
            "switchport mode general",
            "switchport general pvid 1264",
            "switchport general allowed vlan add 1264",
        ])

        configure(t)
        t.write("interface ethernet 1/g1")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")
        t.write("no switchport mode")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")
        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch#")

        assert_interface_configuration(t, 'ethernet 1/g1', [
            "",
        ])

        unconfigure_vlan(t, 1264)
开发者ID:stephanerobert,项目名称:fake-switches,代码行数:58,代码来源:test_configure_interface.py


示例9: test_show_running_config_on_ethernet_port_that_does_not_exists

    def test_show_running_config_on_ethernet_port_that_does_not_exists(self, t):
        enable(t)

        t.write("show running-config interface ethernet 4/g8")
        t.readln("")
        t.read("ERROR: Invalid input!")
        t.readln("")
        t.readln("")
        t.read("my_switch#")
开发者ID:emmurd,项目名称:fake-switches,代码行数:9,代码来源:test_enabled.py


示例10: test_show_running_config_displays_header

 def test_show_running_config_displays_header(self, t):
     enable(t)
     assert_running_config_contains_in_order(t, [
         '!Current Configuration:',
         '!System Description "PowerConnect 6224P, 3.3.7.3, VxWorks 6.5"',
         '!System Software Version 3.3.7.3',
         '!Cut-through mode is configured as disabled',
         '!',
         'configure',
     ])
开发者ID:emmurd,项目名称:fake-switches,代码行数:10,代码来源:test_enabled.py


示例11: test_entering_configure_mode

    def test_entering_configure_mode(self, t):
        enable(t)

        t.write("configure")
        t.readln("")
        t.read("my_switch(config)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch#")
开发者ID:emmurd,项目名称:fake-switches,代码行数:10,代码来源:test_enabled.py


示例12: test_switchport_general_pvid

    def test_switchport_general_pvid(self, t):
        enable(t)

        configuring_vlan(t, 1264)

        t.write("configure")
        t.readln("")
        t.read("my_switch(config)#")
        t.write("interface ethernet 1/g1")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")

        t.write("switchport general pvid 1264")
        t.readln("")
        t.readln("Port is not general port.")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")

        t.write("switchport mode general")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")

        t.write("switchport general pvid 1500")
        t.readln("Could not configure pvid.")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")

        t.write("switchport general pvid 1264")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")
        t.write("exit")
        t.readln("")
        t.read("my_switch#")

        assert_interface_configuration(t, 'ethernet 1/g1', [
            "switchport mode general",
            "switchport general pvid 1264"
        ])

        configuring_interface(t, "ethernet 1/g1", do="no switchport general pvid")
        assert_interface_configuration(t, 'ethernet 1/g1', [
            "switchport mode general",
        ])

        configuring_interface(t, "ethernet 1/g1", do="switchport mode access")
        assert_interface_configuration(t, 'ethernet 1/g1', [
            "",
        ])

        unconfigure_vlan(t, 1264)
开发者ID:idjaw,项目名称:fake-switches,代码行数:54,代码来源:test_configure_interface.py


示例13: test_switchport_add_remove_general_trunk_vlans

    def test_switchport_add_remove_general_trunk_vlans(self, t):
        enable(t)

        configuring_vlan(t, 1200)
        configuring_vlan(t, 1201)
        configuring_vlan(t, 1202)
        configuring_vlan(t, 1203)
        configuring_vlan(t, 1205)

        configuring_interface(t, "ethernet 1/g1", do="switchport mode general")
        configuring_a_vlan_on_interface(t, "ethernet 1/g1", do="switchport general allowed vlan add 1200")
        assert_interface_configuration(t, 'ethernet 1/g1', [
            "switchport mode general",
            "switchport general allowed vlan add 1200",
        ])

        configuring_a_vlan_on_interface(t, "ethernet 1/g1", do="switchport general allowed vlan add 1200,1201")
        assert_interface_configuration(t, 'ethernet 1/g1', [
            "switchport mode general",
            "switchport general allowed vlan add 1200-1201",
        ])

        configuring_a_vlan_on_interface(t, "ethernet 1/g1", do="switchport general allowed vlan add 1201-1203,1205")
        assert_interface_configuration(t, 'ethernet 1/g1', [
            "switchport mode general",
            "switchport general allowed vlan add 1200-1203,1205",
        ])

        configuring_a_vlan_on_interface(t, "ethernet 1/g1", do="switchport general allowed vlan remove 1202")
        assert_interface_configuration(t, 'ethernet 1/g1', [
            "switchport mode general",
            "switchport general allowed vlan add 1200-1201,1203,1205",
        ])

        configuring_a_vlan_on_interface(t, "ethernet 1/g1", do="switchport general allowed vlan remove 1203,1205")
        assert_interface_configuration(t, 'ethernet 1/g1', [
            "switchport mode general",
            "switchport general allowed vlan add 1200-1201",
        ])

        configuring_a_vlan_on_interface(t, "ethernet 1/g1", do="switchport general allowed vlan remove 1200-1203")
        assert_interface_configuration(t, 'ethernet 1/g1', [
            "switchport mode general",
        ])

        configuring_interface(t, "ethernet 1/g1", do="switchport mode access")

        unconfigure_vlan(t, 1200)
        unconfigure_vlan(t, 1201)
        unconfigure_vlan(t, 1202)
        unconfigure_vlan(t, 1203)
        unconfigure_vlan(t, 1205)
开发者ID:idjaw,项目名称:fake-switches,代码行数:52,代码来源:test_configure_interface.py


示例14: test_shutting_down

    def test_shutting_down(self, t):
        enable(t)
        configuring_interface(t, "ethernet 1/g1", do="shutdown")

        assert_interface_configuration(t, "ethernet 1/g1", [
            "shutdown"
        ])

        configuring_interface(t, "ethernet 1/g1", do="no shutdown")

        assert_interface_configuration(t, "ethernet 1/g1", [
            ""
        ])
开发者ID:idjaw,项目名称:fake-switches,代码行数:13,代码来源:test_configure_interface.py


示例15: test_show_vlan_id_with_ports

    def test_show_vlan_id_with_ports(self, t):
        enable(t)

        configuring_vlan(t, 1000)
        configuring_interface(t, "ethernet 1/g1", do="switchport mode access")
        configuring_a_vlan_on_interface(t, "ethernet 1/g1", do="switchport access vlan 1000")

        t.write("show vlan id 1000")
        t.readln("")
        t.readln("VLAN       Name                         Ports          Type      Authorization")
        t.readln("-----  ---------------                  -------------  -----     -------------")
        t.readln("1000                                    1/g1           Static    Required     ")
        t.readln("")
        t.read("my_switch#")

        configuring_interface(t, "ethernet 1/g1", do="switchport mode trunk")
        t.write("show vlan id 1000")
        t.readln("")
        t.readln("VLAN       Name                         Ports          Type      Authorization")
        t.readln("-----  ---------------                  -------------  -----     -------------")
        t.readln("1000                                                   Static    Required     ")
        t.readln("")
        t.read("my_switch#")

        configuring_a_vlan_on_interface(t, "ethernet 1/g1", do="switchport trunk allowed vlan add 1000")
        configuring_interface(t, "ethernet 1/g2", do="switchport mode trunk")
        configuring_a_vlan_on_interface(t, "ethernet 1/g2", do="switchport trunk allowed vlan add 1000")
        t.write("show vlan id 1000")
        t.readln("")
        t.readln("VLAN       Name                         Ports          Type      Authorization")
        t.readln("-----  ---------------                  -------------  -----     -------------")
        t.readln("1000                                    1/g1-1/g2      Static    Required     ")
        t.readln("")
        t.read("my_switch#")

        configuring_interface(t, "ethernet 1/xg1", do="switchport mode trunk")
        configuring_a_vlan_on_interface(t, "ethernet 1/xg1", do="switchport trunk allowed vlan add 1000")
        t.write("show vlan id 1000")
        t.readln("")
        t.readln("VLAN       Name                         Ports          Type      Authorization")
        t.readln("-----  ---------------                  -------------  -----     -------------")
        t.readln("1000                                    1/g1-1/g2,     Static    Required     ")
        t.readln("                                        1/xg1                                 ")
        t.readln("")
        t.read("my_switch#")

        configuring_interface(t, "ethernet 1/g1", do="switchport mode access")
        configuring_interface(t, "ethernet 1/g2", do="switchport mode access")
        configuring_interface(t, "ethernet 1/xg1", do="switchport mode access")

        unconfigure_vlan(t, 1000)
开发者ID:emmurd,项目名称:fake-switches,代码行数:51,代码来源:test_enabled.py


示例16: test_access_vlan

    def test_access_vlan(self, t):
        enable(t)

        configuring_vlan(t, 1264)

        configure(t)
        t.write("interface ethernet 1/g1")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")
        t.write("switchport access vlan 1264")
        t.readln("Warning: The use of large numbers of VLANs or interfaces may cause significant")
        t.readln("delays in applying the configuration.")
        t.readln("")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")
        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch#")

        assert_interface_configuration(t, 'ethernet 1/g1', [
            "switchport access vlan 1264",
        ])

        configure(t)
        t.write("interface ethernet 1/g1")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")
        t.write("no switchport access vlan")
        t.readln("Warning: The use of large numbers of VLANs or interfaces may cause significant")
        t.readln("delays in applying the configuration.")
        t.readln("")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")
        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch#")

        assert_interface_configuration(t, 'ethernet 1/g1', [
            ""
        ])

        unconfigure_vlan(t, 1264)
开发者ID:idjaw,项目名称:fake-switches,代码行数:50,代码来源:test_configure_interface.py


示例17: test_mtu_on_bond

    def test_mtu_on_bond(self, t):
        enable(t)

        create_bond(t, 1)

        configure(t)
        t.write("interface port-channel 1")
        t.readln("")
        t.read("my_switch(config-if-ch1)#")
        t.write("mtu what")
        t.readln("                            ^")
        t.readln("Invalid input. Please specify an integer in the range 1518 to 9216.")
        t.read("my_switch(config-if-ch1)#")
        t.write("mtu 1517")
        t.readln("                            ^")
        t.readln("Value is out of range. The valid range is 1518 to 9216.")
        t.read("my_switch(config-if-ch1)#")
        t.write("mtu 9217")
        t.readln("                            ^")
        t.readln("Value is out of range. The valid range is 1518 to 9216.")
        t.read("my_switch(config-if-ch1)#")
        t.write("mtu 5000 lol")
        t.readln("                                  ^")
        t.readln("% Invalid input detected at '^' marker.")
        t.readln("")
        t.read("my_switch(config-if-ch1)#")
        t.write("mtu 5000")
        t.readln("")
        t.read("my_switch(config-if-ch1)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch#")

        assert_interface_configuration(t, "port-channel 1", [
            "mtu 5000"
        ])

        configuring_bond(t, "port-channel 1", do="no mtu")

        assert_interface_configuration(t, "port-channel 1", [
            ""
        ])

        remove_bond(t, 1)
开发者ID:idjaw,项目名称:fake-switches,代码行数:49,代码来源:test_configure_interface.py


示例18: test_entering_vlan_database_mode

    def test_entering_vlan_database_mode(self, t):
        enable(t)
        configure(t)

        t.write("vlan database")
        t.readln("")
        t.read("my_switch(config-vlan)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch#")
开发者ID:fbouliane,项目名称:fake-switches,代码行数:15,代码来源:test_configure.py


示例19: test_write_memory_any_other_key_aborts

    def test_write_memory_any_other_key_aborts(self, t):
        enable(t)

        t.write("copy running-config startup-config")

        t.readln("")
        t.readln("This operation may take a few minutes.")
        t.readln("Management interfaces will not be available during this time.")
        t.readln("")
        t.read("Are you sure you want to save? (y/n) ")
        t.write_raw("p")
        t.readln("")
        t.readln("")
        t.readln("Configuration Not Saved!")
        t.read("my_switch#")
开发者ID:emmurd,项目名称:fake-switches,代码行数:15,代码来源:test_enabled.py


示例20: test_entering_configure_interface_mode

    def test_entering_configure_interface_mode(self, t):
        enable(t)
        configure(t)

        t.write("interface ethernet 1/g1")
        t.readln("")
        t.read("my_switch(config-if-1/g1)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch(config)#")

        t.write("exit")
        t.readln("")
        t.read("my_switch#")
开发者ID:fbouliane,项目名称:fake-switches,代码行数:15,代码来源:test_configure.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python dell10g.enable函数代码示例发布时间:2022-05-27
下一篇:
Python users.john函数代码示例发布时间: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