Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
Signed-off-by: Sourav Moitra <[email protected]>
  • Loading branch information
xw19 committed Dec 13, 2024
1 parent 7f24c02 commit 9b2bc6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,18 +409,19 @@ def exec_and_get_affinity_mask(cid, exec_cpu_affinity=None):
process["execCPUAffinity"] = exec_cpu_affinity
json.dump(process, f)

print("hello 1")
out = run_crun_command(["exec", "--process", process_file, cid])
print("hello 4", out)
return cpu_mask_from_proc_status(out)

try:
with open("/proc/self/status") as f:
current_cpu_mask = cpu_mask_from_proc_status(f.read())
_, cid = run_and_get_output(conf, command='run', detach=True)

mask = exec_and_get_affinity_mask(cid)
if mask != current_cpu_mask:
sys.stderr.write("current cpu mask %s != %s\n" % (current_cpu_mask, mask))
return -1
# mask = exec_and_get_affinity_mask(cid)
# if mask != current_cpu_mask:
# sys.stderr.write("current cpu mask %s != %s\n" % (current_cpu_mask, mask))
# return -1

mask = exec_and_get_affinity_mask(cid, {"initial" : "0-1"})
if mask != "0-1":
Expand Down
1 change: 1 addition & 0 deletions tests/tests_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def run_crun_command(args):
root = get_tests_root_status()
crun = get_crun_path()
args = [crun, "--root", root] + args
print("Hello 2", args)
return subprocess.check_output(args, close_fds=False).decode()

# Similar as run_crun_command but does not performs decode of output and relays error message for further matching
Expand Down

0 comments on commit 9b2bc6d

Please sign in to comment.