summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-03-13 13:55:08 -0500
committerLuke Kanies <luke@madstop.com>2008-03-13 13:55:08 -0500
commit495632345d61dda3b094c7ba8f4b1ef662097de5 (patch)
treeae8bfc648c58c69e5b09e1f639ee653100c3837b /test
parentecb873d3a6d2eabc931457bd8f4c185c990976db (diff)
downloadpuppet-495632345d61dda3b094c7ba8f4b1ef662097de5.tar.gz
puppet-495632345d61dda3b094c7ba8f4b1ef662097de5.tar.xz
puppet-495632345d61dda3b094c7ba8f4b1ef662097de5.zip
Fixing #1132 -- host names can now have dashes anywhere.
(Patch by freiheit.)
Diffstat (limited to 'test')
-rwxr-xr-xtest/ral/type/host.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/ral/type/host.rb b/test/ral/type/host.rb
index a5d645bd1..9b744eeec 100755
--- a/test/ral/type/host.rb
+++ b/test/ral/type/host.rb
@@ -153,6 +153,50 @@ class TestHost < Test::Unit::TestCase
assert_raise(Puppet::Error) {
host[:name] = "!invalid.hostname.$$$"
}
+
+ assert_raise(Puppet::Error) {
+ host[:name] = "-boo"
+ }
+
+ assert_raise(Puppet::Error) {
+ host[:name] = "boo-.ness"
+ }
+
+ assert_raise(Puppet::Error) {
+ host[:name] = "boo..ness"
+ }
+ end
+
+ def test_valid_hostname
+ host = mkhost()
+
+ assert_nothing_raised {
+ host[:name] = "yayness"
+ }
+
+ assert_nothing_raised {
+ host[:name] = "yay-ness"
+ }
+
+ assert_nothing_raised {
+ host[:name] = "yay.ness"
+ }
+
+ assert_nothing_raised {
+ host[:name] = "yay.ne-ss"
+ }
+
+ assert_nothing_raised {
+ host[:name] = "y.ay-ne-ss.com"
+ }
+
+ assert_nothing_raised {
+ host[:name] = "y4y.n3-ss"
+ }
+
+ assert_nothing_raised {
+ host[:name] = "y"
+ }
end
end