# Test_Collectd

Provides unit tests and examples for the Collectd lens.

Summary

Test_Collectd | Provides unit tests and examples for the Collectd lens.
Augeas Variables |
simple |
Augeas Tests |
Collectd.lns |
Augeas Variables |
filters |
Augeas Tests |
Collectd.lns |

### Augeas Variables

### simple

> let simple = "LoadPlugin contextswitch LoadPlugin cpu FQDNLookup \"true\" Include \"/var/lib/puppet/modules/collectd/plugins/*.conf\" "

### Augeas Tests

### Collectd.lns

> test Collectd.lns get simple = { "directive" = "LoadPlugin" { "arg" = "contextswitch" } } { "directive" = "LoadPlugin" { "arg" = "cpu" } } { "directive" = "FQDNLookup" { "arg" = "\"true\"" } } { "directive" = "Include" { "arg" = "\"/var/lib/puppet/modules/collectd/plugins/*.conf\"" } }

### Augeas Variables

### filters

> let filters = "<Chain \"PreCache\"> <Rule \"no_fqdn\"> <Match \"regex\"> Host \"^[^\.]*$\" Invert false </Match> Target \"stop\" </Rule> </Chain> "

### Augeas Tests

### Collectd.lns

> test Collectd.lns get filters = { "Chain" { "arg" = "\"PreCache\"" } { "Rule" { "arg" = "\"no_fqdn\"" } { "Match" { "arg" = "\"regex\"" } { "directive" = "Host" { "arg" = "\"^[^\.]*$\"" } } { "directive" = "Invert" { "arg" = "false" } } } { "directive" = "Target" { "arg" = "\"stop\"" } } } }

Parses collectd configuration files

> let simple = "LoadPlugin contextswitch LoadPlugin cpu FQDNLookup \"true\" Include \"/var/lib/puppet/modules/collectd/plugins/*.conf\" "

> test Collectd.lns get simple = { "directive" = "LoadPlugin" { "arg" = "contextswitch" } } { "directive" = "LoadPlugin" { "arg" = "cpu" } } { "directive" = "FQDNLookup" { "arg" = "\"true\"" } } { "directive" = "Include" { "arg" = "\"/var/lib/puppet/modules/collectd/plugins/*.conf\"" } }

> let filters = "<Chain \"PreCache\"> <Rule \"no_fqdn\"> <Match \"regex\"> Host \"^[^\.]*$\" Invert false </Match> Target \"stop\" </Rule> </Chain> "

Close