mirror of
https://github.com/kubevirt/containerized-data-importer.git
synced 2025-06-03 06:30:22 +00:00
Signed-off-by: Maya Rashish <mrashish@redhat.com>
This commit is contained in:
parent
ad021d95bf
commit
c2c6e2ebda
@ -48,9 +48,8 @@ const (
|
||||
// 1a. Info -> Convert (In Info phase the format readers are configured), if the source Reader image is not archived, and no custom CA is used, and can be converted by QEMU-IMG (RAW/QCOW2)
|
||||
// 1b. Info -> TransferArchive if the content type is archive
|
||||
// 1c. Info -> Transfer in all other cases.
|
||||
// 2a. Transfer -> Process if content type is kube virt
|
||||
// 2a. Transfer -> Convert if content type is kube virt
|
||||
// 2b. Transfer -> Complete if content type is archive (Transfer is called with the target instead of the scratch space). Non block PVCs only.
|
||||
// 3. Process -> Convert
|
||||
type HTTPDataSource struct {
|
||||
httpReader io.ReadCloser
|
||||
ctx context.Context
|
||||
|
@ -160,7 +160,7 @@ var _ = Describe("Http data source", func() {
|
||||
table.Entry("return Error with invalid content type ", cirrosFileName, cdiv1.DataVolumeContentType("invalid"), ProcessingPhaseError, "", cirrosData, true),
|
||||
table.Entry("return Complete with archive content type and archive endpoint ", diskimageTarFileName, cdiv1.DataVolumeArchive, ProcessingPhaseComplete, "", diskimageArchiveData, false),
|
||||
table.Entry("return Error with invalid target path and archive", diskimageTarFileName, cdiv1.DataVolumeArchive, ProcessingPhaseError, "/imaninvalidpath", cirrosData, true),
|
||||
table.Entry("return Process with scratch space and valid qcow file", cirrosFileName, cdiv1.DataVolumeKubeVirt, ProcessingPhaseConvert, "", cirrosData, false),
|
||||
table.Entry("return Convert with scratch space and valid qcow file", cirrosFileName, cdiv1.DataVolumeKubeVirt, ProcessingPhaseConvert, "", cirrosData, false),
|
||||
)
|
||||
|
||||
It("TransferFile should succeed when writing to valid file, and reading raw gz", func() {
|
||||
|
@ -32,8 +32,7 @@ var newClientFunc = getS3Client
|
||||
// S3DataSource is the struct containing the information needed to import from an S3 data source.
|
||||
// Sequence of phases:
|
||||
// 1. Info -> Transfer
|
||||
// 2. Transfer -> Process
|
||||
// 3. Process -> Convert
|
||||
// 2. Transfer -> Convert
|
||||
type S3DataSource struct {
|
||||
// S3 end point
|
||||
ep *url.URL
|
||||
|
@ -128,7 +128,7 @@ var _ = Describe("S3 data source", func() {
|
||||
}
|
||||
},
|
||||
table.Entry("return Error with missing scratch space", cirrosFilePath, "/imaninvalidpath", nil, true),
|
||||
table.Entry("return Process with scratch space and valid qcow file", cirrosFilePath, "", cirrosData, false),
|
||||
table.Entry("return Convert with scratch space and valid qcow file", cirrosFilePath, "", cirrosData, false),
|
||||
)
|
||||
|
||||
It("Transfer should fail on reader error", func() {
|
||||
|
@ -93,7 +93,7 @@ var _ = Describe("Upload data source", func() {
|
||||
}
|
||||
},
|
||||
table.Entry("return Error with missing scratch space", cirrosFilePath, "/imaninvalidpath", nil, true),
|
||||
table.Entry("return Process with scratch space and valid qcow file", cirrosFilePath, "", cirrosData, false),
|
||||
table.Entry("return Convert with scratch space and valid qcow file", cirrosFilePath, "", cirrosData, false),
|
||||
)
|
||||
|
||||
It("Transfer should fail on reader error", func() {
|
||||
@ -217,7 +217,7 @@ var _ = Describe("Async Upload data source", func() {
|
||||
}
|
||||
},
|
||||
table.Entry("return Error with missing scratch space", cirrosFilePath, "/imaninvalidpath", nil, true),
|
||||
table.Entry("return Process with scratch space and valid qcow file", cirrosFilePath, "", cirrosData, false),
|
||||
table.Entry("return Convert with scratch space and valid qcow file", cirrosFilePath, "", cirrosData, false),
|
||||
)
|
||||
|
||||
It("Transfer should fail on reader error", func() {
|
||||
|
Loading…
Reference in New Issue
Block a user