def test_checkVolumeStatus(self, mock_volumeInfo): mock_volumeInfo.return_value = _getVolume() args = ArgParseMock('test-cluster', 'test-vol') exitStatusCode, exitStatusMsg = ( check_volume_status.getVolumeStatus(args)) print exitStatusMsg assert exitStatusMsg == "OK: Volume : DISTRIBUTED type - Volume is up" assert exitStatusCode == utils.PluginStatusCode.OK
def test_checkVolumeStatusNoVol(self, mock_volumeInfo): mock_volumeInfo.return_value = _getEmptyVolume() args = ArgParseMock('test-cluster', 'test-vol') exitStatusCode, exitStatusMsg = ( check_volume_status.getVolumeStatus(args)) assert exitStatusCode == utils.PluginStatusCode.CRITICAL