Index: branches/eam_branches/20090522/Nebulous/t/49_client_new.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/49_client_new.t	(revision 24557)
+++ branches/eam_branches/20090522/Nebulous/t/49_client_new.t	(revision 24557)
@@ -0,0 +1,60 @@
+#!/usr/bin/perl
+
+# Copryight (C) 2004-2005  Joshua Hoblitt
+#
+# $Id: 50_client_new.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Apache::Test qw( -withtestmore );
+
+plan tests => 4;
+
+use lib qw( ./t ./lib );
+
+use Nebulous::Client;
+use Nebulous::Util qw( :standard );
+use Test::Nebulous;
+
+my $hostport = Apache::Test->config->{ 'hostport' };
+
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    isa_ok( $neb, "Nebulous::Client" );
+}
+
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+        uri   => "http://example.com/PS/IPP/Nebulous/Client",
+    );
+
+    isa_ok( $neb, "Nebulous::Client" );
+}
+
+Test::Nebulous->setup;
+
+eval {
+    Nebulous::Client->new;
+};
+like( $@, qr/Mandatory parameter/, "no proxy" );
+
+Test::Nebulous->setup;
+
+eval {
+    Nebulous::Client->new(
+        proxy => "foo",
+        dog => "do"
+    );
+};
+like( $@, qr/not listed in the validation options/, "bad param" );
+
+Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/50_client_create.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/50_client_create.t	(revision 24557)
+++ branches/eam_branches/20090522/Nebulous/t/50_client_create.t	(revision 24557)
@@ -0,0 +1,100 @@
+#!/usr/bin/perl
+
+# Copryight (C) 2004-2005  Joshua Hoblitt
+#
+# $Id: 51_client_create.t,v 1.6 2008-05-15 03:24:58 jhoblitt Exp $
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Apache::Test qw( -withtestmore );
+
+plan tests => 9;
+
+use lib qw( ./t ./lib );
+
+use Nebulous::Client;
+use Test::Nebulous;
+use Test::URI;
+use URI::Split qw( uri_split );
+
+my $hostport = Apache::Test->config->{ 'hostport' };
+
+Test::Nebulous->setup;
+
+{
+    # key
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    my $uri = $neb->create("foo");
+    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
+    ok(-e $path, "good filename");
+    uri_scheme_ok($uri, 'file');
+}
+
+Test::Nebulous->setup;
+
+{
+    # key, volume
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    my $uri = $neb->create("foo", "node01");
+
+    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
+    ok(-e $path, "good filename");
+    uri_scheme_ok($uri, 'file');
+}
+
+Test::Nebulous->setup;
+
+{
+    # key, volume == undef
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    my $uri = $neb->create("foo", undef);
+
+    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
+    ok(-e $path, "good filename");
+    uri_scheme_ok($uri, 'file');
+}
+
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    $neb->create("foo");
+    is($neb->create("foo"), undef, "object already exists");
+}
+
+Test::Nebulous->setup;
+
+eval {
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    $neb->create();
+};
+like($@, qr/1 - 2 were expected/, "no params");
+
+Test::Nebulous->setup;
+
+eval {
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+
+    $neb->create(1, 2, 3);
+};
+like($@, qr/1 - 2 were expected/, "too many params");
+
+Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/50_client_new.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/50_client_new.t	(revision 24238)
+++ 	(revision )
@@ -1,60 +1,0 @@
-#!/usr/bin/perl
-
-# Copryight (C) 2004-2005  Joshua Hoblitt
-#
-# $Id: 50_client_new.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
-
-use strict;
-use warnings FATAL => qw( all );
-
-use Apache::Test qw( -withtestmore );
-
-plan tests => 4;
-
-use lib qw( ./t ./lib );
-
-use Nebulous::Client;
-use Nebulous::Util qw( :standard );
-use Test::Nebulous;
-
-my $hostport = Apache::Test->config->{ 'hostport' };
-
-Test::Nebulous->setup;
-
-{
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    isa_ok( $neb, "Nebulous::Client" );
-}
-
-Test::Nebulous->setup;
-
-{
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-        uri   => "http://example.com/PS/IPP/Nebulous/Client",
-    );
-
-    isa_ok( $neb, "Nebulous::Client" );
-}
-
-Test::Nebulous->setup;
-
-eval {
-    Nebulous::Client->new;
-};
-like( $@, qr/Mandatory parameter/, "no proxy" );
-
-Test::Nebulous->setup;
-
-eval {
-    Nebulous::Client->new(
-        proxy => "foo",
-        dog => "do"
-    );
-};
-like( $@, qr/not listed in the validation options/, "bad param" );
-
-Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/51_client_create.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/51_client_create.t	(revision 24238)
+++ 	(revision )
@@ -1,100 +1,0 @@
-#!/usr/bin/perl
-
-# Copryight (C) 2004-2005  Joshua Hoblitt
-#
-# $Id: 51_client_create.t,v 1.6 2008-05-15 03:24:58 jhoblitt Exp $
-
-use strict;
-use warnings FATAL => qw( all );
-
-use Apache::Test qw( -withtestmore );
-
-plan tests => 9;
-
-use lib qw( ./t ./lib );
-
-use Nebulous::Client;
-use Test::Nebulous;
-use Test::URI;
-use URI::Split qw( uri_split );
-
-my $hostport = Apache::Test->config->{ 'hostport' };
-
-Test::Nebulous->setup;
-
-{
-    # key
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    my $uri = $neb->create("foo");
-    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
-    ok(-e $path, "good filename");
-    uri_scheme_ok($uri, 'file');
-}
-
-Test::Nebulous->setup;
-
-{
-    # key, volume
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    my $uri = $neb->create("foo", "node01");
-
-    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
-    ok(-e $path, "good filename");
-    uri_scheme_ok($uri, 'file');
-}
-
-Test::Nebulous->setup;
-
-{
-    # key, volume == undef
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    my $uri = $neb->create("foo", undef);
-
-    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
-    ok(-e $path, "good filename");
-    uri_scheme_ok($uri, 'file');
-}
-
-Test::Nebulous->setup;
-
-{
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create("foo");
-    is($neb->create("foo"), undef, "object already exists");
-}
-
-Test::Nebulous->setup;
-
-eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create();
-};
-like($@, qr/1 - 2 were expected/, "no params");
-
-Test::Nebulous->setup;
-
-eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create(1, 2, 3);
-};
-like($@, qr/1 - 2 were expected/, "too many params");
-
-Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/59_client_delete.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/59_client_delete.t	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/t/59_client_delete.t	(revision 24557)
@@ -10,5 +10,5 @@
 use Apache::Test qw( -withtestmore );
 
