mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix some more problems with interface short names. Fixes https://github.com/GNS3/gns3-gui/issues/2562
This commit is contained in:
1 parent
e5d38811ca
commit
23e83b730b
2 files changed
+8
-5
No files matched your search
@@ -54,7 +54,7 @@ def test_list_ports(node):
|
||||
assert node.__json__()["ports"] == [
|
||||
{
|
||||
"name": "Ethernet0",
|
||||
"short_name": "e0/0",
|
||||
"short_name": "e0",
|
||||
"data_link_types": {"Ethernet": "DLT_EN10MB"},
|
||||
"port_number": 0,
|
||||
"adapter_number": 0,
|
||||
@@ -143,7 +143,7 @@ def test_list_ports_adapters(node):
|
||||
assert node.__json__()["ports"] == [
|
||||
{
|
||||
"name": "Ethernet0",
|
||||
"short_name": "e0/0",
|
||||
"short_name": "e0",
|
||||
"data_link_types": {"Ethernet": "DLT_EN10MB"},
|
||||
"port_number": 0,
|
||||
"adapter_number": 0,
|
||||
@@ -151,7 +151,7 @@ def test_list_ports_adapters(node):
|
||||
},
|
||||
{
|
||||
"name": "Ethernet1",
|
||||
"short_name": "e1/0",
|
||||
"short_name": "e1",
|
||||
"data_link_types": {"Ethernet": "DLT_EN10MB"},
|
||||
"port_number": 0,
|
||||
"adapter_number": 1,
|
||||
@@ -596,7 +596,8 @@ def test_list_ports_dynamips(project, compute):
|
||||
|
||||
def test_short_name():
|
||||
# If no customization of port name format return the default short name
|
||||
assert EthernetPort("Ethernet0", 0, 0, 0).short_name == "e0/0"
|
||||
assert EthernetPort("Ethernet0", 0, 0, 0).short_name == "e0"
|
||||
assert EthernetPort("Ethernet0", 0, 0, 0, short_name="mgmt").short_name == "mgmt"
|
||||
assert EthernetPort("Ethernet0/0", 0, 0, 0).short_name == "e0/0"
|
||||
# If port name format has change we use the port name as the short name (1.X behavior)
|
||||
assert EthernetPort("eth0", 0, 0, 0).short_name == "eth0"
|
||||
Reference in new issue
Block a user