Skip to content

Commit

Permalink
More misc unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
David Scott committed Aug 7, 2012
1 parent 583e86a commit 47f26bf
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions server_test/server_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,28 @@ let test_mkdir () =
run store [
dom0, none, Read "/a/b", Err "ENOENT";
dom0, none, Read "/a", Err "ENOENT";
dom0, none, Mkdir "/a", OK;
dom0, none, Mkdir "/a/b", OK;
dom0, none, Setperms("/a/b", example_acl), OK;
];
let tid = (success ++ int32) id (rpc store dom0 none Transaction_start) in
run store [
dom0, tid, Mkdir "/bench/local/domain/0", OK;
dom0, tid, Setperms("/bench/local/domain/0", example_acl), OK;
dom0, tid, Read "/bench/local/domain/0", OK;
dom0, tid, Transaction_end true, OK;
]

let test_empty () =
(* Check that I can read an empty value *)
let dom0 = Connection.create 0 in
let store = empty_store () in
let open Xs_packet.Request in
run store [
dom0, none, Write("/a", ""), OK;
dom0, none, Read "/a", OK;
]

let test_directory () =
()

let test_rm () =
(* rm of a missing node from an existing parent should succeed *)
(* rm of a missing node from a missing parent should ENOENT *)
Expand Down Expand Up @@ -416,6 +433,7 @@ let _ =
"getperms(setperms)" >:: test_setperms_getperms;
"test_setperms_owner" >:: test_setperms_owner;
"test_mkdir" >:: test_mkdir;
"test_empty" >:: test_empty;
"test_rm" >:: test_rm;
"test_restrict" >:: test_restrict;
"test_set_target" >:: test_set_target;
Expand Down

0 comments on commit 47f26bf

Please sign in to comment.