+21
test/scripts/test_interop.sh
+21
test/scripts/test_interop.sh
···
1
+
#!/bin/bash
2
+
set -e
3
+
4
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
+
REPO_ROOT="$SCRIPT_DIR/../.."
6
+
7
+
echo "Starting Go memberlist server WITHOUT encryption..."
8
+
cd "$REPO_ROOT/interop"
9
+
./memberlist-server -name go-node -port 7946 &
10
+
GO_PID=$!
11
+
sleep 2
12
+
13
+
echo "Starting OCaml SWIM client..."
14
+
cd "$REPO_ROOT"
15
+
timeout 25 ./_build/default/bin/interop_test.exe || true
16
+
17
+
echo "Killing Go server..."
18
+
kill $GO_PID 2>/dev/null || true
19
+
wait $GO_PID 2>/dev/null || true
20
+
21
+
echo "Done"
+24
test/scripts/test_interop_encrypted.sh
+24
test/scripts/test_interop_encrypted.sh
···
1
+
#!/bin/bash
2
+
set -e
3
+
4
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
+
REPO_ROOT="$SCRIPT_DIR/../.."
6
+
7
+
# Test key: 16 bytes (0x00-0x0f) in hex
8
+
TEST_KEY="000102030405060708090a0b0c0d0e0f"
9
+
10
+
echo "Starting Go memberlist server WITH encryption..."
11
+
cd "$REPO_ROOT/interop"
12
+
./memberlist-server -name go-node -port 7946 -key "$TEST_KEY" &
13
+
GO_PID=$!
14
+
sleep 2
15
+
16
+
echo "Starting OCaml SWIM client WITH encryption..."
17
+
cd "$REPO_ROOT"
18
+
timeout 25 ./_build/default/bin/interop_test.exe --encrypt || true
19
+
20
+
echo "Killing Go server..."
21
+
kill $GO_PID 2>/dev/null || true
22
+
wait $GO_PID 2>/dev/null || true
23
+
24
+
echo "Done"
+29
test/scripts/test_interop_go_joins.sh
+29
test/scripts/test_interop_go_joins.sh
···
1
+
#!/bin/bash
2
+
set -e
3
+
4
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
+
REPO_ROOT="$SCRIPT_DIR/../.."
6
+
7
+
# Test where Go node joins to OCaml node (reverse direction)
8
+
9
+
echo "Starting OCaml SWIM server..."
10
+
cd "$REPO_ROOT"
11
+
timeout 25 ./_build/default/bin/interop_test.exe &
12
+
OCAML_PID=$!
13
+
sleep 2
14
+
15
+
echo "Starting Go memberlist and joining to OCaml..."
16
+
cd "$REPO_ROOT/interop"
17
+
./memberlist-server -name go-node -port 7946 -join "127.0.0.1:7947" &
18
+
GO_PID=$!
19
+
20
+
# Let them communicate for a while
21
+
sleep 15
22
+
23
+
echo "Killing processes..."
24
+
kill $GO_PID 2>/dev/null || true
25
+
kill $OCAML_PID 2>/dev/null || true
26
+
wait $GO_PID 2>/dev/null || true
27
+
wait $OCAML_PID 2>/dev/null || true
28
+
29
+
echo "Done"
-18
test_interop.sh
-18
test_interop.sh
···
1
-
#!/bin/bash
2
-
set -e
3
-
4
-
echo "Starting Go memberlist server WITHOUT encryption..."
5
-
cd /home/gdiazlo/data/src/swim/interop
6
-
./memberlist-server -name go-node -port 7946 &
7
-
GO_PID=$!
8
-
sleep 2
9
-
10
-
echo "Starting OCaml SWIM client..."
11
-
cd /home/gdiazlo/data/src/swim
12
-
timeout 25 ./_build/default/bin/interop_test.exe || true
13
-
14
-
echo "Killing Go server..."
15
-
kill $GO_PID 2>/dev/null || true
16
-
wait $GO_PID 2>/dev/null || true
17
-
18
-
echo "Done"
-21
test_interop_encrypted.sh
-21
test_interop_encrypted.sh
···
1
-
#!/bin/bash
2
-
set -e
3
-
4
-
# Test key: 16 bytes (0x00-0x0f) in hex
5
-
TEST_KEY="000102030405060708090a0b0c0d0e0f"
6
-
7
-
echo "Starting Go memberlist server WITH encryption..."
8
-
cd /home/gdiazlo/data/src/swim/interop
9
-
./memberlist-server -name go-node -port 7946 -key "$TEST_KEY" &
10
-
GO_PID=$!
11
-
sleep 2
12
-
13
-
echo "Starting OCaml SWIM client WITH encryption..."
14
-
cd /home/gdiazlo/data/src/swim
15
-
timeout 25 ./_build/default/bin/interop_test.exe --encrypt || true
16
-
17
-
echo "Killing Go server..."
18
-
kill $GO_PID 2>/dev/null || true
19
-
wait $GO_PID 2>/dev/null || true
20
-
21
-
echo "Done"
-26
test_interop_go_joins.sh
-26
test_interop_go_joins.sh
···
1
-
#!/bin/bash
2
-
set -e
3
-
4
-
# Test where Go node joins to OCaml node (reverse direction)
5
-
6
-
echo "Starting OCaml SWIM server..."
7
-
cd /home/gdiazlo/data/src/swim
8
-
timeout 25 ./_build/default/bin/interop_test.exe &
9
-
OCAML_PID=$!
10
-
sleep 2
11
-
12
-
echo "Starting Go memberlist and joining to OCaml..."
13
-
cd /home/gdiazlo/data/src/swim/interop
14
-
./memberlist-server -name go-node -port 7946 -join "127.0.0.1:7947" &
15
-
GO_PID=$!
16
-
17
-
# Let them communicate for a while
18
-
sleep 15
19
-
20
-
echo "Killing processes..."
21
-
kill $GO_PID 2>/dev/null || true
22
-
kill $OCAML_PID 2>/dev/null || true
23
-
wait $GO_PID 2>/dev/null || true
24
-
wait $OCAML_PID 2>/dev/null || true
25
-
26
-
echo "Done"
+5
-2
test_interop_udp_only.sh
test/scripts/test_interop_udp_only.sh
+5
-2
test_interop_udp_only.sh
test/scripts/test_interop_udp_only.sh
···
1
1
#!/bin/bash
2
2
set -e
3
3
4
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
+
REPO_ROOT="$SCRIPT_DIR/../.."
6
+
4
7
# Test UDP-only communication (no TCP join)
5
8
# Both nodes start independently, OCaml adds Go to its membership
6
9
# They should then be able to gossip via UDP
7
10
8
11
echo "Starting Go memberlist server (no join)..."
9
-
cd /home/gdiazlo/data/src/swim/interop
12
+
cd "$REPO_ROOT/interop"
10
13
./memberlist-server -name go-node -port 7946 &
11
14
GO_PID=$!
12
15
sleep 2
13
16
14
17
echo "Starting OCaml SWIM client (adds Go node manually)..."
15
-
cd /home/gdiazlo/data/src/swim
18
+
cd "$REPO_ROOT"
16
19
timeout 20 ./_build/default/bin/interop_test.exe &
17
20
OCAML_PID=$!
18
21