Changeset 17756 for trunk/Nebulous/t/56_client_find_instances.t
- Timestamp:
- May 19, 2008, 5:46:11 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/t/56_client_find_instances.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/t/56_client_find_instances.t
r5667 r17756 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 56_client_find_instances.t,v 1. 1 2005-12-03 02:52:31 jhoblitt Exp $5 # $Id: 56_client_find_instances.t,v 1.2 2008-05-20 03:46:11 jhoblitt Exp $ 6 6 7 7 use strict; … … 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 19;12 plan tests => 29; 13 13 14 14 use lib qw( ./t ./lib ); … … 74 74 75 75 { 76 # key, volume == undef 77 my $neb = Nebulous::Client->new( 78 proxy => "http://$hostport/nebulous", 79 ); 80 $neb->create( "foo" ); 81 82 my $locations = $neb->find_instances( "foo", undef ); 83 84 is( scalar @$locations, 1, "found 1" ); 85 like( @$locations[0], qr/file:/, "URIs match" ); 86 ok( -e _get_file_path( @$locations[0] ), "URI matches file" ); 87 } 88 89 Test::Nebulous->setup; 90 91 { 92 # volume/key 93 my $neb = Nebulous::Client->new( 94 proxy => "http://$hostport/nebulous", 95 ); 96 $neb->create( "foo" ); 97 98 my $locations = $neb->find_instances( "neb://node01/foo"); 99 100 is( scalar @$locations, 1, "found 1" ); 101 like( @$locations[0], qr/file:/, "URIs match" ); 102 ok( -e _get_file_path( @$locations[0] ), "URI matches file" ); 103 } 104 105 Test::Nebulous->setup; 106 107 { 108 # volume/key, volume override 109 my $neb = Nebulous::Client->new( 110 proxy => "http://$hostport/nebulous", 111 ); 112 $neb->create( "foo", "node01" ); 113 114 my $locations = $neb->find_instances( "neb://node01/foo", "node02" ); 115 116 is($locations, undef, "no instances on specified volume" ); 117 } 118 119 Test::Nebulous->setup; 120 121 { 122 # volume/key, volume override 123 my $neb = Nebulous::Client->new( 124 proxy => "http://$hostport/nebulous", 125 ); 126 $neb->create( "foo", "node01" ); 127 128 my $locations = $neb->find_instances( "neb://node02/foo", ":any" ); 129 130 is( scalar @$locations, 1, "found 1" ); 131 like( @$locations[0], qr/file:/, "URIs match" ); 132 ok( -e _get_file_path( @$locations[0] ), "URI matches file" ); 133 } 134 135 Test::Nebulous->setup; 136 137 { 76 138 # key 77 139 my $neb = Nebulous::Client->new(
Note:
See TracChangeset
for help on using the changeset viewer.
