2019-11-17 14:11:31 +00:00
|
|
|
import ./make-test-python.nix (
|
|
|
|
{ ... }:
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2018-02-10 07:52:03 +00:00
|
|
|
let
|
2018-07-20 20:56:59 +00:00
|
|
|
node =
|
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
2018-02-10 07:52:03 +00:00
|
|
|
networking = {
|
|
|
|
firewall = {
|
|
|
|
allowedUDPPorts = [ 4791 ]; # open RoCE port
|
|
|
|
allowedTCPPorts = [ 4800 ]; # port for test utils
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
|
|
|
rxe = {
|
2018-02-10 07:52:03 +00:00
|
|
|
enable = true;
|
|
|
|
interfaces = [ "eth1" ];
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-10 07:52:03 +00:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
rdma-core
|
2024-12-10 19:26:33 +00:00
|
|
|
screen
|
|
|
|
];
|
2018-02-10 07:52:03 +00:00
|
|
|
};
|
|
|
|
|
2019-11-20 19:47:45 +00:00
|
|
|
in
|
2024-12-10 19:26:33 +00:00
|
|
|
{
|
2019-11-20 19:47:45 +00:00
|
|
|
name = "rxe";
|
2018-02-10 07:52:03 +00:00
|
|
|
|
|
|
|
nodes = {
|
|
|
|
server = node;
|
|
|
|
client = node;
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
2018-02-10 07:52:03 +00:00
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
# Test if rxe interface comes up
|
2019-11-17 14:11:31 +00:00
|
|
|
server.wait_for_unit("default.target")
|
|
|
|
server.succeed("systemctl status rxe.service")
|
2020-02-28 09:06:37 +00:00
|
|
|
server.succeed("ibv_devices | grep rxe_eth1")
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2019-11-17 14:11:31 +00:00
|
|
|
client.wait_for_unit("default.target")
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2019-11-20 19:47:45 +00:00
|
|
|
# ping pong tests
|
|
|
|
for proto in "rc", "uc", "ud", "srq":
|
|
|
|
server.succeed(
|
|
|
|
"screen -dmS {0}_pingpong ibv_{0}_pingpong -p 4800 -s 1024 -g0".format(proto)
|
2024-12-10 19:26:33 +00:00
|
|
|
)
|
2019-11-20 19:47:45 +00:00
|
|
|
client.succeed("sleep 2; ibv_{}_pingpong -p 4800 -s 1024 -g0 server".format(proto))
|
2024-12-10 19:26:33 +00:00
|
|
|
|
2019-11-17 14:11:31 +00:00
|
|
|
server.succeed("screen -dmS rping rping -s -a server -C 10")
|
|
|
|
client.succeed("sleep 2; rping -c -a server -C 10")
|
2024-12-10 19:26:33 +00:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|