@@ -158,10 +158,7 @@ func basePoolTest(t *testing.T, pool Pool) {
158
158
159
159
assert .Equal (t , path .Join ("/mnt" , pool .Name (), "subvol1" ), volume .Path ())
160
160
})
161
- defer func () {
162
- err := pool .RemoveVolume ("subvol1" )
163
- require .NoError (t , err )
164
- }()
161
+
165
162
166
163
t .Run ("test list volumes" , func (t * testing.T ) {
167
164
volumes , err := pool .Volumes ()
@@ -190,7 +187,7 @@ func basePoolTest(t *testing.T, pool Pool) {
190
187
require .NoError (t , err )
191
188
192
189
// Note: an empty subvolume has an overhead of 16384 bytes
193
- assert .Equal (t , Usage {Used : 16384 , Size : 50 * 1024 * 1024 }, usage )
190
+ assert .Equal (t , Usage {Used : 50 * 1024 * 1024 , Size : 50 * 1024 * 1024 }, usage )
194
191
})
195
192
196
193
t .Run ("test remove subvolume" , func (t * testing.T ) {
@@ -259,7 +256,9 @@ func TestCLeanUpQgroupsCI(t *testing.T) {
259
256
260
257
qgroups , err := btrfsVol .utils .QGroupList (context .TODO (), pool .Path ())
261
258
require .NoError (t , err )
262
- assert .Equal (t , 1 , len (qgroups ))
259
+
260
+ // it start with a volume of size 16384 by default
261
+ assert .Equal (t , 2 , len (qgroups ))
263
262
t .Logf ("qgroups before delete: %v" , qgroups )
264
263
265
264
_ , ok = qgroups [fmt .Sprintf ("0/%d" , btrfsVol .id )]
@@ -272,5 +271,5 @@ func TestCLeanUpQgroupsCI(t *testing.T) {
272
271
require .NoError (t , err )
273
272
274
273
t .Logf ("remaining qgroups: %+v" , qgroups )
275
- assert .Equal (t , 0 , len (qgroups ), "qgroups should have been deleted with the subvolume" )
274
+ assert .Equal (t , 1 , len (qgroups ), "qgroups should have been deleted with the subvolume" )
276
275
}
0 commit comments