dns.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. /*
  2. Copyright 2015 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package e2e
  14. import (
  15. "fmt"
  16. "strings"
  17. "time"
  18. . "github.com/onsi/ginkgo"
  19. . "github.com/onsi/gomega"
  20. "k8s.io/kubernetes/pkg/api"
  21. "k8s.io/kubernetes/pkg/api/pod"
  22. "k8s.io/kubernetes/pkg/api/unversioned"
  23. "k8s.io/kubernetes/pkg/apimachinery/registered"
  24. client "k8s.io/kubernetes/pkg/client/unversioned"
  25. "k8s.io/kubernetes/pkg/labels"
  26. "k8s.io/kubernetes/pkg/util/uuid"
  27. "k8s.io/kubernetes/pkg/util/wait"
  28. "k8s.io/kubernetes/test/e2e/framework"
  29. )
  30. const dnsTestPodHostName = "dns-querier-1"
  31. const dnsTestServiceName = "dns-test-service"
  32. var dnsServiceLabelSelector = labels.Set{
  33. "k8s-app": "kube-dns",
  34. "kubernetes.io/cluster-service": "true",
  35. }.AsSelector()
  36. func createDNSPod(namespace, wheezyProbeCmd, jessieProbeCmd string, useAnnotation bool) *api.Pod {
  37. dnsPod := &api.Pod{
  38. TypeMeta: unversioned.TypeMeta{
  39. Kind: "Pod",
  40. APIVersion: registered.GroupOrDie(api.GroupName).GroupVersion.String(),
  41. },
  42. ObjectMeta: api.ObjectMeta{
  43. Name: "dns-test-" + string(uuid.NewUUID()),
  44. Namespace: namespace,
  45. },
  46. Spec: api.PodSpec{
  47. Volumes: []api.Volume{
  48. {
  49. Name: "results",
  50. VolumeSource: api.VolumeSource{
  51. EmptyDir: &api.EmptyDirVolumeSource{},
  52. },
  53. },
  54. },
  55. Containers: []api.Container{
  56. // TODO: Consider scraping logs instead of running a webserver.
  57. {
  58. Name: "webserver",
  59. Image: "gcr.io/google_containers/test-webserver:e2e",
  60. Ports: []api.ContainerPort{
  61. {
  62. Name: "http",
  63. ContainerPort: 80,
  64. },
  65. },
  66. VolumeMounts: []api.VolumeMount{
  67. {
  68. Name: "results",
  69. MountPath: "/results",
  70. },
  71. },
  72. },
  73. {
  74. Name: "querier",
  75. Image: "gcr.io/google_containers/dnsutils:e2e",
  76. Command: []string{"sh", "-c", wheezyProbeCmd},
  77. VolumeMounts: []api.VolumeMount{
  78. {
  79. Name: "results",
  80. MountPath: "/results",
  81. },
  82. },
  83. },
  84. {
  85. Name: "jessie-querier",
  86. Image: "gcr.io/google_containers/jessie-dnsutils:e2e",
  87. Command: []string{"sh", "-c", jessieProbeCmd},
  88. VolumeMounts: []api.VolumeMount{
  89. {
  90. Name: "results",
  91. MountPath: "/results",
  92. },
  93. },
  94. },
  95. },
  96. },
  97. }
  98. if useAnnotation {
  99. dnsPod.ObjectMeta.Annotations = map[string]string{
  100. pod.PodHostnameAnnotation: dnsTestPodHostName,
  101. pod.PodSubdomainAnnotation: dnsTestServiceName,
  102. }
  103. } else {
  104. dnsPod.Spec.Hostname = dnsTestPodHostName
  105. dnsPod.Spec.Subdomain = dnsTestServiceName
  106. }
  107. return dnsPod
  108. }
  109. func createProbeCommand(namesToResolve []string, hostEntries []string, ptrLookupIP string, fileNamePrefix, namespace string) (string, []string) {
  110. fileNames := make([]string, 0, len(namesToResolve)*2)
  111. probeCmd := "for i in `seq 1 600`; do "
  112. for _, name := range namesToResolve {
  113. // Resolve by TCP and UDP DNS. Use $$(...) because $(...) is
  114. // expanded by kubernetes (though this won't expand so should
  115. // remain a literal, safe > sorry).
  116. lookup := "A"
  117. if strings.HasPrefix(name, "_") {
  118. lookup = "SRV"
  119. }
  120. fileName := fmt.Sprintf("%s_udp@%s", fileNamePrefix, name)
  121. fileNames = append(fileNames, fileName)
  122. probeCmd += fmt.Sprintf(`test -n "$$(dig +notcp +noall +answer +search %s %s)" && echo OK > /results/%s;`, name, lookup, fileName)
  123. fileName = fmt.Sprintf("%s_tcp@%s", fileNamePrefix, name)
  124. fileNames = append(fileNames, fileName)
  125. probeCmd += fmt.Sprintf(`test -n "$$(dig +tcp +noall +answer +search %s %s)" && echo OK > /results/%s;`, name, lookup, fileName)
  126. }
  127. for _, name := range hostEntries {
  128. fileName := fmt.Sprintf("%s_hosts@%s", fileNamePrefix, name)
  129. fileNames = append(fileNames, fileName)
  130. probeCmd += fmt.Sprintf(`test -n "$$(getent hosts %s)" && echo OK > /results/%s;`, name, fileName)
  131. }
  132. podARecByUDPFileName := fmt.Sprintf("%s_udp@PodARecord", fileNamePrefix)
  133. podARecByTCPFileName := fmt.Sprintf("%s_tcp@PodARecord", fileNamePrefix)
  134. probeCmd += fmt.Sprintf(`podARec=$$(hostname -i| awk -F. '{print $$1"-"$$2"-"$$3"-"$$4".%s.pod.cluster.local"}');`, namespace)
  135. probeCmd += fmt.Sprintf(`test -n "$$(dig +notcp +noall +answer +search $${podARec} A)" && echo OK > /results/%s;`, podARecByUDPFileName)
  136. probeCmd += fmt.Sprintf(`test -n "$$(dig +tcp +noall +answer +search $${podARec} A)" && echo OK > /results/%s;`, podARecByTCPFileName)
  137. fileNames = append(fileNames, podARecByUDPFileName)
  138. fileNames = append(fileNames, podARecByTCPFileName)
  139. if len(ptrLookupIP) > 0 {
  140. ptrLookup := fmt.Sprintf("%s.in-addr.arpa.", strings.Join(reverseArray(strings.Split(ptrLookupIP, ".")), "."))
  141. ptrRecByUDPFileName := fmt.Sprintf("%s_udp@PTR", ptrLookupIP)
  142. ptrRecByTCPFileName := fmt.Sprintf("%s_tcp@PTR", ptrLookupIP)
  143. probeCmd += fmt.Sprintf(`test -n "$$(dig +notcp +noall +answer +search %s PTR)" && echo OK > /results/%s;`, ptrLookup, ptrRecByUDPFileName)
  144. probeCmd += fmt.Sprintf(`test -n "$$(dig +tcp +noall +answer +search %s PTR)" && echo OK > /results/%s;`, ptrLookup, ptrRecByTCPFileName)
  145. fileNames = append(fileNames, ptrRecByUDPFileName)
  146. fileNames = append(fileNames, ptrRecByTCPFileName)
  147. }
  148. probeCmd += "sleep 1; done"
  149. return probeCmd, fileNames
  150. }
  151. // createTargetedProbeCommand returns a command line that performs a DNS lookup for a specific record type
  152. func createTargetedProbeCommand(nameToResolve string, lookup string, fileNamePrefix string) (string, string) {
  153. fileName := fmt.Sprintf("%s_udp@%s", fileNamePrefix, nameToResolve)
  154. probeCmd := fmt.Sprintf("dig +short +tries=12 +norecurse %s %s > /results/%s", nameToResolve, lookup, fileName)
  155. return probeCmd, fileName
  156. }
  157. func assertFilesExist(fileNames []string, fileDir string, pod *api.Pod, client *client.Client) {
  158. assertFilesContain(fileNames, fileDir, pod, client, false, "")
  159. }
  160. func assertFilesContain(fileNames []string, fileDir string, pod *api.Pod, client *client.Client, check bool, expected string) {
  161. var failed []string
  162. framework.ExpectNoError(wait.Poll(time.Second*2, time.Second*60, func() (bool, error) {
  163. failed = []string{}
  164. subResourceProxyAvailable, err := framework.ServerVersionGTE(framework.SubResourcePodProxyVersion, client)
  165. if err != nil {
  166. return false, err
  167. }
  168. var contents []byte
  169. for _, fileName := range fileNames {
  170. if subResourceProxyAvailable {
  171. contents, err = client.Get().
  172. Namespace(pod.Namespace).
  173. Resource("pods").
  174. SubResource("proxy").
  175. Name(pod.Name).
  176. Suffix(fileDir, fileName).
  177. Do().Raw()
  178. } else {
  179. contents, err = client.Get().
  180. Prefix("proxy").
  181. Resource("pods").
  182. Namespace(pod.Namespace).
  183. Name(pod.Name).
  184. Suffix(fileDir, fileName).
  185. Do().Raw()
  186. }
  187. if err != nil {
  188. framework.Logf("Unable to read %s from pod %s: %v", fileName, pod.Name, err)
  189. failed = append(failed, fileName)
  190. } else if check && strings.TrimSpace(string(contents)) != expected {
  191. framework.Logf("File %s from pod %s contains '%s' instead of '%s'", fileName, pod.Name, string(contents), expected)
  192. failed = append(failed, fileName)
  193. }
  194. }
  195. if len(failed) == 0 {
  196. return true, nil
  197. }
  198. framework.Logf("Lookups using %s failed for: %v\n", pod.Name, failed)
  199. return false, nil
  200. }))
  201. Expect(len(failed)).To(Equal(0))
  202. }
  203. func validateDNSResults(f *framework.Framework, pod *api.Pod, fileNames []string) {
  204. By("submitting the pod to kubernetes")
  205. podClient := f.Client.Pods(f.Namespace.Name)
  206. defer func() {
  207. By("deleting the pod")
  208. defer GinkgoRecover()
  209. podClient.Delete(pod.Name, api.NewDeleteOptions(0))
  210. }()
  211. if _, err := podClient.Create(pod); err != nil {
  212. framework.Failf("Failed to create %s pod: %v", pod.Name, err)
  213. }
  214. framework.ExpectNoError(f.WaitForPodRunning(pod.Name))
  215. By("retrieving the pod")
  216. pod, err := podClient.Get(pod.Name)
  217. if err != nil {
  218. framework.Failf("Failed to get pod %s: %v", pod.Name, err)
  219. }
  220. // Try to find results for each expected name.
  221. By("looking for the results for each expected name from probers")
  222. assertFilesExist(fileNames, "results", pod, f.Client)
  223. // TODO: probe from the host, too.
  224. framework.Logf("DNS probes using %s succeeded\n", pod.Name)
  225. }
  226. func validateTargetedProbeOutput(f *framework.Framework, pod *api.Pod, fileNames []string, value string) {
  227. By("submitting the pod to kubernetes")
  228. podClient := f.Client.Pods(f.Namespace.Name)
  229. defer func() {
  230. By("deleting the pod")
  231. defer GinkgoRecover()
  232. podClient.Delete(pod.Name, api.NewDeleteOptions(0))
  233. }()
  234. if _, err := podClient.Create(pod); err != nil {
  235. framework.Failf("Failed to create %s pod: %v", pod.Name, err)
  236. }
  237. framework.ExpectNoError(f.WaitForPodRunning(pod.Name))
  238. By("retrieving the pod")
  239. pod, err := podClient.Get(pod.Name)
  240. if err != nil {
  241. framework.Failf("Failed to get pod %s: %v", pod.Name, err)
  242. }
  243. // Try to find the expected value for each expected name.
  244. By("looking for the results for each expected name from probers")
  245. assertFilesContain(fileNames, "results", pod, f.Client, true, value)
  246. framework.Logf("DNS probes using %s succeeded\n", pod.Name)
  247. }
  248. func verifyDNSPodIsRunning(f *framework.Framework) {
  249. systemClient := f.Client.Pods(api.NamespaceSystem)
  250. By("Waiting for DNS Service to be Running")
  251. options := api.ListOptions{LabelSelector: dnsServiceLabelSelector}
  252. dnsPods, err := systemClient.List(options)
  253. if err != nil {
  254. framework.Failf("Failed to list all dns service pods")
  255. }
  256. if len(dnsPods.Items) < 1 {
  257. framework.Failf("No pods match the label selector %v", dnsServiceLabelSelector.String())
  258. }
  259. pod := dnsPods.Items[0]
  260. framework.ExpectNoError(framework.WaitForPodRunningInNamespace(f.Client, &pod))
  261. }
  262. func createServiceSpec(serviceName, externalName string, isHeadless bool, selector map[string]string) *api.Service {
  263. headlessService := &api.Service{
  264. ObjectMeta: api.ObjectMeta{
  265. Name: serviceName,
  266. },
  267. Spec: api.ServiceSpec{
  268. Selector: selector,
  269. },
  270. }
  271. if externalName != "" {
  272. headlessService.Spec.Type = api.ServiceTypeExternalName
  273. headlessService.Spec.ExternalName = externalName
  274. } else {
  275. headlessService.Spec.Ports = []api.ServicePort{
  276. {Port: 80, Name: "http", Protocol: "TCP"},
  277. }
  278. }
  279. if isHeadless {
  280. headlessService.Spec.ClusterIP = "None"
  281. }
  282. return headlessService
  283. }
  284. func reverseArray(arr []string) []string {
  285. for i := 0; i < len(arr)/2; i++ {
  286. j := len(arr) - i - 1
  287. arr[i], arr[j] = arr[j], arr[i]
  288. }
  289. return arr
  290. }
  291. var _ = framework.KubeDescribe("DNS", func() {
  292. f := framework.NewDefaultFramework("dns")
  293. It("should provide DNS for the cluster [Conformance]", func() {
  294. // All the names we need to be able to resolve.
  295. // TODO: Spin up a separate test service and test that dns works for that service.
  296. namesToResolve := []string{
  297. "kubernetes.default",
  298. "kubernetes.default.svc",
  299. "kubernetes.default.svc.cluster.local",
  300. "google.com",
  301. }
  302. // Added due to #8512. This is critical for GCE and GKE deployments.
  303. if framework.ProviderIs("gce", "gke") {
  304. namesToResolve = append(namesToResolve, "metadata")
  305. }
  306. hostFQDN := fmt.Sprintf("%s.%s.%s.svc.cluster.local", dnsTestPodHostName, dnsTestServiceName, f.Namespace.Name)
  307. hostEntries := []string{hostFQDN, dnsTestPodHostName}
  308. wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, hostEntries, "", "wheezy", f.Namespace.Name)
  309. jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, hostEntries, "", "jessie", f.Namespace.Name)
  310. By("Running these commands on wheezy: " + wheezyProbeCmd + "\n")
  311. By("Running these commands on jessie: " + jessieProbeCmd + "\n")
  312. // Run a pod which probes DNS and exposes the results by HTTP.
  313. By("creating a pod to probe DNS")
  314. pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, true)
  315. validateDNSResults(f, pod, append(wheezyFileNames, jessieFileNames...))
  316. })
  317. It("should provide DNS for services [Conformance]", func() {
  318. // Create a test headless service.
  319. By("Creating a test headless service")
  320. testServiceSelector := map[string]string{
  321. "dns-test": "true",
  322. }
  323. headlessService := createServiceSpec(dnsTestServiceName, "", true, testServiceSelector)
  324. _, err := f.Client.Services(f.Namespace.Name).Create(headlessService)
  325. Expect(err).NotTo(HaveOccurred())
  326. defer func() {
  327. By("deleting the test headless service")
  328. defer GinkgoRecover()
  329. f.Client.Services(f.Namespace.Name).Delete(headlessService.Name)
  330. }()
  331. regularService := createServiceSpec("test-service-2", "", false, testServiceSelector)
  332. regularService, err = f.Client.Services(f.Namespace.Name).Create(regularService)
  333. Expect(err).NotTo(HaveOccurred())
  334. defer func() {
  335. By("deleting the test service")
  336. defer GinkgoRecover()
  337. f.Client.Services(f.Namespace.Name).Delete(regularService.Name)
  338. }()
  339. // All the names we need to be able to resolve.
  340. // TODO: Create more endpoints and ensure that multiple A records are returned
  341. // for headless service.
  342. namesToResolve := []string{
  343. fmt.Sprintf("%s", headlessService.Name),
  344. fmt.Sprintf("%s.%s", headlessService.Name, f.Namespace.Name),
  345. fmt.Sprintf("%s.%s.svc", headlessService.Name, f.Namespace.Name),
  346. fmt.Sprintf("_http._tcp.%s.%s.svc", headlessService.Name, f.Namespace.Name),
  347. fmt.Sprintf("_http._tcp.%s.%s.svc", regularService.Name, f.Namespace.Name),
  348. }
  349. wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "wheezy", f.Namespace.Name)
  350. jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "jessie", f.Namespace.Name)
  351. By("Running these commands on wheezy: " + wheezyProbeCmd + "\n")
  352. By("Running these commands on jessie: " + jessieProbeCmd + "\n")
  353. // Run a pod which probes DNS and exposes the results by HTTP.
  354. By("creating a pod to probe DNS")
  355. pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, false)
  356. pod.ObjectMeta.Labels = testServiceSelector
  357. validateDNSResults(f, pod, append(wheezyFileNames, jessieFileNames...))
  358. })
  359. It("should provide DNS for pods for Hostname and Subdomain Annotation", func() {
  360. // Create a test headless service.
  361. By("Creating a test headless service")
  362. testServiceSelector := map[string]string{
  363. "dns-test-hostname-attribute": "true",
  364. }
  365. serviceName := "dns-test-service-2"
  366. podHostname := "dns-querier-2"
  367. headlessService := createServiceSpec(serviceName, "", true, testServiceSelector)
  368. _, err := f.Client.Services(f.Namespace.Name).Create(headlessService)
  369. Expect(err).NotTo(HaveOccurred())
  370. defer func() {
  371. By("deleting the test headless service")
  372. defer GinkgoRecover()
  373. f.Client.Services(f.Namespace.Name).Delete(headlessService.Name)
  374. }()
  375. hostFQDN := fmt.Sprintf("%s.%s.%s.svc.cluster.local", podHostname, serviceName, f.Namespace.Name)
  376. hostNames := []string{hostFQDN, podHostname}
  377. namesToResolve := []string{hostFQDN}
  378. wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, hostNames, "", "wheezy", f.Namespace.Name)
  379. jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, hostNames, "", "jessie", f.Namespace.Name)
  380. By("Running these commands on wheezy: " + wheezyProbeCmd + "\n")
  381. By("Running these commands on jessie: " + jessieProbeCmd + "\n")
  382. // Run a pod which probes DNS and exposes the results by HTTP.
  383. By("creating a pod to probe DNS")
  384. pod1 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, true)
  385. pod1.ObjectMeta.Labels = testServiceSelector
  386. pod1.ObjectMeta.Annotations = map[string]string{
  387. pod.PodHostnameAnnotation: podHostname,
  388. pod.PodSubdomainAnnotation: serviceName,
  389. }
  390. validateDNSResults(f, pod1, append(wheezyFileNames, jessieFileNames...))
  391. })
  392. It("should provide DNS for ExternalName services", func() {
  393. // Create a test ExternalName service.
  394. By("Creating a test externalName service")
  395. serviceName := "dns-test-service-3"
  396. externalNameService := createServiceSpec(serviceName, "foo.example.com", false, nil)
  397. _, err := f.Client.Services(f.Namespace.Name).Create(externalNameService)
  398. Expect(err).NotTo(HaveOccurred())
  399. defer func() {
  400. By("deleting the test externalName service")
  401. defer GinkgoRecover()
  402. f.Client.Services(f.Namespace.Name).Delete(externalNameService.Name)
  403. }()
  404. hostFQDN := fmt.Sprintf("%s.%s.svc.cluster.local", serviceName, f.Namespace.Name)
  405. wheezyProbeCmd, wheezyFileName := createTargetedProbeCommand(hostFQDN, "CNAME", "wheezy")
  406. jessieProbeCmd, jessieFileName := createTargetedProbeCommand(hostFQDN, "CNAME", "jessie")
  407. By("Running these commands on wheezy: " + wheezyProbeCmd + "\n")
  408. By("Running these commands on jessie: " + jessieProbeCmd + "\n")
  409. // Run a pod which probes DNS and exposes the results by HTTP.
  410. By("creating a pod to probe DNS")
  411. pod1 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, true)
  412. validateTargetedProbeOutput(f, pod1, []string{wheezyFileName, jessieFileName}, "foo.example.com.")
  413. // Test changing the externalName field
  414. By("changing the externalName to bar.example.com")
  415. _, err = updateService(f.Client, f.Namespace.Name, serviceName, func(s *api.Service) {
  416. s.Spec.ExternalName = "bar.example.com"
  417. })
  418. Expect(err).NotTo(HaveOccurred())
  419. wheezyProbeCmd, wheezyFileName = createTargetedProbeCommand(hostFQDN, "CNAME", "wheezy")
  420. jessieProbeCmd, jessieFileName = createTargetedProbeCommand(hostFQDN, "CNAME", "jessie")
  421. By("Running these commands on wheezy: " + wheezyProbeCmd + "\n")
  422. By("Running these commands on jessie: " + jessieProbeCmd + "\n")
  423. // Run a pod which probes DNS and exposes the results by HTTP.
  424. By("creating a second pod to probe DNS")
  425. pod2 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, true)
  426. validateTargetedProbeOutput(f, pod2, []string{wheezyFileName, jessieFileName}, "bar.example.com.")
  427. // Test changing type from ExternalName to ClusterIP
  428. By("changing the service to type=ClusterIP")
  429. _, err = updateService(f.Client, f.Namespace.Name, serviceName, func(s *api.Service) {
  430. s.Spec.Type = api.ServiceTypeClusterIP
  431. s.Spec.ClusterIP = "127.1.2.3"
  432. s.Spec.Ports = []api.ServicePort{
  433. {Port: 80, Name: "http", Protocol: "TCP"},
  434. }
  435. })
  436. Expect(err).NotTo(HaveOccurred())
  437. wheezyProbeCmd, wheezyFileName = createTargetedProbeCommand(hostFQDN, "A", "wheezy")
  438. jessieProbeCmd, jessieFileName = createTargetedProbeCommand(hostFQDN, "A", "jessie")
  439. By("Running these commands on wheezy: " + wheezyProbeCmd + "\n")
  440. By("Running these commands on jessie: " + jessieProbeCmd + "\n")
  441. // Run a pod which probes DNS and exposes the results by HTTP.
  442. By("creating a third pod to probe DNS")
  443. pod3 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, true)
  444. validateTargetedProbeOutput(f, pod3, []string{wheezyFileName, jessieFileName}, "127.1.2.3")
  445. })
  446. })