--- a/pvl/hosts/tests.py Thu Feb 26 14:40:37 2015 +0200
+++ b/pvl/hosts/tests.py Thu Feb 26 14:48:35 2015 +0200
@@ -468,5 +468,32 @@
], None)
])
+ def testHostDynamic(self):
+ host = Host.build('foo', 'test',
+ ethernet = '00:11:22:33:44:55',
+ )
+
+ self.assertBlocksEqual(list(dhcp.dhcp_host(host)), [
+ (('host', 'foo'), [
+ ('option', 'host-name', "foo"),
+ ('hardware', 'ethernet', '00:11:22:33:44:55'),
+ ], None)
+ ])
+
+ def testHostBoot(self):
+ host = Host.build('foo', 'test',
+ ethernet = '00:11:22:33:44:55',
+ boot = 'boot.lan:debian/wheezy/pxelinux.0',
+ )
+
+ self.assertBlocksEqual(list(dhcp.dhcp_host(host)), [
+ (('host', 'foo'), [
+ ('option', 'host-name', "foo"),
+ ('hardware', 'ethernet', '00:11:22:33:44:55'),
+ ('next-server', 'boot.lan'),
+ ('filename', 'debian/wheezy/pxelinux.0'),
+ ], None)
+ ])
+
if __name__ == '__main__':
unittest.main()