diff options
author | Stefan Schulte <stefan.schulte@taunusstein.net> | 2010-11-17 22:59:47 +0100 |
---|---|---|
committer | Nick Lewis <nick@puppetlabs.com> | 2010-11-17 15:55:24 -0800 |
commit | 8efdc769db2e144fe61eccbb1663a1c9594b09ab (patch) | |
tree | 413e081f4b908d6270bfd6cd44631118ab9b137b /test | |
parent | 53bb805f118ccaca5598e60afadfa6b777410a0f (diff) | |
download | puppet-8efdc769db2e144fe61eccbb1663a1c9594b09ab.tar.gz puppet-8efdc769db2e144fe61eccbb1663a1c9594b09ab.tar.xz puppet-8efdc769db2e144fe61eccbb1663a1c9594b09ab.zip |
(#5274) Tests for hostprovider removes comments
I noticed that the hostprovider will remove all inline comments from the
/etc/hosts file, when puppet updates at least one entry. Puppet will also
remove comments from entries, the user doesnt want to manage with
puppet.
To split up changes a bit this commit will only introduce tests for the
host type and the hostprovider. A few will fail, indicating the bug:
The hostprovider parses all entries and builds a hash. When building
the recordhash all comments are discarded. When puppet has to update at
least one entry it uses the to_line function to convert the record hash
back to a file. Because the comments are not stored in the hash, they
cannot be written back to the file.
Diffstat (limited to 'test')
-rw-r--r-- | test/data/providers/host/parsed/valid_hosts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/data/providers/host/parsed/valid_hosts b/test/data/providers/host/parsed/valid_hosts new file mode 100644 index 000000000..de5caf740 --- /dev/null +++ b/test/data/providers/host/parsed/valid_hosts @@ -0,0 +1,14 @@ +# Some leading comment, that should be ignored +# The next line is empty so it should be ignored + +::1 localhost + +# We now try another delimiter: Several tabs +127.0.0.1 localhost + +# No test trailing spaces +10.0.0.1 host1 + +# Ok its time to test aliases +2001:252:0:1::2008:8 ipv6host alias1 +192.168.0.1 ipv4host alias2 alias3 |