Revision 8f9a87c5 test/ganeti.utils.nodesetup_unittest.py

b/test/ganeti.utils.nodesetup_unittest.py
1 1
#!/usr/bin/python
2 2
#
3 3

  
4
# Copyright (C) 2006, 2007, 2010 Google Inc.
4
# Copyright (C) 2006, 2007, 2010, 2011 Google Inc.
5 5
#
6 6
# This program is free software; you can redistribute it and/or modify
7 7
# it under the terms of the GNU General Public License as published by
......
76 76
      "198.51.100.4\tmyhost\n")
77 77
    self.assertFileMode(self.tmpname, 0644)
78 78

  
79
  def testSettingOrdering(self):
80
    utils.SetEtcHostsEntry(self.tmpname, "127.0.0.1", "localhost.localdomain",
81
                           ["localhost"])
82

  
83
    self.assertFileContent(self.tmpname,
84
      "# This is a test file for /etc/hosts\n"
85
      "127.0.0.1\tlocalhost.localdomain localhost\n"
86
      "192.0.2.1 router gw\n")
87
    self.assertFileMode(self.tmpname, 0644)
88

  
79 89
  def testRemovingExistingHost(self):
80 90
    utils.RemoveEtcHostsEntry(self.tmpname, "router")
81 91

  

Also available in: Unified diff