Пример #1
0
 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'
                 }
             })
Пример #2
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'
     ]
Пример #3
0
 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'
     ]
Пример #4
0
    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']
Пример #5
0
 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'
     ]
Пример #6
0
 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'
     ]
Пример #7
0
 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
                 }
             })
Пример #8
0
 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'
     ]
Пример #9
0
 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
Пример #10
0
 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
Пример #11
0
 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            '
     }
Пример #12
0
 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
Пример #13
0
 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'
     ]
Пример #14
0
 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"
     }
Пример #15
0
 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'
     ]
Пример #16
0
 def test_c_v_commands(self, output_mock):
     dg.c_v_commands()
     output_mock.assert_called_once()