def test_get_limit_ctrl(self): limit_ctrl = VNXCtrlMethod(method=VNXCtrlMethod.LIMIT_CTRL, metric='bw', value=100) options = limit_ctrl.get_option() assert_that( options, equal_to(['-ctrlmethod', 'limit', '-gmetric', 'bw', '-gval', 100]))
def test_get_cruise_ctrl(self): cruise_ctrl = VNXCtrlMethod(method=VNXCtrlMethod.CRUISE_CTRL, metric='bw', value=100, tolerance=10) options = cruise_ctrl.get_option() assert_that( options, equal_to([ '-ctrlmethod', 'cruise', '-gmetric', 'bw', '-gval', 100, '-gtol', 10 ]))
def modify_ioclass(self, name, new_name=None, iotype=None, lun_ids=None, smp_names=None, ctrlmethod=None, minsize=None, maxsize=None): cmd = ['nqm', '-ioclass', '-modify', '-name', name] cmd += text_var('-newname', new_name) cmd += text_var('-iotype', iotype) cmd += int_var('-minsize', minsize) cmd += int_var('-maxsize', maxsize) # Currently we do not support reset to anyio # if anyio is True: # cmd += text_var('-anyio') cmd += list_var('-luns', lun_ids) cmd += list_var('-snapshots', smp_names) # Currently we do not support clear all luns # if (lun_ids and len(lun_ids) == 0) # and (smp_names and len(smp_names) == 0): # cmd += ['-nolun'] cmd += VNXCtrlMethod.parse_cmd(ctrlmethod) cmd.append('-o') return cmd
def create_ioclass(self, name, iotype='rw', lun_ids=None, smp_names=None, ctrlmethod=VNXCtrlMethod.NO_CTRL, minsize=None, maxsize=None): cmd = ['nqm', '-ioclass', '-create', '-name', name, '-iotype', iotype] cmd += int_var('-minsize', minsize) cmd += int_var('-maxsize', maxsize) cmd += list_var('-luns', lun_ids) cmd += list_var('-snapshots', smp_names) cmd += VNXCtrlMethod.parse_cmd(ctrlmethod) return cmd
def _inner(): invalid = VNXCtrlMethod(method='invalid') invalid.get_option()
def test_get_fix_ctrl(self): fixed_ctrl = VNXCtrlMethod(method=VNXCtrlMethod.FIXED_CTRL, value=100) options = fixed_ctrl.get_option() assert_that(options, equal_to(['-ctrlmethod', 'fixed', '-gval', 100]))
def test_get_no_ctrl(self): no_ctrl = VNXCtrlMethod(method=VNXCtrlMethod.NO_CTRL) options = no_ctrl.get_option() assert_that(options, equal_to(['-noctrl']))