Commit f16cdcd5 authored by Ramon Nou's avatar Ramon Nou
Browse files

port issue

parent 40e5c422
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -124,14 +124,21 @@ def test_shrink_malleability(gkfwd_daemon_factory, gkfs_client, gkfs_shell):
        assert ret.retval == 0, f"write_validate failed for {f}"

    # Build gkfs_hosts_new.txt containing only d00 (remove d01).
    # d00.address is "iface:PORT" (e.g. "lo:15680"); extract the port and
    # match it against the URI written in the hosts file
    # ("ofi+sockets://127.0.0.1:PORT ...").  Each daemon gets a unique
    # ephemeral port so this is a reliable discriminator.
    old_hostfile = Path(d00.hostfile)
    new_hostfile = old_hostfile.parent / "gkfs_hosts_new.txt"
    d00_port = d00.address.split(":")[-1]
    with open(old_hostfile) as hf_in, open(new_hostfile, "w") as hf_out:
        for line in hf_in:
            # Keep lines that belong to d00; skip d01 and comment lines
            if d00.hostname in line and not line.startswith("#"):
            if not line.startswith("#") and f":{d00_port}" in line:
                hf_out.write(line)
    assert new_hostfile.exists(), "New hosts file was not created"
    assert new_hostfile.stat().st_size > 0, \
        f"New hosts file is empty; d00 port '{d00_port}' not found in {old_hostfile}"

    libdirs = gkfs_shell._patched_env["LD_LIBRARY_PATH"]
    search_path = ":".join(str(p) for p in gkfs_shell._search_paths)