Skip to content

Commit

Permalink
Merge pull request #484 from openvstorage/fix-proxy-osd-test
Browse files Browse the repository at this point in the history
fix proxy_osd test_assert
  • Loading branch information
domsj authored Dec 6, 2016
2 parents ef4c2b8 + e2bc2f1 commit 3219eb0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ocaml/src/proxy_osd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,19 @@ class t
List.map2
(fun assert_ mf_v_o ->
let open Proxy_protocol.Protocol in
let failed_assert key = Osd.Error.(lwt_fail (Assert_failed (Slice.get_string_unsafe key))) in
match assert_, mf_v_o with
| Osd.Assert.Value (key, None), None ->
Lwt.return (Assert.ObjectDoesNotExist (Slice.get_string_unsafe key))
| Osd.Assert.Value (key, None), Some _
| Osd.Assert.Value (key, Some _), None ->
Osd.Error.(lwt_fail (Assert_failed (Slice.get_string_unsafe key)))
| Osd.Assert.Value (key, Some _), None ->
failed_assert key
| Osd.Assert.Value (key, Some v), Some (mf, v') ->
Lwt.return (Assert.ObjectHasId (Slice.get_string_unsafe key,
mf.Nsm_model.Manifest.object_id)))
if Osd.Blob.(equal (Bigslice v') v)
then Lwt.return (Assert.ObjectHasId (Slice.get_string_unsafe key,
mf.Nsm_model.Manifest.object_id))
else failed_assert key
)
asserts values
|> Lwt_list.map_s Std.id
)
Expand Down

0 comments on commit 3219eb0

Please sign in to comment.