-plan tests => 9;
+plan tests => 13;
 
 use lib qw( ./t ./lib );
@@ -26,7 +26,9 @@
         proxy => "http://$hostport/nebulous",
     );
-    $neb->create( "foo" );
+    my $uri = $neb->create( "foo" );
 
     ok( $neb->delete( "foo" ), "delete object" );
+
+    ok( ! -e _get_file_path($uri), "deleted file" );
 
     my $locations = $neb->find_instances( "foo" );
@@ -76,4 +78,27 @@
 }
 
+# force flag
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->create( "foo" );
+
+    is( $neb->delete("foo", undef), 1, "force flag false" );
+}
+
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->create( "foo" );
+
+    is( $neb->delete("foo", 1), 1, "force flag false" );
+}
+
 Test::Nebulous->setup;
 
@@ -84,5 +109,5 @@
     $neb->delete();
 };
-like( $@, qr/1 was expected/, "no params" );
+like( $@, qr/1 - 2 were expected/, "no params" );
 
 Test::Nebulous->setup;
@@ -92,7 +117,17 @@
         proxy => "http://$hostport/nebulous",
     );
-    $neb->delete( "foo", 2 );
+    $neb->delete( "foo", 3);
 };
-like( $@, qr/1 was expected/, "too many params" );
+like( $@, qr/is boolean/, "force flag not boolean" );
+
+Test::Nebulous->setup;
+
+eval {
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->delete( "foo", 0, 2 );
+};
+like( $@, qr/1 - 2 were expected/, "too many params" );
 
 Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/62_client_delete_instance.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/62_client_delete_instance.t	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/t/62_client_delete_instance.t	(revision 24557)
@@ -10,5 +10,5 @@
 use Apache::Test qw( -withtestmore );
 
-plan tests => 11;
+plan tests => 10;
 
 use lib qw( ./t ./lib );
@@ -35,6 +35,4 @@
 
     is( $uri, @$locations[0], "delete instance" );
