pvl/hosts/tests.py
changeset 491 cfcb47a3dc3e
parent 490 805645dbb9bb
child 492 ddd13dadf6a8
equal deleted inserted replaced
490:805645dbb9bb 491:cfcb47a3dc3e
   448                 ('hardware', 'ethernet', '00:11:22:33:44:55'),
   448                 ('hardware', 'ethernet', '00:11:22:33:44:55'),
   449             ], None)
   449             ], None)
   450         ])
   450         ])
   451 
   451 
   452     def testHostBoot(self):
   452     def testHostBoot(self):
   453         host = Host.build('foo', 'test',
   453         hosts = [
   454                 ethernet    = '00:11:22:33:44:55',
   454                 Host.build('foo1', 'test',
   455                 boot        = 'boot.lan:debian/wheezy/pxelinux.0',
   455                         ethernet    = '00:11:22:33:44:55',
   456         )
   456                         boot        = 'boot.lan:debian/wheezy/pxelinux.0',
   457 
   457                 ),
   458         self.assertBlocksEqual(list(dhcp.dhcp_host(host)), [
   458                 Host.build('foo2', 'test',
   459             (('host', 'foo'), [
   459                         ethernet    = '00:11:22:33:44:55',
   460                 ('option', 'host-name', "foo"),
   460                         boot        = 'boot.lan:',
       
   461                 ),
       
   462                 Host.build('foo3', 'test',
       
   463                         ethernet    = '00:11:22:33:44:55',
       
   464                         boot        = '/debian/wheezy/pxelinux.0',
       
   465                 ),
       
   466         ]
       
   467 
       
   468         self.assertBlocksEqual(list(dhcp.dhcp_hosts(hosts)), [
       
   469             (('host', 'foo1'), [
       
   470                 ('option', 'host-name', "foo1"),
   461                 ('hardware', 'ethernet', '00:11:22:33:44:55'),
   471                 ('hardware', 'ethernet', '00:11:22:33:44:55'),
   462                 ('next-server', 'boot.lan'),
   472                 ('next-server', 'boot.lan'),
   463                 ('filename', 'debian/wheezy/pxelinux.0'),
   473                 ('filename', 'debian/wheezy/pxelinux.0'),
   464             ], None)
   474             ], None),
       
   475             (('host', 'foo2'), [
       
   476                 ('option', 'host-name', "foo2"),
       
   477                 ('hardware', 'ethernet', '00:11:22:33:44:55'),
       
   478                 ('next-server', 'boot.lan'),
       
   479             ], None),
       
   480             (('host', 'foo3'), [
       
   481                 ('option', 'host-name', "foo3"),
       
   482                 ('hardware', 'ethernet', '00:11:22:33:44:55'),
       
   483                 ('filename', 'debian/wheezy/pxelinux.0'),
       
   484             ], None),
   465         ])
   485         ])
   466 
   486 
   467     def testHosts(self):
   487     def testHosts(self):
   468         hosts = [
   488         hosts = [
   469                 Host.build('foo', 'test',
   489                 Host.build('foo', 'test',