@@ -70,6 +70,11 @@ var _ = BeforeSuite(func() {
7070 masterSSHPort = "22"
7171 }
7272 masterSSHPrivateKeyFilepath = cfg .GetSSHKeyPath ()
73+ // TODO
74+ // If no user-configurable stability iteration value is passed in, run stability tests once
75+ /*if cfg.StabilityIterations == 0 {
76+ cfg.StabilityIterations = 1
77+ }*/
7378})
7479
7580var _ = Describe ("Azure Container Cluster using the Kubernetes Orchestrator" , func () {
@@ -115,13 +120,18 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
115120
116121 It ("should have stable internal container networking" , func () {
117122 name := fmt .Sprintf ("alpine-%s" , cfg .Name )
118- command := fmt .Sprintf ("nc -vz kubernetes 443" )
123+ var command string
124+ if common .IsKubernetesVersionGe (eng .ExpandedDefinition .Properties .OrchestratorProfile .OrchestratorVersion , "1.12.0" ) {
125+ command = fmt .Sprintf ("nc -vz kubernetes 443 && nc -vz kubernetes.default.svc 443 && nc -vz kubernetes.default.svc.cluster.local 443" )
126+ } else {
127+ command = fmt .Sprintf ("nc -vz kubernetes 443" )
128+ }
119129 successes , err := pod .RunCommandMultipleTimes (pod .RunLinuxPod , "alpine" , name , command , cfg .StabilityIterations )
120130 Expect (err ).NotTo (HaveOccurred ())
121131 Expect (successes ).To (Equal (cfg .StabilityIterations ))
122132 })
123133
124- It ("should have functional DNS" , func () {
134+ It ("should be able to launch a long-running container networking DNS liveness pod " , func () {
125135 if ! eng .HasNetworkPolicy ("calico" ) {
126136 var err error
127137 var p * pod.Pod
@@ -138,7 +148,9 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
138148 Expect (err ).NotTo (HaveOccurred ())
139149 Expect (running ).To (Equal (true ))
140150 }
151+ })
141152
153+ It ("should have functional host OS DNS" , func () {
142154 kubeConfig , err := GetConfig ()
143155 Expect (err ).NotTo (HaveOccurred ())
144156 master := fmt .Sprintf ("azureuser@%s" , kubeConfig .GetServerName ())
@@ -222,7 +234,9 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
222234 if err != nil {
223235 log .Printf ("Error while querying DNS: %s\n " , err )
224236 }
237+ })
225238
239+ It ("should have functional container networking DNS" , func () {
226240 By ("Ensuring that we have functional DNS resolution from a container" )
227241 j , err := job .CreateJobFromFile (filepath .Join (WorkloadDir , "validate-dns.yaml" ), "validate-dns" , "default" )
228242 Expect (err ).NotTo (HaveOccurred ())
@@ -235,16 +249,25 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
235249 Expect (err ).NotTo (HaveOccurred ())
236250 Expect (ready ).To (Equal (true ))
237251
238- By ("Ensuring that we have stable DNS resolution from a container" )
252+ By ("Ensuring that we have stable external DNS resolution from a container" )
239253 name := fmt .Sprintf ("alpine-%s" , cfg .Name )
240254 command := fmt .Sprintf ("nc -vz bbc.co.uk 80 || nc -vz google.com 443 || nc -vz microsoft.com 80" )
241255 successes , err := pod .RunCommandMultipleTimes (pod .RunLinuxPod , "alpine" , name , command , cfg .StabilityIterations )
242256 Expect (err ).NotTo (HaveOccurred ())
243257 Expect (successes ).To (Equal (cfg .StabilityIterations ))
244258 })
245259
246- It ("should have kube-dns running" , func () {
247- running , err := pod .WaitOnReady ("kube-dns" , "kube-system" , 3 , 30 * time .Second , cfg .Timeout )
260+ It ("should have DNS pod running" , func () {
261+ var err error
262+ var running bool
263+ if common .IsKubernetesVersionGe (eng .ExpandedDefinition .Properties .OrchestratorProfile .OrchestratorVersion , "1.12.0" ) {
264+ By ("Ensuring that coredns is running" )
265+ running , err = pod .WaitOnReady ("coredns" , "kube-system" , 3 , 30 * time .Second , cfg .Timeout )
266+
267+ } else {
268+ By ("Ensuring that kube-dns is running" )
269+ running , err = pod .WaitOnReady ("kube-dns" , "kube-system" , 3 , 30 * time .Second , cfg .Timeout )
270+ }
248271 Expect (err ).NotTo (HaveOccurred ())
249272 Expect (running ).To (Equal (true ))
250273 })
0 commit comments