Test setting an ACL

This commit is contained in:
Alex Young
2012-07-16 11:38:01 +01:00
parent 66ff06fe0e
commit 8814894874
3 changed files with 14 additions and 2 deletions

View File

@@ -412,6 +412,7 @@ int control_acl(struct control_client* client, int linesc, char** lines)
struct acl * new_acl = acl_create( linesc, lines, default_deny );
if (new_acl->len != linesc) {
warn("Bad ACL spec: %s", lines[new_acl->len] );
write(client->socket, "1: bad spec: ", 13);
write(client->socket, lines[new_acl->len],
strlen(lines[new_acl->len]));
@@ -420,7 +421,8 @@ int control_acl(struct control_client* client, int linesc, char** lines)
}
else {
flexnbd_replace_acl( flexnbd, new_acl );
write( client->socket, "0: updated", 10);
info("ACL set");
write( client->socket, "0: updated\n", 11);
}
return 0;

View File

@@ -494,7 +494,7 @@ void accept_nbd_client(
return;
}
debug( "Client %s accepted.", s_client_address );
info( "Client %s accepted.", s_client_address );
client_params = client_create( params, client_fd );
params->nbd_client[slot].client = client_params;

View File

@@ -92,4 +92,14 @@ class TestHappyPath < Test::Unit::TestCase
assert_equal "12345678", @env.nbd1.read( 2**31+2**29, 8 )
end
def test_set_acl
# Just check that we get sane feedback here
@env.writefile1( "f"*4 )
@env.serve1
_,stderr = @env.acl1("127.0.0.1")
assert_no_match( /^(F|E):/, stderr )
end
end