Skip to content

Commit

Permalink
Additional review comments.
Browse files Browse the repository at this point in the history
Fixed functional test that was not doing the right
thing while running the test.

Signed-off-by: Alexander Wels <awels@redhat.com>
  • Loading branch information
awels committed Aug 4, 2023
1 parent 06dec15 commit ba11540
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/importer/http-datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (hs *HTTPDataSource) Info() (ProcessingPhase, error) {
if hs.contentType == cdiv1.DataVolumeArchive {
return ProcessingPhaseTransferDataDir, nil
}
if !hs.readers.Convert && (hs.readers.Archived || hs.customCA != "") {
if !hs.readers.Convert {
return ProcessingPhaseTransferDataFile, nil
}
// removing check for hs.brokenForQemuImg, and always assuming it is true
Expand Down
9 changes: 3 additions & 6 deletions tests/datavolume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2864,14 +2864,11 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component]DataVolume tests",
Expect(err).ToNot(HaveOccurred())

// here we want to have more than 0, to be sure it started
progressRegExp := regexp.MustCompile(`[1-9]\d{0,2}\.?\d{1,2}%`)
Eventually(func() bool {
Eventually(func() string {
dv, err := f.CdiClient.CdiV1beta1().DataVolumes(f.Namespace.Name).Get(context.TODO(), dataVolume.Name, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
progress := dv.Status.Progress
fmt.Fprintf(GinkgoWriter, "INFO: current progress:%v, matches:%v\n", progress, progressRegExp.MatchString(string(progress)))
return progressRegExp.MatchString(string(progress))
}, timeout, pollingInterval).Should(BeTrue())
return string(dv.Status.Progress)
}, timeout, pollingInterval).Should(Equal("N/A"))

By("Remove source image file & kill http container to force restart")
fileHostPod, err := utils.FindPodByPrefix(f.K8sClient, f.CdiInstallNs, utils.FileHostName, "name="+utils.FileHostName)
Expand Down
4 changes: 2 additions & 2 deletions tests/import_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ var _ = Describe("Import Proxy tests", func() {
imgName: tinyCoreIso,
isHTTPS: false,
withBasicAuth: false,
userAgent: nbdKitUserAgent,
userAgent: golangUserAgent,
expected: BeTrue}),
Entry("succeed creating iso.gz import dv with a proxied server (http)", importProxyTestArguments{
name: "dv-import-http-proxy",
Expand All @@ -231,7 +231,7 @@ var _ = Describe("Import Proxy tests", func() {
imgName: tinyCoreIso,
isHTTPS: false,
withBasicAuth: true,
userAgent: nbdKitUserAgent,
userAgent: golangUserAgent,
expected: BeTrue}),
Entry("succeed creating iso.gz import dv with a proxied server (http) with basic autentication", importProxyTestArguments{
name: "dv-import-http-proxy-auth",
Expand Down

0 comments on commit ba11540

Please sign in to comment.