File tree Expand file tree Collapse file tree
tests/storage_tests/devices_test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,6 +166,16 @@ def _unlock_locked_pool(self, pool):
166166
167167 return False
168168
169+ def _update_pool_info (self , pool ):
170+ pool_info = stratis_info .pools .get (pool .uuid )
171+ if not pool_info :
172+ log .warning ("Failed to get information about Stratis pool %s (%s)" ,
173+ pool .name , pool .uuid )
174+ return
175+
176+ pool ._overprovisioning = pool_info .overprovisioning
177+ pool ._fs_limit = pool_info .fs_limit
178+
169179 def _add_pool_device (self ):
170180 bd_info = stratis_info .blockdevs .get (self .device .format .uuid )
171181 if not bd_info :
@@ -194,10 +204,14 @@ def _add_pool_device(self):
194204 return
195205
196206 pool_device = self ._devicetree .get_device_by_uuid (bd_info .pool_uuid )
197- if pool_device and self .device not in pool_device .parents :
198- pool_device .parents .append (self .device )
199- callbacks .parent_added (device = pool_device , parent = self .device )
200- return
207+ if pool_device :
208+ # update pool information for newly started pools
209+ self ._update_pool_info (pool_device )
210+
211+ if self .device not in pool_device .parents :
212+ pool_device .parents .append (self .device )
213+ callbacks .parent_added (device = pool_device , parent = self .device )
214+ return
201215 elif pool_device is None :
202216 # started pool
203217 pool_info = stratis_info .pools .get (bd_info .pool_uuid )
Original file line number Diff line number Diff line change @@ -375,7 +375,8 @@ def test_stratis_pool_start_stop_encrypted(self):
375375 blivet .partitioning .do_partitioning (self .storage )
376376
377377 pool = self .storage .new_stratis_pool (name = "blivetTestPool" , parents = [bd ],
378- encrypted = True , passphrase = "fipsneeds8chars" )
378+ encrypted = True , passphrase = "fipsneeds8chars" ,
379+ overprovisioning = True )
379380 self .storage .create_device (pool )
380381
381382 fs = self .storage .new_stratis_filesystem (name = "blivetTestFS" , parents = [pool ],
@@ -414,9 +415,10 @@ def test_stratis_pool_start_stop_encrypted(self):
414415 pool .setup ()
415416 self .assertTrue (pool .status )
416417
417- # populate should add the filesystems to the devicetree
418+ # populate should add the filesystems to the devicetree and update pool properties
418419 self .storage .devicetree .populate ()
419420 self .assertEqual (len (pool .children ), 1 )
421+ self .assertTrue (pool .overprovisioning )
420422
421423 fs = self .storage .devicetree .get_device_by_name ("blivetTestPool/blivetTestFS" )
422424 self .assertIsNotNone (fs )
You can’t perform that action at this time.
0 commit comments