Skip to content

Commit

Permalink
tests, windows, Add Subdomain test
Browse files Browse the repository at this point in the history
Create a VMI with subdomain, and verify the expected dnsdomain
is reported in the guest.

Signed-off-by: Or Shoval <[email protected]>
  • Loading branch information
oshoval committed Nov 8, 2021
1 parent e595fb0 commit 3288f69
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,31 @@ var _ = Describe("[Serial][sig-compute]Windows VirtualMachineInstance", func() {
`DNSDomain[\n\r\t ]+`+searchDomain+`[\n\r\t ]+`)
}, 360)
})

Context("VMI with subdomain is created", func() {
BeforeEach(func() {
windowsVMI.Spec.Subdomain = "subdomain"

By("Starting the windows VirtualMachineInstance with subdomain")
windowsVMI, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(windowsVMI)
Expect(err).ToNot(HaveOccurred())
tests.WaitForSuccessfulVMIStartWithTimeout(windowsVMI, 360)

cli = winrnLoginCommand(virtClient, windowsVMI)
})

It("should have the domain set properly with subdomain", func() {
searchDomain := getPodSearchDomain(windowsVMI)
Expect(searchDomain).To(HavePrefix(windowsVMI.Namespace), "should contain a searchdomain with the namespace of the VMI")

expectedSearchDomain := windowsVMI.Spec.Subdomain + "." + searchDomain
runCommandAndExpectOutput(virtClient,
winrmcliPod,
cli,
"wmic nicconfig get dnsdomain",
`DNSDomain[\n\r\t ]+`+expectedSearchDomain+`[\n\r\t ]+`)
}, 360)
})
})

Context("[ref_id:142]with kubectl command", func() {
Expand Down

0 comments on commit 3288f69

Please sign in to comment.