summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-24 20:07:38 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-24 20:07:38 +0000
commita25bdd0071ed281c39da155e8ae60f6322e0a143 (patch)
tree1e0f4ce060f986ba88bb1cf073fd4c0d7c827a45
parentbdfe7bc79ac2c7b1fa0d521c84121ca2c56c5a28 (diff)
Test that each test-type returns the correct host.
-rwxr-xr-xt/test-custodian-testfactory.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/test-custodian-testfactory.rb b/t/test-custodian-testfactory.rb
index a14fce9..8ba315e 100755
--- a/t/test-custodian-testfactory.rb
+++ b/t/test-custodian-testfactory.rb
@@ -254,5 +254,31 @@ class TestTestFactory < Test::Unit::TestCase
end
end
+
+ #
+ # Test the target of each test is always what we expect.
+ #
+ def test_target_detection
+
+
+ a = Array.new()
+
+ a.push( "test.host.example.com must run ftp.")
+ a.push( "ftp://test.host.example.com/ must run ftp.")
+ a.push( "ftp://test.host.example.com/foo must run ftp.")
+ a.push( "test.host.example.com must run ping.")
+ a.push( "test.host.example.com must run dns for bytemark.co.uk resolving NS as '80.68.80.26;85.17.170.78;80.68.80.27'.")
+ a.push( "rsync://test.host.example.com must run rsync.")
+ a.push( "rsync://test.host.example.com must run rsync.")
+
+ a.each do |entry|
+ assert_nothing_raised do
+ obj = Custodian::TestFactory.create( entry )
+ assert(obj)
+ assert_equal( "test.host.example.com", obj.target() )
+ end
+ end
+ end
+
end