-
-    ok( ! -e _get_file_path( @$locations[0] ), "deleted file" );
 }
 
Index: branches/eam_branches/20090522/Nebulous/t/66_client_xattr.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/66_client_xattr.t	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/t/66_client_xattr.t	(revision 24557)
@@ -1,7 +1,5 @@
 #!/usr/bin/perl
 
-# Copryight (C) 2007-2008  Joshua Hoblitt
-#
-# $Id: 66_client_xattr.t,v 1.1 2008-05-20 00:54:30 jhoblitt Exp $
+# Copryight (C) 2007-2009  Joshua Hoblitt
 
 use strict;
@@ -9,6 +7,5 @@
 
 use Apache::Test qw( -withtestmore );
-plan tests => 32;
-
+plan tests => 44;
 
 use lib qw( ./t ./lib );
@@ -20,4 +17,8 @@
 my $hostport = Apache::Test->config->{ 'hostport' };
 
+my $neb = Nebulous::Client->new(
+    proxy => "http://$hostport/nebulous",
+);
+
 # 1 key / xattr
 
@@ -25,21 +26,17 @@
 
 {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
     my $uri = $neb->create('foo');
 
-    ok($neb->setxattr('foo', 'bar', 'baz', 'create'), 'set object xattr');
+    ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr');
     {
         my $xattrs = $neb->listxattr('foo');
         is(scalar @$xattrs, 1, 'number of xattrs');
-        is(@$xattrs[0], 'bar', 'xattr name');
-    }
-
-    my $value = $neb->getxattr('foo', 'bar');
+        is(@$xattrs[0], 'user.bar', 'xattr name');
+    }
+
+    my $value = $neb->getxattr('foo', 'user.bar');
     is($value, 'baz', 'xattr value');
 
-    ok($neb->removexattr('foo', 'bar'), "remove object xattr");
+    ok($neb->removexattr('foo', 'user.bar'), "remove object xattr");
     {
         my $xattrs = $neb->listxattr('foo');
@@ -53,27 +50,23 @@
 
 {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
     my $uri = $neb->create('foo');
 
-    ok($neb->setxattr('foo', 'bar', 'baz', 'create'), 'set object xattr');
-    ok($neb->setxattr('foo', 'bonk', 'quix', 'create'), 'set object xattr');
+    ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr');
+    ok($neb->setxattr('foo', 'user.bonk', 'quix', 'create'), 'set object xattr');
     
     {
         my $xattrs = $neb->listxattr('foo');
         is(scalar @$xattrs, 2, 'number of xattrs');
-        is(@$xattrs[0], 'bar', 'xattr name');
-        is(@$xattrs[1], 'bonk', 'xattr name');
-    }
-
-    my $value = $neb->getxattr('foo', 'bar');
+        is(@$xattrs[0], 'user.bar', 'xattr name');
+        is(@$xattrs[1], 'user.bonk', 'xattr name');
+    }
+
+    my $value = $neb->getxattr('foo', 'user.bar');
     is($value, 'baz', 'xattr value');
-    $value = $neb->getxattr('foo', 'bonk');
+    $value = $neb->getxattr('foo', 'user.bonk');
     is($value, 'quix', 'xattr value');
 
-    ok($neb->removexattr('foo', 'bar'), "remove object xattr");
-    ok($neb->removexattr('foo', 'bonk'), "remove object xattr");
+    ok($neb->removexattr('foo', 'user.bar'), "remove object xattr");
+    ok($neb->removexattr('foo', 'user.bonk'), "remove object xattr");
     {
         my $xattrs = $neb->listxattr('foo');
@@ -87,23 +80,19 @@
 
 {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
     my $uri = $neb->create('foo');
 
-    ok($neb->setxattr('foo', 'bar', 'baz', 'create'), 'set object xattr');
-    ok($neb->setxattr('foo', 'bar', 'quix', 'replace'), 're-set object xattr');
+    ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr');
+    ok($neb->setxattr('foo', 'user.bar', 'quix', 'replace'), 're-set object xattr');
     
     {
         my $xattrs = $neb->listxattr('foo');
         is(scalar @$xattrs, 1, 'number of xattrs');
-        is(@$xattrs[0], 'bar', 'xattr name');
-    }
-
-    my $value = $neb->getxattr('foo', 'bar');
+        is(@$xattrs[0], 'user.bar', 'xattr name');
+    }
+
+    my $value = $neb->getxattr('foo', 'user.bar');
     is($value, 'quix', 'xattr value');
 
-    ok($neb->removexattr('foo', 'bar'), "remove object xattr");
+    ok($neb->removexattr('foo', 'user.bar'), "remove object xattr");
     {
         my $xattrs = $neb->listxattr('foo');
@@ -117,8 +106,27 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
+    $neb->setxattr('foo', 'user.bar', 'baz', 'create');
+};
+like($@, qr/is valid object key/, "create xattr on non-existant key");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+
+    $neb->setxattr('foo', 'luser.bar', 'baz', 'create');
+};
+like($@, qr/xattr is in user. namespace/, "user. namspace");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->setxattr('foo', 'user.bar', 'baz', 'replace');
+};
+like($@, qr/is valid object key/, "replace xattr on non-existant key");
+
+Test::Nebulous->setup;
+
+eval {
     $neb->setxattr();
 };
