@@ -61,35 +61,32 @@ func TestConvertToRaw(t *testing.T) {
61
61
assert .NilError (t , err )
62
62
63
63
t .Run ("qcow without backing file" , func (t * testing.T ) {
64
- resultImage := filepath .Join (tmpDir , strings .ReplaceAll (t .Name (), string (os .PathSeparator ), "_" ))
65
- assert .NilError (t , err )
64
+ resultImage := filepath .Join (tmpDir , strings .ReplaceAll (strings .ReplaceAll (t .Name (), string (os .PathSeparator ), "_" ), "/" , "_" ))
66
65
67
66
err = ConvertToRaw (qcowImage .Name (), resultImage , nil , false )
68
67
assert .NilError (t , err )
69
68
assertFileEquals (t , rawImage .Name (), resultImage )
70
69
})
71
70
72
71
t .Run ("qcow with backing file" , func (t * testing.T ) {
73
- resultImage := filepath .Join (tmpDir , strings .ReplaceAll (t .Name (), string (os .PathSeparator ), "_" ))
74
- assert .NilError (t , err )
72
+ resultImage := filepath .Join (tmpDir , strings .ReplaceAll (strings .ReplaceAll (t .Name (), string (os .PathSeparator ), "_" ), "/" , "_" ))
75
73
76
74
err = ConvertToRaw (qcowImage .Name (), resultImage , nil , true )
77
75
assert .NilError (t , err )
78
76
assertFileEquals (t , rawImage .Name (), resultImage )
79
77
})
80
78
81
79
t .Run ("qcow with extra size" , func (t * testing.T ) {
82
- resultImage := filepath .Join (tmpDir , strings .ReplaceAll (t .Name (), string (os .PathSeparator ), "_" ))
83
- assert . NilError ( t , err )
80
+ resultImage := filepath .Join (tmpDir , strings .ReplaceAll (strings . ReplaceAll ( t .Name (), string (os .PathSeparator ), "_" ), "/" , "_" ))
81
+
84
82
size := int64 (2_097_152 ) // 2mb
85
83
err = ConvertToRaw (qcowImage .Name (), resultImage , & size , false )
86
84
assert .NilError (t , err )
87
85
assertFileEquals (t , rawImageExtended .Name (), resultImage )
88
86
})
89
87
90
88
t .Run ("raw" , func (t * testing.T ) {
91
- resultImage := filepath .Join (tmpDir , strings .ReplaceAll (t .Name (), string (os .PathSeparator ), "_" ))
92
- assert .NilError (t , err )
89
+ resultImage := filepath .Join (tmpDir , strings .ReplaceAll (strings .ReplaceAll (t .Name (), string (os .PathSeparator ), "_" ), "/" , "_" ))
93
90
94
91
err = ConvertToRaw (rawImage .Name (), resultImage , nil , false )
95
92
assert .NilError (t , err )
0 commit comments