def _test_inject_ssh_key_skipped(self, instance): agent = self._create_agent(instance) # make sure its not called self.mox.StubOutWithMock(agent, "inject_file") self.mox.ReplayAll() agent.inject_ssh_key()
def test_inject_ssh_key_succeeds(self, mock_inject_file): instance = _get_fake_instance() agent = self._create_agent(instance) agent.inject_ssh_key() mock_inject_file.assert_called_once_with( "/root/.ssh/authorized_keys", "\n# The following ssh key " "was injected by Nova" "\nssh-rsa asdf\n")
def test_inject_ssh_key_succeeds(self, mock_inject_file): instance = _get_fake_instance() agent = self._create_agent(instance) agent.inject_ssh_key() mock_inject_file.assert_called_once_with("/root/.ssh/authorized_keys", "\n# The following ssh key " "was injected by Nova" "\nssh-rsa asdf\n")
def test_inject_ssh_key_succeeds(self): instance = _get_fake_instance() agent = self._create_agent(instance) self.mox.StubOutWithMock(agent, "inject_file") agent.inject_file("/root/.ssh/authorized_keys", "\n# The following ssh key was injected by Nova" "\nssh-rsa asdf\n") self.mox.ReplayAll() agent.inject_ssh_key()
def _test_inject_ssh_key_skipped(self, instance, mock_inject_file): agent = self._create_agent(instance) # make sure its not called agent.inject_ssh_key() mock_inject_file.assert_not_called()