@@ -23,10 +23,10 @@ import (
23
23
v1 "k8s.io/api/core/v1"
24
24
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25
25
"k8s.io/kubernetes/test/e2e/framework"
26
+ e2elog "k8s.io/kubernetes/test/e2e/framework/log"
26
27
imageutils "k8s.io/kubernetes/test/utils/image"
27
28
28
29
"github.com/onsi/ginkgo"
29
- "github.com/onsi/gomega"
30
30
)
31
31
32
32
const dnsTestPodHostName = "dns-querier-1"
@@ -54,14 +54,14 @@ var _ = SIGDescribe("DNS", func() {
54
54
}
55
55
testUtilsPod , err := f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Create (testUtilsPod )
56
56
framework .ExpectNoError (err )
57
- framework .Logf ("Created pod %v" , testUtilsPod )
57
+ e2elog .Logf ("Created pod %v" , testUtilsPod )
58
58
defer func () {
59
- framework .Logf ("Deleting pod %s..." , testUtilsPod .Name )
59
+ e2elog .Logf ("Deleting pod %s..." , testUtilsPod .Name )
60
60
if err := f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Delete (testUtilsPod .Name , metav1 .NewDeleteOptions (0 )); err != nil {
61
- framework .Failf ("Failed to delete pod %s: %v" , testUtilsPod .Name , err )
61
+ e2elog .Failf ("Failed to delete pod %s: %v" , testUtilsPod .Name , err )
62
62
}
63
63
}()
64
- gomega . Expect (f .WaitForPodRunning (testUtilsPod .Name )). NotTo ( gomega . HaveOccurred ( ), "failed to wait for pod %s to be running" , testUtilsPod .Name )
64
+ framework . ExpectNoError (f .WaitForPodRunning (testUtilsPod .Name ), "failed to wait for pod %s to be running" , testUtilsPod .Name )
65
65
66
66
ginkgo .By ("Verifying customized DNS option is configured on pod..." )
67
67
cmd := []string {"ipconfig" , "/all" }
@@ -75,17 +75,17 @@ var _ = SIGDescribe("DNS", func() {
75
75
})
76
76
framework .ExpectNoError (err )
77
77
78
- framework .Logf ("ipconfig /all:\n %s" , stdout )
78
+ e2elog .Logf ("ipconfig /all:\n %s" , stdout )
79
79
dnsRegex , err := regexp .Compile (`DNS Servers[\s*.]*:(\s*[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})+` )
80
80
81
81
if dnsRegex .MatchString (stdout ) {
82
82
match := dnsRegex .FindString (stdout )
83
83
84
84
if ! strings .Contains (match , testInjectedIP ) {
85
- framework .Failf ("customized DNS options not found in ipconfig /all, got: %s" , match )
85
+ e2elog .Failf ("customized DNS options not found in ipconfig /all, got: %s" , match )
86
86
}
87
87
} else {
88
- framework .Failf ("cannot find DNS server info in ipconfig /all output: \n %s" , stdout )
88
+ e2elog .Failf ("cannot find DNS server info in ipconfig /all output: \n %s" , stdout )
89
89
}
90
90
// TODO: Add more test cases for other DNSPolicies.
91
91
})
0 commit comments