def test_vtysh_prompt_modes_check_4(): vars = st.get_testbed_vars() st.change_prompt(vars.D1, "normal-user") st.cli_config(vars.D1, "no shutdown", "vtysh-intf-config", interface="Ethernet40") st.cli_config(vars.D1, "receive-interval 10", "vtysh-bfd-peer-config", peer_ip="1.2.3.4") st.cli_config(vars.D1, "list", "vtysh-key-chain-config", key_chain="testkeychain") st.cli_config(vars.D1, "key-string teststring", "vtysh-key-chain-Identifier-config", key_id="1") st.cli_config(vars.D1, "vc type ethernet", "vtysh-l2vpn-config", l2vpn_name="testl2vpn") st.cli_config(vars.D1, "nexthop 1.2.3.4", "vtysh-nhgroup-config", group_name="testnhgroup") st.cli_config(vars.D1, "set nexthop 1.2.3.4", "vtysh-pbr-map-config", map_name="testpbrmap", seq_id="1") st.cli_config(vars.D1, "neighbor 1.2.3.4", "vtysh-pseudowire-config", interface="Ethernet4") st.cli_config(vars.D1, "set community none", "vtysh-route-map-config", tag_name="testroutemap", action="deny", seq_num="1") st.cli_config(vars.D1, "aggregate-address 1.2.3.4/24", "vtysh-router-config", router="bgp", instance="1") st.cli_config(vars.D1, "allow-ecmp", "vtysh-router-config", router="rip") st.cli_config(vars.D1, "aggregate-address 1.2.3.4/24", "vtysh-router-config", router="bgp", instance="1") st.cli_config(vars.D1, "bgp dampening", "vtysh-router-af-config", addr_family="ipv4", modifier="unicast") st.cli_config(vars.D1, "allow-ecmp", "vtysh-router-config", router="rip") st.cli_config(vars.D1, "bgp dampening", "vtysh-router-af-config", router="bgp", instance="1", addr_family="ipv4", modifier="unicast") st.cli_config(vars.D1, "aggregate-address 1.2.3.4/24", "vtysh-router-config", router="bgp", instance="1") st.cli_config(vars.D1, "ip protocol any route-map test", "vtysh-vrf-config", vrf_name="testvrfname") st.show(vars.D1, "show vlan config") st.report_pass("operation_successful")
def test_mgmt_cli_mode_check_2(): vars = st.get_testbed_vars() # from sonic to mgmt-cli interface mode and commands after mode change st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet4") st.cli_config(vars.D1, "shutdown") st.cli_config(vars.D1, "no shutdown") # from sonic to mgmt-cli interface mode and commands along with mode change st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet40") st.cli_config(vars.D1, "shutdown") st.cli_config(vars.D1, "no shutdown") # from mgmt-cli interface mode to mgmt-cli acl mode and commands after mode change st.change_prompt(vars.D1, "mgmt-ipv4-acl-config", aclname="MyACL") st.cli_config(vars.D1, "seq 2 permit udp any any") st.cli_config(vars.D1, "no seq 2") # from sonic to mgmt-cli interface mode with different interface st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet40") st.cli_config(vars.D1, "shutdown") st.cli_config(vars.D1, "no shutdown") st.show(vars.D1, "show interfaces status") st.report_pass("operation_successful")
def test_vtysh_prompt_modes_check_6(): vars = st.get_testbed_vars() st.change_prompt(vars.D1, "normal-user") st.change_prompt(vars.D1, "vtysh-intf-config") st.change_prompt(vars.D1, "vtysh-router-config") st.change_prompt(vars.D1, "vtysh-router-af-config") st.show(vars.D1, "show vlan config") st.report_pass("operation_successful")
def test_vtysh_prompt_modes_check_5(): vars = st.get_testbed_vars() st.change_prompt(vars.D1, "normal-user") st.cli_config(vars.D1, "list", "vtysh-intf-config", interface="Ethernet40") st.cli_config(vars.D1, "list", "vtysh-bfd-peer-config", peer_ip="1.2.3.4") st.cli_config(vars.D1, "list", "vtysh-key-chain-config", key_chain="testkeychain") st.cli_config(vars.D1, "list", "vtysh-key-chain-Identifier-config", key_id="1") st.cli_config(vars.D1, "list", "vtysh-l2vpn-config", l2vpn_name="testl2vpn") st.cli_config(vars.D1, "list", "vtysh-nhgroup-config", group_name="testnhgroup") st.cli_config(vars.D1, "list", "vtysh-pbr-map-config", map_name="testpbrmap", seq_id="1") st.cli_config(vars.D1, "list", "vtysh-pseudowire-config", interface="Ethernet4") st.cli_config(vars.D1, "list", "vtysh-route-map-config", tag_name="testroutemap", action="deny", seq_num="1") st.cli_config(vars.D1, "list", "vtysh-router-config", router="bgp", instance="1") st.cli_config(vars.D1, "list", "vtysh-router-af-config", addr_family="ipv4", modifier="unicast") st.cli_config(vars.D1, "list", "vtysh-router-config", router="rip") st.cli_config(vars.D1, "list", "vtysh-vrf-config", vrf_name="testvrfname") st.show(vars.D1, "show vlan config") st.report_pass("operation_successful")
def test_vtysh_prompt_modes_show_check_1(): vars = st.get_testbed_vars() st.show(vars.D1, "show platform summary") st.change_prompt(vars.D1, "vtysh-intf-config", interface="Ethernet40") st.cli_show(vars.D1, "show ip route") st.change_prompt(vars.D1, "vtysh-intf-config", interface="Ethernet4") st.cli_show(vars.D1, "do show ip route", skip_tmpl=True) st.change_prompt(vars.D1, "vtysh-router-config", router="bgp", instance="1") st.cli_show(vars.D1, "show route-map", skip_tmpl=True) st.change_prompt(vars.D1, "normal-user") st.cli_show(vars.D1, "show ip route") st.change_prompt(vars.D1, "vtysh-user") st.cli_show(vars.D1, "show ip route") st.show(vars.D1, "show vlan config") st.report_pass("operation_successful")
def test_mgmt_cli_modes_show_check_1(): vars = st.get_testbed_vars() # from sonic to mgmt-cli mode st.show(vars.D1, "show ip interfaces") st.change_prompt(vars.D1, "mgmt-user") st.cli_show(vars.D1, "show interface counters", skip_tmpl=True) st.change_prompt(vars.D1, "mgmt-config") st.cli_show(vars.D1, "show interface status", skip_tmpl=True) st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet40") st.cli_show(vars.D1, "show interface counters", skip_tmpl=True) st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet4") st.cli_show(vars.D1, "do show interface status", skip_tmpl=True) st.change_prompt(vars.D1, "mgmt-ipv4-acl-config", aclname="MyACL") st.cli_show(vars.D1, "show ip access-lists", skip_tmpl=True) st.show(vars.D1, "show vlan config") st.report_pass("operation_successful")
def test_vtysh_prompt_modes_check_2(): vars = st.get_testbed_vars() st.change_prompt(vars.D1, "normal-user") # from vtysh mode to normal user and back to normal user list_of_modes = ["vtysh-user", "vtysh-config", "vtysh-bfd-config", "vtysh-line-vty-config"] for tomode in list_of_modes: st.change_prompt(vars.D1, tomode) st.change_prompt(vars.D1, "normal-user") st.show(vars.D1, "show vlan config") st.report_pass("operation_successful")
def test_all_modes_check_1(): vars = st.get_testbed_vars() # from sonic to mgmt-cli mode st.show(vars.D1, "show ip interfaces") st.change_prompt(vars.D1, "mgmt-user") st.cli_show(vars.D1, "show interface status", skip_tmpl=True) # from mgmt-cli to sonic mode st.change_prompt(vars.D1, "normal-user") # from sonic to mgmt-cli interface mode st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet4") # from sonic to mgmt-cli interface mode with different interface st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet40") st.cli_show(vars.D1, "show interface status", skip_tmpl=True) st.cli_show(vars.D1, "show interface status | no-more ", skip_tmpl=True) # from mgmt-cli interface to sonic mode st.change_prompt(vars.D1, "normal-user") # from mgmt-cli interface mode to mgmt-cli acl mode and commands after mode change st.change_prompt(vars.D1, "mgmt-ipv4-acl-config", aclname="MyACL") # from sonic to mgmt-cli interface mode with different interface st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet40") # from mgmt-cli Config to various different modes and vice versa st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet4") st.show(vars.D1, "show neighbors", type="lldp") st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet4") st.vtysh_show(vars.D1, "show ip bgp") st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet4") st.vtysh_config(vars.D1, "do show ip bgp") st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet4") st.show(vars.D1, "show interfaces status") # from mgmt-cli normal mode to various different modes and vice versa st.change_prompt(vars.D1, "mgmt-user") st.show(vars.D1, "show neighbors", type="lldp") st.change_prompt(vars.D1, "mgmt-user") st.vtysh_show(vars.D1, "show ip bgp") st.change_prompt(vars.D1, "mgmt-user") st.vtysh_config(vars.D1, "do show ip bgp") st.change_prompt(vars.D1, "mgmt-user") st.show(vars.D1, "show interfaces status") # from lldp mode to remaining modes and vice versa st.show(vars.D1, "show neighbors", type="lldp") st.vtysh_show(vars.D1, "show ip bgp") st.show(vars.D1, "show neighbors", type="lldp") st.vtysh_config(vars.D1, "do show ip bgp") st.show(vars.D1, "show neighbors", type="lldp") st.show(vars.D1, "show interfaces status") # from vtysh config mode to remaining modes and vice versa st.vtysh_config(vars.D1, "do show ip bgp") st.vtysh_show(vars.D1, "show ip route") st.vtysh_config(vars.D1, "do show ip bgp") st.show(vars.D1, "show interfaces status") # from vtysh mode to remaining modes and vice versa st.vtysh_show(vars.D1, "show ip bgp") st.show(vars.D1, "show interfaces status") st.report_pass("operation_successful")
def test_vtysh_mgmt_prompt_modes_check_2(): vars = st.get_testbed_vars() st.show(vars.D1, "show platform summary") st.change_prompt(vars.D1, "vtysh-user") st.cli_show(vars.D1, "show ip route") st.change_prompt(vars.D1, "mgmt-user") st.cli_show(vars.D1, "show interface counters", skip_tmpl=True) st.change_prompt(vars.D1, "vtysh-user") st.cli_show(vars.D1, "show ip route") st.change_prompt(vars.D1, "normal-user") st.change_prompt(vars.D1, "vtysh-intf-config", interface="Ethernet40") st.cli_config(vars.D1, "shutdown") st.cli_config(vars.D1, "no shutdown") st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet4") st.cli_config(vars.D1, "shutdown") st.cli_config(vars.D1, "no shutdown") st.cli_show(vars.D1, "show interface counters", skip_tmpl=True) st.change_prompt(vars.D1, "vtysh-intf-config", interface="Ethernet40") st.cli_config(vars.D1, "shutdown") st.cli_config(vars.D1, "no shutdown") st.change_prompt(vars.D1, "normal-user") st.change_prompt(vars.D1, "vtysh-router-config", router="bgp", instance="1") st.cli_config(vars.D1, "aggregate-address 1.2.3.4/24") st.change_prompt(vars.D1, "mgmt-ipv4-acl-config", aclname="MyACL") st.cli_config(vars.D1, "seq 2 permit udp any any") st.cli_config(vars.D1, "no seq 2") st.cli_show(vars.D1, "show interface counters", skip_tmpl=True) st.change_prompt(vars.D1, "vtysh-router-config", router="bgp", instance="1") st.cli_config(vars.D1, "aggregate-address 1.2.3.4/24") st.show(vars.D1, "show vlan config") st.report_pass("operation_successful")
def test_vtysh_mgmt_prompt_modes_check_1(): vars = st.get_testbed_vars() st.show(vars.D1, "show platform summary") st.change_prompt(vars.D1, "vtysh-user") st.change_prompt(vars.D1, "mgmt-user") st.change_prompt(vars.D1, "vtysh-user") st.change_prompt(vars.D1, "normal-user") st.change_prompt(vars.D1, "vtysh-intf-config", interface="Ethernet40") st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet4") st.change_prompt(vars.D1, "vtysh-intf-config", interface="Ethernet40") st.change_prompt(vars.D1, "normal-user") st.change_prompt(vars.D1, "vtysh-router-config", router="bgp", instance="1") st.change_prompt(vars.D1, "mgmt-ipv4-acl-config", aclname="MyACL") st.change_prompt(vars.D1, "vtysh-router-config", router="bgp", instance="1") st.show(vars.D1, "show vlan config") st.report_pass("operation_successful")
def test_vtysh_prompt_modes_check_1(): vars = st.get_testbed_vars() st.change_prompt(vars.D1, "normal-user") # from vtysh mode to normal user and back to normal user st.change_prompt(vars.D1, "vtysh-user") st.change_prompt(vars.D1, "normal-user") # from sonic to vtysh config mode and back to normal user st.change_prompt(vars.D1, "vtysh-config") st.change_prompt(vars.D1, "normal-user") st.change_prompt(vars.D1, "vtysh-intf-config", interface="Ethernet40") st.change_prompt(vars.D1, "vtysh-intf-config", interface="Ethernet4") st.change_prompt(vars.D1, "vtysh-intf-config", interface="Ethernet40") st.change_prompt(vars.D1, "vtysh-user") # from sonic to vtysh router config mode and back to normal user st.change_prompt(vars.D1, "vtysh-router-config", router="bgp", instance="1") st.change_prompt(vars.D1, "vtysh-router-af-config", addr_family="ipv4", modifier="unicast") st.change_prompt(vars.D1, "vtysh-router-config", router="rip") st.change_prompt(vars.D1, "vtysh-user") st.change_prompt(vars.D1, "vtysh-router-config", router="bgp", instance="1") st.change_prompt(vars.D1, "vtysh-router-af-config", addr_family="ipv4", modifier="unicast") st.change_prompt(vars.D1, "vtysh-router-config", router="rip") # using vtysh_show and back to normal user st.vtysh_show(vars.D1, "show ip prefix-list", skip_tmpl=True) st.change_prompt(vars.D1, "normal-user") st.show(vars.D1, "show interfaces status") st.report_pass("operation_successful")
def test_mgmt_cli_mode_check_1(): vars = st.get_testbed_vars() # from sonic to mgmt-cli mode st.show(vars.D1, "show ip interfaces") st.change_prompt(vars.D1, "mgmt-user") # from mgmt-cli to sonic mode st.change_prompt(vars.D1, "normal-user") # from sonic to mgmt-cli interface mode st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet4") # from sonic to mgmt-cli interface mode with different interface st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet40") # from mgmt-cli interface to sonic mode st.change_prompt(vars.D1, "normal-user") # from mgmt-cli interface mode to mgmt-cli acl mode and commands after mode change st.change_prompt(vars.D1, "mgmt-ipv4-acl-config", aclname="MyACL") # from sonic to mgmt-cli interface mode with different interface st.change_prompt(vars.D1, "mgmt-intf-config", interface="Ethernet40") st.show(vars.D1, "show interfaces status") st.report_pass("operation_successful")