summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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