Exemple #1
0
    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()
Exemple #2
0
    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()
Exemple #3
0
    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()
Exemple #4
0
    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()