def test_c_v_commands_external_wal_only(self, test_fix, inventory): inventory(wal_devices=2, db_devices=0) with pytest.raises(dg.ConfigError): dg.c_v_commands( filter_args={ 'data_devices': { 'rotational': '1' }, 'wal_devices': { 'rotational': '0' } })
def test_c_v_commands_filestore(self, test_fix, inventory): inventory() test_fix = test_fix(disk_format='filestore') ret = dg.c_v_commands(filter_args=test_fix.filter_args) assert ret == [ 'ceph-volume lvm batch /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk --journal-size 5000000000 --journal-devices /dev/sdl /dev/sdm --filestore --yes --dmcrypt' ]
def test_c_v_commands_bluestore_osds_per_device(self, test_fix, inventory): inventory() test_fix = test_fix(osds_per_device=3) ret = dg.c_v_commands(filter_args=test_fix.filter_args) assert ret == [ 'ceph-volume lvm batch --no-auto /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk /dev/sdl /dev/sdm --yes --dmcrypt --block-wal-size 5000000000 --block-db-size 10000000000 --osds-per-device 3' ]
def test_c_v_commands(self, test_fix, inventory): inventory(available=True) test_fix = test_fix() ret = dg.c_v_commands(filter_args=test_fix.filter_args) assert ret == [ 'ceph-volume lvm batch --no-auto /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk /dev/sdl /dev/sdm --yes --dmcrypt --block-wal-size 5000000000 --block-db-size 10000000000']
def test_c_v_commands_filestore_osds_per_device(self, test_fix, inventory): inventory() test_fix = test_fix(disk_format='filestore', osds_per_device='3') ret = dg.c_v_commands(filter_args=test_fix.filter_args) assert ret == [ 'ceph-volume lvm batch /dev/vdb /dev/vdc /dev/vdd /dev/vde /dev/vdf /dev/vdg /dev/vdh /dev/vdi /dev/vdj /dev/vdk --journal-size 500 --journal-devices /dev/vdl /dev/vdm --filestore --yes --dmcrypt --osds-per-device 3' ]
def test_c_v_commands(self, test_fix, inventory): inventory() test_fix = test_fix() ret = dg.c_v_commands(filter_args=test_fix.filter_args) assert ret == [ 'ceph-volume lvm batch --no-auto /dev/vdb /dev/vdc /dev/vdd /dev/vde /dev/vdf /dev/vdg /dev/vdh /dev/vdi /dev/vdj /dev/vdk /dev/vdl /dev/vdm --yes --dmcrypt --block-wal-size 500 --block-db-size 500' ]
def test_c_v_commands_11_data_external_3_dbs_and_1_wals( self, test_fix, inventory): inventory(data_devices=11, db_devices=3, wal_devices=1) with pytest.raises(dg.ConfigError): dg.c_v_commands( filter_args={ 'data_devices': { 'rotational': '1' }, 'db_devices': { 'rotational': '0', 'limit': 3 }, 'wal_devices': { 'rotational': '0', 'limit': 1 } })
def test_c_v_commands_external_db(self, test_fix, inventory): inventory() ret = dg.c_v_commands(filter_args={ 'data_devices': { 'rotational': '1' }, 'db_devices': { 'rotational': '0' } }) assert ret == [ 'ceph-volume lvm batch --no-auto /dev/sdb /dev/sdd /dev/sdf /dev/sdh /dev/sdj --db-devices /dev/sdl --yes', 'ceph-volume lvm batch --no-auto /dev/sdc /dev/sde /dev/sdg /dev/sdi /dev/sdk --db-devices /dev/sdm --yes' ]
def test_c_v_commands_0B_exclude(self, test_fix, inventory): inventory( data_devices=3, human_readable_size_data='0.00 B', size=0, wal_devices=0, db_devices=0) ret = dg.c_v_commands(filter_args={ 'data_devices': { 'size': '1TB:' }, 'encryption': 'true' }) assert '' == ret
def test_c_v_commands_1TB_size_match(self, test_fix, inventory): inventory( data_devices=3, human_readable_size_data='9.10 TB', wal_devices=0, db_devices=0) ret = dg.c_v_commands(filter_args={ 'data_devices': { 'size': '1TB:' }, 'encryption': 'true' }) assert [ 'ceph-volume lvm batch --no-auto /dev/sdb /dev/sdc /dev/sdd --yes --dmcrypt', ] == ret
def test_c_v_commands_external_wal_only(self, test_fix, inventory): inventory(wal_devices=2, db_devices=0) ret = dg.c_v_commands( filter_args={ 'data_devices': { 'rotational': '1' }, 'wal_devices': { 'rotational': '0' } }) assert ret == { 'wal_devices': '\nYou specified only wal_devices. If your intention was to\nhave dedicated WALs/DBs please specify it with the db_devices\nfilter. WALs will be colocated alongside the DBs.\nRead more about this here <link>.\n ' }
def test_c_v_commands_external_2_dbs_and_3_wals(self, test_fix, inventory): inventory(db_devices=2, wal_devices=3) ret = dg.c_v_commands( filter_args={ 'data_devices': { 'rotational': '1' }, 'db_devices': { 'rotational': '0', 'limit': 2 }, 'wal_devices': { 'rotational': '0', 'limit': 3 } }) assert [ 'ceph-volume lvm batch --no-auto /dev/sdb /dev/sdd /dev/sdf /dev/sdh /dev/sdj --db-devices /dev/sdl --wal-devices /dev/sdn /dev/sdp --yes', 'ceph-volume lvm batch --no-auto /dev/sdc /dev/sde /dev/sdg /dev/sdi /dev/sdk --db-devices /dev/sdm --wal-devices /dev/sdo --yes' ] == ret
def test_c_v_commands_external_2_dbs_and_2_wals(self, test_fix, inventory): inventory(db_devices=2, wal_devices=2) ret = dg.c_v_commands( filter_args={ 'data_devices': { 'rotational': '1' }, 'db_devices': { 'rotational': '0', 'limit': 2 }, 'wal_devices': { 'rotational': '0', 'limit': 2 } }) assert ret == [ 'ceph-volume lvm batch --no-auto /dev/vdb /dev/vdd /dev/vdf /dev/vdh /dev/vdj --db-devices /dev/vdn --wal-devices /dev/vdl --yes', 'ceph-volume lvm batch --no-auto /dev/vdc /dev/vde /dev/vdg /dev/vdi /dev/vdk --db-devices /dev/vdo --wal-devices /dev/vdm --yes' ]
def test_c_v_commands_11_data_external_3_dbs_and_1_wals( self, test_fix, inventory): inventory(data_devices=11, db_devices=3, wal_devices=1) ret = dg.c_v_commands( filter_args={ 'data_devices': { 'rotational': '1' }, 'db_devices': { 'rotational': '0', 'limit': 3 }, 'wal_devices': { 'rotational': '0', 'limit': 1 } }) assert ret == { 'wal_db_distribution': "\nWe can't guarantee proper wal/db distribution in this configuration.\nPlease make sure to have more/equal wal_devices than db_devices" }
def test_c_v_commands_external_2_dbs_and_2_wals_osds_per_device(self, test_fix, inventory): """ Check if osds_per_device shows up in multi commands runs """ inventory(db_devices=2, wal_devices=2) ret = dg.c_v_commands( filter_args={ 'data_devices': { 'rotational': '1' }, 'db_devices': { 'rotational': '0', 'limit': 2 }, 'wal_devices': { 'rotational': '0', 'limit': 2 }, 'osds_per_device': '3', }) assert ret == [ 'ceph-volume lvm batch --no-auto /dev/vdb /dev/vdd /dev/vdf /dev/vdh /dev/vdj --db-devices /dev/vdn --wal-devices /dev/vdl --yes --osds-per-device 3', 'ceph-volume lvm batch --no-auto /dev/vdc /dev/vde /dev/vdg /dev/vdi /dev/vdk --db-devices /dev/vdo --wal-devices /dev/vdm --yes --osds-per-device 3' ]
def test_c_v_commands(self, output_mock): dg.c_v_commands() output_mock.assert_called_once()