def test_cmd(self, cmd, expected_res, timeout=30): logging.debug("exec sh: %s" % cmd) actual_res = exec_sh_cmd(cmd, timeout) # check result code. if expected_res is not None: self.cmp(cmd, expected_res, actual_res)
def exec_cmd(self, cmd, result, timeout, replase_kws): # replase key words. c = self.replase_kws(cmd, replase_kws) r = None if result is not None: r = self.replase_kws(result, replase_kws) logging.debug("exec sh: %s" % c) # exec shell cmd. res = exec_sh_cmd(c, timeout) # check result code. if result is not None: self.cmp_sh_res(c, r, res)