From b034852b345d39cf4dc0a2f8d7adbcdc4930480f Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Fri, 14 Mar 2025 12:32:34 -0400 Subject: [PATCH] add testing script --- .gitignore | 1 + test.bash | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .gitignore create mode 100755 test.bash diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f5daeb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/chord-node diff --git a/test.bash b/test.bash new file mode 100755 index 0000000..f884f98 --- /dev/null +++ b/test.bash @@ -0,0 +1,19 @@ +#!/bin/bash + +set -ex + +go build -o ./chord-node + +# Test create and join. +./chord-node join -ip 127.0.0.1:3000 & +FIRST=$! +sleep 3 + +./chord-node join -ip 127.0.0.1:3001 -c 127.0.0.1:3000 & +SECOND=$! +./chord-node join -ip 127.0.0.1:3002 -c 127.0.0.1:3000 & +THIRD=$! + +sleep 5 +# Each node logs its predecessor and successors. At this point, we see the ring. +kill $FIRST $SECOND $THIRD