Browse Source

e2e/docker-dns-srv: use 'etcd.local' as SRV, clean up

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Gyu-Ho Lee 8 years ago
parent
commit
d57159f79a

+ 2 - 1
Makefile

@@ -143,7 +143,7 @@ docker-dns-srv-test-build:
 	  --rm \
 	  --rm \
 	  --dns 127.0.0.1 \
 	  --dns 127.0.0.1 \
 	  gcr.io/etcd-development/etcd-dns-srv-test:$(_GO_VERSION) \
 	  gcr.io/etcd-development/etcd-dns-srv-test:$(_GO_VERSION) \
-	  /bin/bash -c "/etc/init.d/bind9 start && cat /dev/null >/etc/hosts && dig +noall +answer SRV _etcd-client._tcp.etcd-srv.local && dig +noall +answer SRV _etcd-client-ssl._tcp.etcd-srv.local && dig +noall +answer SRV _etcd-server._tcp.etcd-srv.local && dig +noall +answer SRV _etcd-server-ssl._tcp.etcd-srv.local && dig +noall +answer m1.etcd-srv.local m2.etcd-srv.local m3.etcd-srv.local"
+	  /bin/bash -c "/etc/init.d/bind9 start && cat /dev/null >/etc/hosts && dig +noall +answer SRV _etcd-client._tcp.etcd.local && dig +noall +answer SRV _etcd-server._tcp.etcd.local && dig +noall +answer m1.etcd.local m2.etcd.local m3.etcd.local"
 
 
 docker-dns-srv-test-push:
 docker-dns-srv-test-push:
 	gcloud docker -- push gcr.io/etcd-development/etcd-dns-srv-test:$(_GO_VERSION)
 	gcloud docker -- push gcr.io/etcd-development/etcd-dns-srv-test:$(_GO_VERSION)
@@ -158,6 +158,7 @@ docker-dns-srv-test-run:
 	  --tty \
 	  --tty \
 	  --dns 127.0.0.1 \
 	  --dns 127.0.0.1 \
 	  --volume=`pwd`/bin:/etcd \
 	  --volume=`pwd`/bin:/etcd \
+	  --volume=`pwd`/integration/fixtures:/certs \
 	  gcr.io/etcd-development/etcd-dns-srv-test:$(_GO_VERSION) \
 	  gcr.io/etcd-development/etcd-dns-srv-test:$(_GO_VERSION) \
 	  /bin/bash -c "cd /etcd && /run.sh && rm -rf m*.etcd"
 	  /bin/bash -c "cd /etcd && /run.sh && rm -rf m*.etcd"
 
 

+ 1 - 1
e2e/docker-dns-srv/Dockerfile

@@ -11,7 +11,7 @@ RUN chown bind /var/bind
 ADD Procfile /Procfile
 ADD Procfile /Procfile
 ADD run.sh /run.sh
 ADD run.sh /run.sh
 
 
-ADD etcd.zone named.conf /etc/bind/
+ADD named.conf etcd.zone rdns.zone /etc/bind/
 ADD resolv.conf /etc/resolv.conf
 ADD resolv.conf /etc/resolv.conf
 
 
 RUN go get github.com/mattn/goreman
 RUN go get github.com/mattn/goreman

+ 3 - 3
e2e/docker-dns-srv/Procfile

@@ -1,5 +1,5 @@
-etcd1: ./etcd --name m1 --listen-client-urls http://127.0.0.1:2379 --advertise-client-urls http://m1.etcd-srv.local:2379 --listen-peer-urls http://127.0.0.1:2380 --initial-advertise-peer-urls=http://m1.etcd-srv.local:2380 --initial-cluster-token tkn --discovery-srv=etcd-srv.local --initial-cluster-state new
+etcd1: ./etcd --name m1 --listen-client-urls http://127.0.0.1:2379 --advertise-client-urls http://m1.etcd.local:2379 --listen-peer-urls http://127.0.0.1:2380 --initial-advertise-peer-urls=http://m1.etcd.local:2380 --initial-cluster-token tkn --discovery-srv=etcd.local --initial-cluster-state new
 
 
-etcd2: ./etcd --name m2 --listen-client-urls http://127.0.0.1:22379 --advertise-client-urls http://m2.etcd-srv.local:22379 --listen-peer-urls http://127.0.0.1:22380 --initial-advertise-peer-urls=http://m2.etcd-srv.local:22380 --initial-cluster-token tkn --discovery-srv=etcd-srv.local --initial-cluster-state new
+etcd2: ./etcd --name m2 --listen-client-urls http://127.0.0.1:22379 --advertise-client-urls http://m2.etcd.local:22379 --listen-peer-urls http://127.0.0.1:22380 --initial-advertise-peer-urls=http://m2.etcd.local:22380 --initial-cluster-token tkn --discovery-srv=etcd.local --initial-cluster-state new
 
 
-etcd3: ./etcd --name m3 --listen-client-urls http://127.0.0.1:32379 --advertise-client-urls http://m3.etcd-srv.local:32379 --listen-peer-urls http://127.0.0.1:32380 --initial-advertise-peer-urls=http://m3.etcd-srv.local:32380 --initial-cluster-token tkn --discovery-srv=etcd-srv.local --initial-cluster-state new
+etcd3: ./etcd --name m3 --listen-client-urls http://127.0.0.1:32379 --advertise-client-urls http://m3.etcd.local:32379 --listen-peer-urls http://127.0.0.1:32380 --initial-advertise-peer-urls=http://m3.etcd.local:32380 --initial-cluster-token tkn --discovery-srv=etcd.local --initial-cluster-state new

