return "Executing command '%s' failed" % cmd
-class TestRunRemoteCommand(unittest.TestCase):
+class TestRunRestrictedCmd(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
sleep_fn = testutils.CallCounter(_SleepForRemoteCommand)
self.assertFalse(os.path.exists(lockfile))
self.assertRaises(backend.RPCFail,
- backend.RunRemoteCommand, "test",
+ backend.RunRestrictedCmd, "test",
_lock_timeout=NotImplemented,
_lock_file=lockfile,
_path=NotImplemented,
result = False
try:
- backend.RunRemoteCommand("test22717",
+ backend.RunRestrictedCmd("test22717",
_lock_timeout=0.1,
_lock_file=lockfile,
_path=NotImplemented,
prepare_fn = testutils.CallCounter(self._PrepareRaisingException)
try:
- backend.RunRemoteCommand("test23122",
+ backend.RunRestrictedCmd("test23122",
_lock_timeout=1.0, _lock_file=lockfile,
_path=NotImplemented, _runcmd_fn=NotImplemented,
_sleep_fn=sleep_fn, _prepare_fn=prepare_fn,
prepare_fn = testutils.CallCounter(self._PrepareFails)
try:
- backend.RunRemoteCommand("test29327",
+ backend.RunRestrictedCmd("test29327",
_lock_timeout=1.0, _lock_file=lockfile,
_path=NotImplemented, _runcmd_fn=NotImplemented,
_sleep_fn=sleep_fn, _prepare_fn=prepare_fn,
runcmd_fn = testutils.CallCounter(fn)
try:
- backend.RunRemoteCommand("test3079",
+ backend.RunRestrictedCmd("test3079",
_lock_timeout=1.0, _lock_file=lockfile,
_path=self.tmpdir, _runcmd_fn=runcmd_fn,
_sleep_fn=sleep_fn, _prepare_fn=prepare_fn,
prepare_fn = testutils.CallCounter(self._SuccessfulPrepare)
runcmd_fn = testutils.CallCounter(fn)
- result = backend.RunRemoteCommand("test5667",
+ result = backend.RunRestrictedCmd("test5667",
_lock_timeout=1.0, _lock_file=lockfile,
_path=self.tmpdir, _runcmd_fn=runcmd_fn,
_sleep_fn=sleep_fn,
def testCommandsDisabled(self):
try:
- backend.RunRemoteCommand("test",
+ backend.RunRestrictedCmd("test",
_lock_timeout=NotImplemented,
_lock_file=NotImplemented,
_path=NotImplemented,