Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Juee14Desai committed Jan 31, 2024
1 parent c4ff19f commit 7b84734
Showing 1 changed file with 65 additions and 43 deletions.
108 changes: 65 additions & 43 deletions contrib/intel/jenkins/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,27 +1074,42 @@ def __init__(self, jobname, buildno, testname, hw, core_prov, fabric,
'MLX5_SCATTER_TO_CQE' : '0'
}

self.tests = {
'H2H' : [
'write',
'read',
'send'
],
'H2D' : [
'write',
'read',
'send'
],
'D2H' : [
'write',
'read',
'send'
],
'D2D' : [
'write',
'read',
'send'
]
operations = ['write', 'read', 'send']

self.single_node_combinations = {
'H2H' : {
'H' : 'H'
},
'H2D' : {
'H' : ['-d 0', '-d 1']
},
'D2H' : {
'-d 0' : 'H',
'-d 1' : 'H'
},
'D2D' : {
'-d 0' : ['-d 1', '-d 2', '-d 3'],
'-d 1' : ['-d 2', '-d 3']
}
}

self.double_node_combinations = {
'H2H' : {
'H' : 'H'
},
'H2D' : {
'H' : ['-d 0', '-d 1', '-d 2']
},
'D2H' : {
'-d 0' : 'H',
'-d 1' : 'H',
'-d 2' : 'H',
'-d 3' : 'H'
},
'D2D' : {
'-d 0' : ['-d 0', '-d 1', '-d 2', '-d 3'],
'-d 1' : ['-d 1', '-d 2', '-d 3']
}
}

@property
Expand All @@ -1114,26 +1129,33 @@ def execute_cmd(self, test_type):
os.chdir(self.DMABUFtestpath)
base_cmd = ''
log_prefix = f"{os.environ['LOG_DIR']}/dmabuf_{self.n}"
if 'H2H' in test_type or 'D2H' in test_type:
base_cmd = f"{self.cmd} -m malloc -p {self.core_prov}"
if self.n == 1:
self.tests = self.single_node_combinations
else:
base_cmd = f"{self.cmd} -m device -d 0 -p {self.core_prov}"

for test in self.tests[test_type]:
client_command = f"{base_cmd} -t {test} {self.server}"
if 'send' in test:
server_command = f"{base_cmd} -t {test} "
else:
server_command = f"{base_cmd} "
RC = common.ClientServerTest(
f"ssh {self.server} {self.dmabuf_env()} {server_command}",
f"ssh {self.client} {self.dmabuf_env()} {client_command}",
f"{log_prefix}_server.log", f"{log_prefix}_client.log",
self.timeout
).run()

if RC == (0, 0):
print("------------------ TEST COMPLETED -------------------")
else:
print("------------------ TEST FAILED -------------------")
sys.exit(f"Exiting with returncode: {RC}")
self.tests = self.double_node_combinations
for operation in operations:
for key,value in self.tests[test_type].items():
for values in value:
if 'H2H' in test_type or 'D2H' in test_type:
server_command = f"{self.cmd} -m malloc -p {self.prov}"
else:
server_command = f"{self.cmd} -m device {values} -p {self.prov}"
if 'send' in operation:
server_command += f" -t {operation}"
base_cmd = f"-t {operation} -p {self.prov} {self.server}"
if 'H2H' in test_type or 'H2D' in test_type:
client_command = f"{self.cmd} -m malloc {base_cmd}"
else:
client_command = f"{self.cmd} -m device {key} {base_cmd}"
RC = common.ClientServerTest(
f"ssh {self.server} {self.dmabuf_env()} {server_command}",
f"ssh {self.client} {self.dmabuf_env()} {client_command}",
f"{log_prefix}_server.log", f"{log_prefix}_client.log",
self.timeout
).run()

if RC == (0, 0):
print("-------------- TEST COMPLETED ---------------")
else:
print("-------------- TEST FAILED ---------------")
sys.exit(f"Exiting with returncode: {RC}")

0 comments on commit 7b84734

Please sign in to comment.