netconsole remote kernel logger

To configure:

 * set system.netconsole.enabled to true
 * create system.netconsole.target dict
 * set a record with IP address and MAC and interface as subdict

It works with both static and DHCP interfaces, and applies online.
You could use bash-scripting in netconsole.conf.
You could override the MAC.

See tests/pillar/system.sls for further information.

Change-Id: I1cbde47575eb5d32a34cd6d79a063f42dbea7643
diff --git a/tests/integration/system/netconsole_spec.rb b/tests/integration/system/netconsole_spec.rb
new file mode 100644
index 0000000..f517508
--- /dev/null
+++ b/tests/integration/system/netconsole_spec.rb
@@ -0,0 +1,14 @@
+
+## NETCONSOLE
+#
+describe file('/etc/default/netconsole.conf') do
+    it('should exist')
+    its('content') { should match /^PORT="514"/}
+    its('content') { should match /^netconsole "bond0" "192.168.0.1" "ff:ff:ff:ff:ff:ff"/}
+    its('content') { should match /^dmesg -n "debug"/}
+end
+
+describe file('/etc/dhcp/dhclient-exit-hooks.d/netconsole') do
+    it('should exist')
+    its('content') { should match /netconsole_setup/}
+end
diff --git a/tests/pillar/system.sls b/tests/pillar/system.sls
index 216bca5..426f2dc 100644
--- a/tests/pillar/system.sls
+++ b/tests/pillar/system.sls
@@ -265,3 +265,13 @@
         - host1
         - host2
         - .local
+
+    # pillars for netconsole setup
+    netconsole:
+      enabled: true
+      port: 514
+      loglevel: debug
+      target:
+        192.168.0.1:
+          mac: "ff:ff:ff:ff:ff:ff"
+          interface: bond0