Skip to content

Commit 3053af8

Browse files
committed
ceph-volume: update lvm batch unit tests
This adds the recently `has_block_db_size_without_db_devices` attribute to the mocked `args` object for lvm batch unit tests. Signed-off-by: Guillaume Abrioux <[email protected]>
1 parent 6f43298 commit 3053af8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/ceph-volume/ceph_volume/tests/devices/lvm/test_batch.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def test_report(self, format_, factory, conf_ceph_stub, mock_device_generator):
6161
block_db_slots=1,
6262
dmcrypt=True,
6363
data_allocate_fraction=1.0,
64+
has_block_db_size_without_db_devices=None
6465
)
6566
b = batch.Batch([])
6667
b.args = args
@@ -111,6 +112,7 @@ def test_json_report_valid_empty_unavailable_fast(self, format_, factory, conf_c
111112
block_db_slots=1.0,
112113
dmcrypt=True,
113114
data_allocate_fraction=1.0,
115+
has_block_db_size_without_db_devices=None
114116
)
115117
b = batch.Batch([])
116118
b.args = args
@@ -141,6 +143,7 @@ def test_json_report_valid_empty_unavailable_very_fast(self, format_, factory, c
141143
block_db_slots=5,
142144
dmcrypt=True,
143145
data_allocate_fraction=1.0,
146+
has_block_db_size_without_db_devices=None
144147
)
145148
b = batch.Batch([])
146149
b.args = args
@@ -189,7 +192,8 @@ def test_get_physical_osds_return_len(self,
189192
dmcrypt=False,
190193
data_allocate_fraction=1.0,
191194
block_db_size=None,
192-
db_devices=[])
195+
db_devices=[],
196+
has_block_db_size_without_db_devices=None)
193197
osds = batch.get_physical_osds(mock_devices_available, args)
194198
assert len(osds) == len(mock_devices_available) * osds_per_device
195199

@@ -205,7 +209,8 @@ def test_get_physical_osds_rel_size(self,
205209
dmcrypt=False,
206210
data_allocate_fraction=data_allocate_fraction,
207211
block_db_size=None,
208-
db_devices=[])
212+
db_devices=[],
213+
has_block_db_size_without_db_devices=None)
209214
osds = batch.get_physical_osds(mock_devices_available, args)
210215
for osd in osds:
211216
assert osd.data[1] == data_allocate_fraction / osds_per_device
@@ -223,7 +228,8 @@ def test_get_physical_osds_abs_size(self,
223228
dmcrypt=False,
224229
data_allocate_fraction=data_allocate_fraction,
225230
block_db_size=None,
226-
db_devices=[])
231+
db_devices=[],
232+
has_block_db_size_without_db_devices=None)
227233
osds = batch.get_physical_osds(mock_devices_available, args)
228234
for osd, dev in zip(osds, mock_devices_available):
229235
assert osd.data[2] == int(dev.vg_size[0] * (data_allocate_fraction / osds_per_device))

0 commit comments

Comments
 (0)