+ 11 - 17
e2e/docker-dns-srv/etcd.zone

@@ -1,22 +1,16 @@
-etcd-srv.local.	IN	SOA	bindhostname. admin.etcd-srv.local. (
+etcd.local.	IN	SOA	bindhostname. admin.etcd.local. (
 1452607488
 1452607488
 10800
 10800
 3600
 3600
 604800
 604800
 38400 )
 38400 )
-etcd-srv.local.	IN	NS	bindhostname.
-m1.etcd-srv.local.	300	IN	A	127.0.0.1
-m2.etcd-srv.local.	300	IN	A	127.0.0.1
-m3.etcd-srv.local.	300	IN	A	127.0.0.1
-_etcd-client._tcp	300	IN	SRV	0 0 2379 m1.etcd-srv.local.
-_etcd-client._tcp	300	IN	SRV	0 0 22379 m2.etcd-srv.local.
-_etcd-client._tcp	300	IN	SRV	0 0 32379 m3.etcd-srv.local.
-_etcd-client-ssl._tcp	300	IN	SRV	0 0 2379 m1.etcd-srv.local.
-_etcd-client-ssl._tcp	300	IN	SRV	0 0 22379 m2.etcd-srv.local.
-_etcd-client-ssl._tcp	300	IN	SRV	0 0 32379 m3.etcd-srv.local.
-_etcd-server._tcp	300	IN	SRV	0 0 2380 m1.etcd-srv.local.
-_etcd-server._tcp	300	IN	SRV	0 0 22380 m2.etcd-srv.local.
-_etcd-server._tcp	300	IN	SRV	0 0 32380 m3.etcd-srv.local.
-_etcd-server-ssl._tcp	300	IN	SRV	0 0 2380 m1.etcd-srv.local.
-_etcd-server-ssl._tcp	300	IN	SRV	0 0 22380 m2.etcd-srv.local.
-_etcd-server-ssl._tcp	300	IN	SRV	0 0 32380 m3.etcd-srv.local.
+etcd.local.	IN	NS	bindhostname.
+m1.etcd.local.	300	IN	A	127.0.0.1
+m2.etcd.local.	300	IN	A	127.0.0.1
+m3.etcd.local.	300	IN	A	127.0.0.1
+_etcd-client._tcp	300	IN	SRV	0 0 2379 m1.etcd.local.
+_etcd-client._tcp	300	IN	SRV	0 0 22379 m2.etcd.local.
+_etcd-client._tcp	300	IN	SRV	0 0 32379 m3.etcd.local.
+_etcd-server._tcp	300	IN	SRV	0 0 2380 m1.etcd.local.
+_etcd-server._tcp	300	IN	SRV	0 0 22380 m2.etcd.local.
+_etcd-server._tcp	300	IN	SRV	0 0 32380 m3.etcd.local.

+ 6 - 1
e2e/docker-dns-srv/named.conf

@@ -12,7 +12,12 @@ options {
         recursion no;
         recursion no;
 };
 };
 
 
-zone "etcd-srv.local" IN {
+zone "etcd.local" IN {
       type master;
       type master;
       file "/etc/bind/etcd.zone";
       file "/etc/bind/etcd.zone";
 };
 };
+
+zone "0.0.127.in-addr.arpa" {
+      type master;
+      file "/etc/bind/rdns.zone";
+};

+ 13 - 0
e2e/docker-dns-srv/rdns.zone

@@ -0,0 +1,13 @@
+$TTL    86400
+@   IN  SOA  etcdns.local. root.etcdns.local. (
+             100500     ; Serial
+             604800     ; Refresh
+              86400     ; Retry
+            2419200     ; Expire
+              86400 )   ; Negative Cache TTL
+    IN  NS  ns.etcdns.local.
+    IN  A   127.0.0.1
+
+1 IN PTR m1.etcd.local.
+1 IN PTR m2.etcd.local.
+1 IN PTR m3.etcd.local.

+ 7 - 3
e2e/docker-dns-srv/run.sh

@@ -1,9 +1,13 @@
 #!/bin/sh
 #!/bin/sh
 
 
 /etc/init.d/bind9 start
 /etc/init.d/bind9 start
+
 # get rid of hosts so go lookup won't resolve 127.0.0.1 to localhost
 # get rid of hosts so go lookup won't resolve 127.0.0.1 to localhost
 cat /dev/null >/etc/hosts
 cat /dev/null >/etc/hosts
+
 goreman -f /Procfile start &
 goreman -f /Procfile start &
-sleep 5s
-./etcdctl --discovery-srv etcd-srv.local set foo bar
-ETCDCTL_API=3 ./etcdctl --discovery-srv etcd-srv.local put foo bar
+sleep 7s
+
+ETCDCTL_API=3 ./etcdctl \
+  --discovery-srv etcd.local \
+  put foo bar