From d7eef6a64e16dfefc3a349b07d0116c8cc72c52c Mon Sep 17 00:00:00 2001
From: Xiang Li <xiang.li@coreos.com>
Date: Tue, 22 Jul 2014 22:49:16 -0700
Subject: [PATCH] etcd: add a bootstrap test

---
 etcd/etcd_start_test.go | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/etcd/etcd_start_test.go b/etcd/etcd_start_test.go
index 11305700c..2b4464025 100644
--- a/etcd/etcd_start_test.go
+++ b/etcd/etcd_start_test.go
@@ -98,6 +98,21 @@ func TestBadDiscoveryServiceWithAdvisedPeers(t *testing.T) {
 	afterTest(t)
 }
 
+func TestBootstrapByEmptyPeers(t *testing.T) {
+	c := config.New()
+	id := genId()
+	e, h, err := buildServer(c, id)
+
+	if err != nil {
+		t.Error(err)
+	}
+	if e.p.node.Leader() != id {
+		t.Error("leader = %x, want %x", e.p.node.Leader(), id)
+	}
+	destroyServer(e, h)
+	afterTest(t)
+}
+
 func TestBootstrapByDiscoveryService(t *testing.T) {
 	de, dh, _ := buildServer(config.New(), genId())