def test_vdo_status_full(): vdo = VDOStatus(context_wrap(INPUT_STATUS_FULL)) assert vdo.data["VDO status"]["Date"] == "2019-07-24 20:48:16-04:00" assert vdo.data["VDO status"]["Node"] == "dell-m620-10.rhts.gsslab.pek2.redhat.com" assert vdo.data["Kernel module"]["Name"] == "kvdo" assert vdo.data["Kernel module"]["Version information"]["kvdo version"] == "6.1.0.153" assert vdo.data["Configuration"]["File"] == "/etc/vdoconf.yml" assert vdo.data["Configuration"]["Last modified"] == "2019-07-24 20:47:59" assert vdo.data["VDOs"]["vdo1"]["Acknowledgement threads"] == 1 assert vdo.data["VDOs"]["vdo1"]["Device mapper status"] == "0 8370216 vdo /dev/sda3 albserver online cpu=2,bio=4,ack=1,bioRotationInterval=64" assert vdo.data["VDOs"]["vdo1"]["VDO statistics"]["/dev/mapper/vdo1"]["KVDO module bios used"] == 74572 assert vdo.get_slab_size_of_vol('vdo1') == '2G' assert vdo.volumns == ['vdo1', 'vdo2'] assert vdo.get_physical_blocks_of_vol('vdo1') == 1835008 assert vdo.get_overhead_used_of_vol('vdo1') == 787140 assert vdo.get_physical_used_of_vol('vdo1') == 0 assert vdo.get_logical_blocks_of_vol('vdo1') == 1046277 assert vdo.get_logical_used_of_vol('vdo1') == 0 assert vdo.get_logical_free_of_vol('vdo1') == 1046277 assert vdo.get_physical_free_of_vol('vdo1') == 1047868 assert vdo.get_logical_used_of_vol('vdo2') == 3 assert vdo.get_physical_used_of_vol('vdo2') == 1
def test_vdo_status_simple(): vdo = VDOStatus(context_wrap(INPUT_STATUS_SIMPLE)) assert vdo.data['VDO status'] == {'Date': '2019-07-27 04:40:40-04:00', 'Node': 'rdma-qe-04.lab.bos.redhat.com'} assert vdo.data['VDOs']['vdo1']['Activate'] == 'enabled' assert vdo.data['VDO status']['Date'] == '2019-07-27 04:40:40-04:00' assert vdo.data['VDO status']['Node'] == 'rdma-qe-04.lab.bos.redhat.com' assert vdo.get_slab_size_of_vol('vdo1') == '2G' assert vdo.volumns == ['vdo1', 'vdo2'] assert vdo.get_physical_blocks_of_vol('vdo1') == 1572864 assert vdo.get_overhead_used_of_vol('vdo1') == 728175 assert vdo.get_physical_used_of_vol('vdo1') == 161863 assert vdo.get_physical_free_of_vol('vdo1') == 682826 assert vdo.get_logical_blocks_of_vol('vdo1') == 844568 assert vdo.get_logical_used_of_vol('vdo1') == 844502 assert vdo.get_logical_free_of_vol('vdo1') == 66