Changeset 19431 for trunk/Nebulous-Server/t
- Timestamp:
- Sep 8, 2008, 4:18:47 PM (18 years ago)
- Location:
- trunk/Nebulous-Server/t
- Files:
-
- 3 edited
-
03_server_create_object.t (modified) (10 diffs)
-
04_server_replicate_object.t (modified) (3 diffs)
-
75_parse_neb_key.t (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/t/03_server_create_object.t
r18452 r19431 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 03_server_create_object.t,v 1.2 7 2008-07-10 00:20:02jhoblitt Exp $5 # $Id: 03_server_create_object.t,v 1.28 2008-09-09 02:18:47 jhoblitt Exp $ 6 6 7 7 use strict; … … 353 353 354 354 eval { 355 $neb->create_object("foo", ' node03');355 $neb->create_object("foo", '~node03'); 356 356 }; 357 357 like($@, qr/node03 is not available/, "request volume this is full"); … … 360 360 361 361 eval { 362 $neb->create_object("neb:// node03/foo");362 $neb->create_object("neb://~node03/foo"); 363 363 }; 364 364 like($@, qr/node03 is not available/, "request volume this is full"); … … 367 367 368 368 eval { 369 $neb->create_object("foo", ' node04');369 $neb->create_object("foo", '~node04'); 370 370 }; 371 371 like($@, qr/node04 is not available/, "request volume with allocate = FALSE, available = FALSE"); … … 374 374 375 375 eval { 376 $neb->create_object("neb:// node04/foo");376 $neb->create_object("neb://~node04/foo"); 377 377 }; 378 378 like($@, qr/node04 is not available/, "request volume with allocate = FALSE, available = FALSE"); … … 381 381 382 382 eval { 383 $neb->create_object("foo", ' node05');383 $neb->create_object("foo", '~node05'); 384 384 }; 385 385 like($@, qr/node05 is not available/, "request volume with allocate = FALSE , available = TRUE"); … … 388 388 389 389 eval { 390 $neb->create_object("neb:// node05/foo");390 $neb->create_object("neb://~node05/foo"); 391 391 }; 392 392 like($@, qr/node05 is not available/, "request volume with allocate = FALSE , available = TRUE"); … … 395 395 396 396 eval { 397 $neb->create_object("foo", ' node06');397 $neb->create_object("foo", '~node06'); 398 398 }; 399 399 like($@, qr/node06 is not available/, "request volume with allocate = TRUE, available = FALSE"); … … 402 402 403 403 eval { 404 $neb->create_object("neb:// node06/foo");404 $neb->create_object("neb://~node06/foo"); 405 405 }; 406 406 like($@, qr/node06 is not available/, "request volume with allocate = TRUE, available = FALSE"); … … 408 408 Test::Nebulous->setup; 409 409 410 eval { 411 $neb->create_object("foo", 99); 412 }; 413 like($@, qr/did not pass the \'is valid volume name\'/, "volume name doesn't exist"); 410 { 411 ok($neb->create_object("foo", 99)); 412 } 413 414 Test::Nebulous->setup; 415 416 eval { 417 $neb->create_object("foo", "~99"); 418 }; 419 like($@, qr/is not a valid volume name/, "volume name doesn't exist"); 414 420 415 421 Test::Nebulous->setup; -
trunk/Nebulous-Server/t/04_server_replicate_object.t
r18452 r19431 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 04_server_replicate_object.t,v 1.1 4 2008-07-10 00:20:02jhoblitt Exp $5 # $Id: 04_server_replicate_object.t,v 1.15 2008-09-09 02:18:47 jhoblitt Exp $ 6 6 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 2 5;10 use Test::More tests => 26; 11 11 12 12 use lib qw( ./t ./lib ); … … 82 82 # key, $volume 83 83 $neb->create_object("foo"); 84 my $uri1 = $neb->replicate_object("foo", " node01");85 my $uri2 = $neb->replicate_object("foo", " node02");84 my $uri1 = $neb->replicate_object("foo", "~node01"); 85 my $uri2 = $neb->replicate_object("foo", "~node02"); 86 86 87 87 { … … 155 155 Test::Nebulous->setup; 156 156 157 { 158 $neb->create_object('foo'); 159 ok($neb->replicate_object('foo', 'bar'),'soft fake storage volume'); 160 } 161 162 Test::Nebulous->setup; 163 157 164 eval { 158 165 $neb->create_object('foo'); 159 $neb->replicate_object('foo', ' bar');166 $neb->replicate_object('foo', '~bar'); 160 167 }; 161 like($@, qr/is valid volume name/, 'storage volume does not exist');168 like($@, qr/is not a valid volume name/, 'storage volume does not exist'); 162 169 163 170 Test::Nebulous->setup; -
trunk/Nebulous-Server/t/75_parse_neb_key.t
r18451 r19431 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 75_parse_neb_key.t,v 1. 4 2008-07-09 23:32:35jhoblitt Exp $5 # $Id: 75_parse_neb_key.t,v 1.5 2008-09-09 02:18:47 jhoblitt Exp $ 6 6 7 7 use strict; … … 77 77 is($key->path, 'foo/bar/baz/quix', 'path'); 78 78 is($key->volume, 'boing', 'volume name'); 79 is($key->soft_volume, undef, 'soft volume name');79 is($key->soft_volume, 1, 'soft volume name'); 80 80 } 81 81 … … 85 85 is($key->path, 'foo/bar/baz/quix', 'path'); 86 86 is($key->volume, 'boing', 'volume name'); 87 is($key->soft_volume, 1, 'soft volume name');87 is($key->soft_volume, undef, 'soft volume name'); 88 88 } 89 89 … … 94 94 is($key->path, 'bar/baz/quix', 'path'); 95 95 is($key->volume, 'foo', 'volume name'); 96 is($key->soft_volume, undef, 'soft volume name');96 is($key->soft_volume, 1, 'soft volume name'); 97 97 } 98 98 … … 102 102 is($key->path, 'bar/baz/quix', 'path'); 103 103 is($key->volume, 'foo', 'volume name'); 104 is($key->soft_volume, undef, 'soft volume name');104 is($key->soft_volume, 1, 'soft volume name'); 105 105 } 106 106 … … 110 110 is($key->path, 'bar/baz/quix', 'path'); 111 111 is($key->volume, 'foo', 'volume name'); 112 is($key->soft_volume, undef, 'soft volume name');112 is($key->soft_volume, 1, 'soft volume name'); 113 113 } 114 114 … … 118 118 is($key->path, 'bar/baz/quix', 'path'); 119 119 is($key->volume, 'foo', 'volume name'); 120 is($key->soft_volume, undef, 'soft volume name');120 is($key->soft_volume, 1, 'soft volume name'); 121 121 } 122 122 … … 126 126 is($key->path, 'bar/baz/quix', 'path'); 127 127 is($key->volume, 'foo', 'volume name'); 128 is($key->soft_volume, undef, 'soft volume name');129 } 130 131 # URI w/ softvolume name128 is($key->soft_volume, 1, 'soft volume name'); 129 } 130 131 # URI w/ hard volume name 132 132 { 133 133 my $key = parse_neb_key('neb://~foo/bar/baz/quix/'); … … 135 135 is($key->path, 'bar/baz/quix', 'path'); 136 136 is($key->volume, 'foo', 'volume name'); 137 is($key->soft_volume, 1, 'soft volume name');137 is($key->soft_volume, undef, 'soft volume name'); 138 138 } 139 139 … … 144 144 is($key->path, 'bar/baz/quix', 'path'); 145 145 is($key->volume, 'boing', 'volume name'); 146 is($key->soft_volume, undef, 'soft volume name');146 is($key->soft_volume, 1, 'soft volume name'); 147 147 } 148 148 … … 152 152 is($key->path, 'bar/baz/quix', 'path'); 153 153 is($key->volume, 'boing', 'volume name'); 154 is($key->soft_volume, 1, 'soft volume name');154 is($key->soft_volume, undef, 'soft volume name'); 155 155 } 156 156 … … 160 160 is($key->path, 'bar/baz/quix', 'path'); 161 161 is($key->volume, 'foo', 'volume name'); 162 is($key->soft_volume, undef, 'soft volume name');162 is($key->soft_volume, 1, 'soft volume name'); 163 163 } 164 164 … … 189 189 } 190 190 191 # URI w/ softvolume name191 # URI w/ hard volume name 192 192 { 193 193 my $key = parse_neb_key('neb://~foo/bar/baz/quix/'); … … 195 195 is($key->path, 'bar/baz/quix', 'path'); 196 196 is($key->volume, 'foo', 'volume name'); 197 is($key->soft_volume, 1, 'soft volume name');197 is($key->soft_volume, undef, 'soft volume name'); 198 198 } 199 199
Note:
See TracChangeset
for help on using the changeset viewer.
