Revision 51596eb2 test/ganeti.ssh_unittest.py
b/test/ganeti.ssh_unittest.py | ||
---|---|---|
37 | 37 |
"""Test case for function writing the known_hosts file""" |
38 | 38 |
|
39 | 39 |
def setUp(self): |
40 |
self.tmpfile = tempfile.NamedTemporaryFile() |
|
40 |
testutils.GanetiTestCase.setUp(self) |
|
41 |
self.tmpfile = self._CreateTempFile() |
|
41 | 42 |
|
42 | 43 |
def test(self): |
43 | 44 |
cfg = mocks.FakeConfig() |
44 |
ssh.WriteKnownHostsFile(cfg, self.tmpfile.name)
|
|
45 |
self.assertFileContent(self.tmpfile.name,
|
|
45 |
ssh.WriteKnownHostsFile(cfg, self.tmpfile) |
|
46 |
self.assertFileContent(self.tmpfile, |
|
46 | 47 |
"%s ssh-rsa %s\n" % (cfg.GetClusterName(), |
47 | 48 |
mocks.FAKE_CLUSTER_KEY)) |
48 | 49 |
|
Also available in: Unified diff