Skip to content

Commit

Permalink
tests: Let RDMATestCase statically select test args
Browse files Browse the repository at this point in the history
In case the user doesn't pass --dev or --port test arguments, select
the first valid configuration instead of randomizing.

Signed-off-by: Edward Srouji <edwards@nvidia.com>
  • Loading branch information
EdwardSro committed Feb 14, 2021
1 parent ffa97cb commit b4ca75e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/base.py
Expand Up @@ -180,7 +180,7 @@ def get_ip_address(ifname):
def setUp(self):
"""
Verify that the test case has dev_name, ib_port, gid_index and pkey index.
If not provided by the user, a random valid combination will be used.
If not provided by the user, the first valid combination will be used.
"""
if self.pkey_index is None:
# To avoid iterating the entire pkeys table, if a pkey index wasn't
Expand Down Expand Up @@ -258,9 +258,9 @@ def _select_config(self):
if arg[3]:
args_with_inet_ip.append(arg)
if args_with_inet_ip:
args = random.choice(args_with_inet_ip)
args = args_with_inet_ip[0]
else:
args = random.choice(self.args)
args = self.args[0]
self.dev_name = args[0]
self.ib_port = args[1]
self.gid_index = args[2]
Expand Down

0 comments on commit b4ca75e

Please sign in to comment.