Message ID | 20191221013256.100409-1-jhubbard@nvidia.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On Fri, Dec 20, 2019 at 05:32:55PM -0800, John Hubbard wrote: > Hi, > > This came up when I was running rdma-core tests on a two-machine setup, > where each card had two ports, but there was only one cable. So only > one port on each end was connected. > > The main thing I expect to be up for debate is, what string to return > for speed, when a port is disabled or down? I initially thought about > returning '(Disabled/down)', but it seems more accurate to just report > '0.0 Gbps', so that's what I settled on. > > Background: here's what I wrote when discussing this over on linux-mm > with Leon [1]: > > It looks like this test suite assumes that every link is connected! > (Probably in most test systems, they are.) I don't remember whenever the expectation of connection is by design or outcome of mine and Jason's setups, where our cards are being connected in loopback mode (port 0 to port 1 of the same card). The loopback mode simplifies our kernel testing and development. Thanks
diff --git a/tests/test_device.py b/tests/test_device.py index 524e0e89..7b33d7db 100644 --- a/tests/test_device.py +++ b/tests/test_device.py @@ -110,6 +110,12 @@ class DeviceTest(unittest.TestCase): assert 'Invalid' not in d.translate_mtu(attr.max_mtu) assert 'Invalid' not in d.translate_mtu(attr.active_mtu) assert 'Invalid' not in d.width_to_str(attr.active_width) + print("") + print('Diagnostics ===========================================') + print('phys_state: ', d.phys_state_to_str(attr.phys_state)) + print('active_width): ', d.width_to_str(attr.active_width)) + print('active_speed: ', d.speed_to_str(attr.active_speed)) + print('END of Diagnostics ====================================') assert 'Invalid' not in d.speed_to_str(attr.active_speed) assert 'Invalid' not in d.translate_link_layer(attr.link_layer) assert attr.max_msg_sz > 0x1000