|
@@ -358,9 +358,7 @@ class TestBootstrap(TestCase):
|
|
|
@patch.object(Popen, "communicate")
|
|
|
@patch.object(BootStrap, "createDoneFiles")
|
|
|
@patch.object(BootStrap, "getRunSetupWithPasswordCommand")
|
|
|
- @patch.object(BootStrap, "getMoveRepoFileWithPasswordCommand")
|
|
|
- def test_commands_with_password_are_called_for_user_with_password(self, getMoveRepoFileWithPasswordCommand_method,
|
|
|
- getRunSetupWithPasswordCommand_method,
|
|
|
+ def test_commands_with_password_are_called_for_user_with_password(self, getRunSetupWithPasswordCommand_method,
|
|
|
createDoneFiles_method,
|
|
|
communicate_method,
|
|
|
SSH_writeLogToFile_method,
|
|
@@ -373,7 +371,6 @@ class TestBootstrap(TestCase):
|
|
|
createDoneFiles_method.return_value = None
|
|
|
|
|
|
getRunSetupWithPasswordCommand_method.return_value = ""
|
|
|
- getMoveRepoFileWithPasswordCommand_method.return_value = ""
|
|
|
|
|
|
os.environ[AMBARI_PASSPHRASE_VAR_NAME] = ""
|
|
|
hosts = ["hostname"]
|
|
@@ -386,15 +383,11 @@ class TestBootstrap(TestCase):
|
|
|
bootstrap_obj.successive_hostlist = hosts
|
|
|
bootstrap_obj.runSetupAgent()
|
|
|
self.assertTrue(getRunSetupWithPasswordCommand_method.called)
|
|
|
- self.assertTrue(getMoveRepoFileWithPasswordCommand_method.called)
|
|
|
getRunSetupWithPasswordCommand_method.reset()
|
|
|
- getMoveRepoFileWithPasswordCommand_method.reset()
|
|
|
getRunSetupWithPasswordCommand_method.reset()
|
|
|
- getMoveRepoFileWithPasswordCommand_method.reset()
|
|
|
bootstrap_obj.successive_hostlist = None
|
|
|
bootstrap_obj.copyOsCheckScript()
|
|
|
self.assertTrue(getRunSetupWithPasswordCommand_method.called)
|
|
|
- self.assertTrue(getMoveRepoFileWithPasswordCommand_method.called)
|
|
|
|
|
|
@patch.object(bootstrap, "get_difference")
|
|
|
@patch.object(SCP, "writeLogToFile")
|
|
@@ -402,9 +395,7 @@ class TestBootstrap(TestCase):
|
|
|
@patch.object(Popen, "communicate")
|
|
|
@patch.object(BootStrap, "createDoneFiles")
|
|
|
@patch.object(BootStrap, "getRunSetupWithoutPasswordCommand")
|
|
|
- @patch.object(BootStrap, "getMoveRepoFileWithoutPasswordCommand")
|
|
|
- def test_commands_without_password_are_called_for_passwordless_user(self, getMoveRepoFileWithoutPasswordCommand_method,
|
|
|
- getRunSetupWithoutPasswordCommand_method,
|
|
|
+ def test_commands_without_password_are_called_for_passwordless_user(self, getRunSetupWithoutPasswordCommand_method,
|
|
|
createDoneFiles_method,
|
|
|
communicate_method,
|
|
|
SSH_writeLogToFile_method,
|
|
@@ -416,7 +407,6 @@ class TestBootstrap(TestCase):
|
|
|
createDoneFiles_method.return_value = None
|
|
|
|
|
|
getRunSetupWithoutPasswordCommand_method.return_value = ""
|
|
|
- getMoveRepoFileWithoutPasswordCommand_method.return_value = ""
|
|
|
|
|
|
os.environ[AMBARI_PASSPHRASE_VAR_NAME] = ""
|
|
|
hosts = ["hostname"]
|
|
@@ -429,21 +419,16 @@ class TestBootstrap(TestCase):
|
|
|
bootstrap_obj.successive_hostlist = hosts
|
|
|
bootstrap_obj.runSetupAgent()
|
|
|
self.assertTrue(getRunSetupWithoutPasswordCommand_method.called)
|
|
|
- self.assertTrue(getMoveRepoFileWithoutPasswordCommand_method.called)
|
|
|
getRunSetupWithoutPasswordCommand_method.reset()
|
|
|
- getMoveRepoFileWithoutPasswordCommand_method.reset()
|
|
|
|
|
|
get_difference_mock.return_value = None
|
|
|
self.assertTrue(bootstrap_obj.copyNeededFiles() == 0)
|
|
|
self.assertTrue(getRunSetupWithoutPasswordCommand_method.called)
|
|
|
- self.assertTrue(getMoveRepoFileWithoutPasswordCommand_method.called)
|
|
|
getRunSetupWithoutPasswordCommand_method.reset()
|
|
|
- getMoveRepoFileWithoutPasswordCommand_method.reset()
|
|
|
|
|
|
bootstrap_obj.successive_hostlist = None
|
|
|
bootstrap_obj.copyNeededFiles()
|
|
|
self.assertTrue(getRunSetupWithoutPasswordCommand_method.called)
|
|
|
- self.assertTrue(getMoveRepoFileWithoutPasswordCommand_method.called)
|
|
|
|
|
|
@patch.object(BootStrap, "runSetupAgent")
|
|
|
@patch.object(BootStrap, "copyNeededFiles")
|