本文整理汇总了Python中tests.dell.enable函数的典型用法代码示例。如果您正苦于以下问题:Python enable函数的具体用法?Python enable怎么用?Python enable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了enable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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', [
""
])
示例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#")
示例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)
示例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)
示例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#")
示例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("")
示例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)
示例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)
示例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#")
示例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',
])
示例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#")
示例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)
示例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)
示例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", [
""
])
示例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)