mirror of
https://github.com/vishvananda/netlink.git
synced 2025-10-21 14:59:36 +08:00
Add devlink command to query devlink port list
Add devlink command to get list of devlink ports and their common attributes. Signed-off-by: Parav Pandit <parav@mellanox.com>
This commit is contained in:

committed by
Alessandro Boch

parent
ffba2c833f
commit
ff8f17bc19
@@ -40,3 +40,15 @@ func TestDevLinkSetEswitchMode(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDevLinkGetAllPortList(t *testing.T) {
|
||||
minKernelRequired(t, 5, 4)
|
||||
ports, err := DevLinkGetAllPortList()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log("devlink port count = ", len(ports))
|
||||
for _, port := range ports {
|
||||
t.Log(*port)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user