@@ -128,11 +136,7 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create('foo');
-
-    $neb->setxattr('foo', 'bar');
+    $neb->create('foo');
+
+    $neb->setxattr('foo', 'user.bar');
 };
 like($@, qr/4 were expected/, "too few params");
@@ -141,11 +145,7 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create('foo');
-
-    $neb->setxattr('foo', 'bar', 'baz');
+    $neb->create('foo');
+
+    $neb->setxattr('foo', 'user.bar', 'baz');
 };
 like($@, qr/4 were expected/, "too few params");
@@ -154,14 +154,62 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create('foo');
-
-    $neb->setxattr('foo', 'bar', 'baz', 'create', 'quix');
+    $neb->create('foo');
+
+    $neb->setxattr('foo', 'user.bar', 'baz', 'create', 'quix');
 };
 like($@, qr/4 were expected/, "too many params");
 
+# getxattr
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->getxattr('foo', 'bar');
+};
+like($@, qr/is valid object key/, "get xattr from non-existant nebulous key");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+
+    $neb->getxattr('foo', 'luser.bar');
+};
+like($@, qr/xattr is in user. namespace/, "user. namespace");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+    $neb->getxattr('foo', 'user.bar');
+};
+like($@, qr|xattr neb:///foo:user.bar does not exist|,
+    "get xattr from non-existant xattr key");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->getxattr();
+};
+like($@, qr/2 were expected/, "no params");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+
+    $neb->getxattr('foo');
+};
+like($@, qr/2 were expected/, "too few params");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+
+    $neb->getxattr('foo', 'user.bar', 'baz');
+};
+like($@, qr/2 were expected/, "too many params");
+
 # listxattr
 
@@ -169,8 +217,4 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
     $neb->create('foo');
 
@@ -182,8 +226,4 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
     $neb->create('foo');
 
@@ -192,14 +232,35 @@
 like($@, qr/1 was expected/, "too many params");
 
-# getxattr
-
-Test::Nebulous->setup;
-
-eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->getxattr();
+# removexattr
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->removexattr('foo', 'user.bar');
+};
+like($@, qr/is valid object key/, "remove xattr from non-existant nebulous key");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+
+    $neb->getxattr('foo', 'luser.bar');
+};
+like($@, qr/xattr is in user. namespace/, "user. namespace");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create('foo');
+    $neb->removexattr('foo', 'user.bar');
+};
+like($@, qr|xattr neb:///foo:user.bar does not exist|,
+    "remove xattr from non-existant xattr key");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->removexattr();
 };
 like($@, qr/2 were expected/, "no params");
@@ -208,11 +269,7 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create('foo');
-
-    $neb->getxattr('foo');
+    $neb->create('foo');
+
+    $neb->removexattr('foo');
 };
 like($@, qr/2 were expected/, "too few params");
@@ -221,11 +278,7 @@
 
 eval {
-    my $neb = Nebulous::Client->new(
-        proxy => "http://$hostport/nebulous",
-    );
-
-    $neb->create('foo');
-
-    $neb->getxattr('foo', 'bar', 'baz');
+    $neb->create('foo');
+
+    $neb->removexattr('foo', 'user.bar', 'baz');
 };
 like($@, qr/2 were expected/, "too many params");
