From cbd8a4fb9c97950c7b4d7bbc6e60bd5e64746144 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Thu, 26 Sep 2013 10:40:33 -0700 Subject: [PATCH] feat(scripts/test-cluster): add a cluster test command this uses tmux to setup a test cluster that you can easily kill and start for debugging. --- .gitignore | 1 + scripts/test-cluster | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 scripts/test-cluster diff --git a/.gitignore b/.gitignore index 8459ca713..d00d899e2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ src/ pkg/ /etcd release_version.go +/machine* diff --git a/scripts/test-cluster b/scripts/test-cluster new file mode 100755 index 000000000..ccdedd1b7 --- /dev/null +++ b/scripts/test-cluster @@ -0,0 +1,19 @@ +#!/bin/bash +SESSION=etcd-cluster + +tmux new-session -d -s $SESSION + +# Setup a window for tailing log files +tmux new-window -t $SESSION:1 -n 'machines' +tmux split-window -h +tmux select-pane -t 0 +tmux send-keys "./etcd -s 127.0.0.1:7001 -c 127.0.0.1:4001 -d machine1 -n machine1" C-m + +for i in 2 3; do + tmux select-pane -t 0 + tmux split-window -v + tmux send-keys "./etcd -cors='*' -s 127.0.0.1:700${i} -c 127.0.0.1:400${i} -C 127.0.0.1:7001 -d machine${i} -n machine${i}" C-m +done + +# Attach to session +tmux attach-session -t $SESSION