Revision 0ea11dcb test/ganeti.config_unittest.py
b/test/ganeti.config_unittest.py | ||
---|---|---|
201 | 201 |
my_ndparams = { |
202 | 202 |
constants.ND_OOB_PROGRAM: "/bin/node-oob", |
203 | 203 |
constants.ND_SPINDLE_COUNT: 1, |
204 |
constants.ND_EXCLUSIVE_STORAGE: False, |
|
204 | 205 |
} |
205 | 206 |
|
206 | 207 |
cfg = self._get_object() |
... | ... | |
209 | 210 |
cfg.Update(node, None) |
210 | 211 |
self.assertEqual(cfg.GetNdParams(node), my_ndparams) |
211 | 212 |
|
213 |
def testGetNdParamsInheritance(self): |
|
214 |
node_ndparams = { |
|
215 |
constants.ND_OOB_PROGRAM: "/bin/node-oob", |
|
216 |
} |
|
217 |
group_ndparams = { |
|
218 |
constants.ND_SPINDLE_COUNT: 10, |
|
219 |
} |
|
220 |
expected_ndparams = { |
|
221 |
constants.ND_OOB_PROGRAM: "/bin/node-oob", |
|
222 |
constants.ND_SPINDLE_COUNT: 10, |
|
223 |
constants.ND_EXCLUSIVE_STORAGE: |
|
224 |
constants.NDC_DEFAULTS[constants.ND_EXCLUSIVE_STORAGE], |
|
225 |
} |
|
226 |
cfg = self._get_object() |
|
227 |
node = cfg.GetNodeInfo(cfg.GetNodeList()[0]) |
|
228 |
node.ndparams = node_ndparams |
|
229 |
cfg.Update(node, None) |
|
230 |
group = cfg.GetNodeGroup(node.group) |
|
231 |
group.ndparams = group_ndparams |
|
232 |
cfg.Update(group, None) |
|
233 |
self.assertEqual(cfg.GetNdParams(node), expected_ndparams) |
|
234 |
|
|
212 | 235 |
def testAddGroupFillsFieldsIfMissing(self): |
213 | 236 |
cfg = self._get_object() |
214 | 237 |
group = objects.NodeGroup(name="test", members=[]) |
Also available in: Unified diff