Index: branches/eam_branches/20090522/Nebulous/t/68_client_chmod.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/68_client_chmod.t	(revision 24557)
+++ branches/eam_branches/20090522/Nebulous/t/68_client_chmod.t	(revision 24557)
@@ -0,0 +1,117 @@
+#!/usr/bin/perl
+
+# Copryight (C) 2009  Joshua Hoblitt
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Apache::Test qw( -withtestmore );
+
+plan tests => 13;
+
+use lib qw( ./t ./lib );
+
+use Nebulous::Client;
+use Nebulous::Util qw( :standard );
+use Test::URI;
+use Test::Nebulous;
+use URI;
+use File::stat;
+
+my $hostport = Apache::Test->config->{ 'hostport' };
+
+my $neb = Nebulous::Client->new(
+    proxy => "http://$hostport/nebulous",
+);
+
+Test::Nebulous->setup;
+
+# object with one instance
+{
+    my $key = "foo";
+    my $uri = $neb->create($key);
+
+    my $path = URI->new($uri)->path;
+    my $st1 = stat($path);
+
+    my $mode = $neb->chmod($key, 0440);
+    my $st2 = stat($path);
+
+    is($st2->mode &07777, 0440, "chmod() single instance");
+    is($mode, 0440, "returned mode");
+    is($neb->getxattr($key, 'user.mode'), 0440, "xattr user.mode");
+}
+
+Test::Nebulous->setup;
+
+# object with two instances
+{
+    my $key = "foo";
+    my $uri1 = $neb->create($key);
+    my $uri2 = $neb->replicate($key);
+
+    my $mode = $neb->chmod($key, 0440);
+
+    my $st1 = stat(URI->new($uri1)->path);
+    my $st2 = stat(URI->new($uri2)->path);
+
+    is($st1->mode &07777, 0440, "chmod() first instance");
+    is($st2->mode &07777, 0440, "chmod() second instance");
+    is($mode, 0440, "returned mode");
+    is($neb->getxattr($key, 'user.mode'), 0440, "xattr user.mode");
+}
+
+Test::Nebulous->setup;
+
+{
+    my $mode = $neb->chmod("foo", 0644);
+
+    is($mode, undef, "object does not exist");
+}
+
+Test::Nebulous->setup;
+
+{
+    $neb->create("foo");
+
+    my $mode = $neb->chmod("foo", 0640);
+
+    is($mode, undef, "mode is not 0440");
+}
+
+Test::Nebulous->setup;
+
+{
+    $neb->create("foo");
+
+    my $mode = $neb->chmod("foo", 999);
+
+    is($mode, undef, "bad mode");
+}
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->chmod();
+};
+like($@, qr/2 were expected/, "no params");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create("foo");
+
+    $neb->chmod("foo");
+};
+like($@, qr/2 were expected/, "one param");
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create("foo");
+
+    $neb->chmod("foo", 0440, 2);
+};
+like($@, qr/2 were expected/, "three params");
+
+Test::Nebulous->cleanup;
Index: branches/eam_branches/20090522/Nebulous/t/70_neb-ls.t
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/70_neb-ls.t	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/t/70_neb-ls.t	(revision 24557)
@@ -38,4 +38,5 @@
 
 # NEB_SERVER env var not set
+undef $ENV{'NEB_SERVER'} if defined $ENV{'NEB_SERVER'};
 Test::Nebulous->setup;
 
@@ -82,5 +83,5 @@
 
     is($? >> 8, 0, "exit code");
-    like($test->stdout, qr/^foo bar$/,  "stdout");
+    like($test->stdout, qr/^foo\nbar$/,  "stdout");
     like($test->stderr, qr/^$/,         "stderr");
 }
@@ -160,5 +161,5 @@
 
     is($? >> 8, 0, "exit code");
-    like($test->stdout, qr|^a/foo a/bar$|,  "stdout");
+    like($test->stdout, qr|^a/foo\na/bar$|,  "stdout");
     like($test->stderr, qr/^$/,             "stderr");
 }
Index: branches/eam_branches/20090522/Nebulous/t/conf/startup.pl.in
===================================================================
--- branches/eam_branches/20090522/Nebulous/t/conf/startup.pl.in	(revision 24238)
+++ branches/eam_branches/20090522/Nebulous/t/conf/startup.pl.in	(revision 24557)
@@ -18,4 +18,5 @@
 my $config = Nebulous::Server::Config->new(
     trace       => 'all',
+    memcached_servers => ['127.0.0.1:11211'],
 );
 $config->add_db(
