Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests for vswitch and vport #556

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib_test/Test_Frenetic_NetKAT_Compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ module FromPipe = struct
vlan = 0;
vlanPcp = 0;
ethType = 0;
vswitch = 0L;
vport = 0L;
ipProto = 0;
ipSrc = 0l;
ipDst = 0l;
Expand Down Expand Up @@ -387,6 +389,7 @@ let get_masking_test =
let headers =
{ HeadersValues.location = Frenetic_NetKAT.Physical 0l
; ethSrc = 0L ; ethDst = 0L ; vlan = 0 ; vlanPcp = 0 ; ethType = 0
; vswitch = 0L; vport = 0L
; ipProto = 0 ; ipSrc = ip1 ; ipDst = 0l ; tcpSrcPort = 0 ; tcpDstPort = 0
} in
let payload = Frenetic_OpenFlow.NotBuffered (Cstruct.create 0) in
Expand Down
6 changes: 3 additions & 3 deletions lib_test/Test_Frenetic_Vlr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ let%test_module _ = (module struct
let%test "S.fold does the normal fold operation over a diagram" =
let fdd = two_level_tree in
(* This is nonsensical, but easy to test. It just doubles the leaf values, then adds them together with the test pattern values *)
let add_across (v,l) m n = l + m + n in
let double x = x * 2 in
fold double add_across fdd = 2450
let add_across (v,l) m n : int = l + m + n in
let double x : int = x * 2 in
fold ~f:double ~g:add_across fdd = 2450

let%test "S.map_r does the normal map operation, applying function to all leaf nodes and ignoring branch nodes" =
let fdd = two_level_tree in
Expand Down
4 changes: 4 additions & 0 deletions lib_test/lib/Arbitrary_Frenetic_NetKAT.ml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ let arbitrary_tcp : Frenetic_NetKAT_Semantics.packet QuickCheck_gen.gen =
let ip = map_gen (fun i -> Ip i) (Parb.arbitrary_ip tcp) in
Parb.arbitrary_packet ip >>= fun pkt ->
arbitrary_int32 >>= fun port_id ->
arbitrary_int64 >>= fun vswitch_id ->
arbitrary_int64 >>= fun vport_id ->
let headers =
{ HeadersValues.location = Frenetic_NetKAT.Physical port_id
; ethSrc = pkt.dlSrc
Expand All @@ -175,6 +177,8 @@ let arbitrary_tcp : Frenetic_NetKAT_Semantics.packet QuickCheck_gen.gen =
; ipDst = (try nwDst pkt with Invalid_argument(_) -> 0l)
; tcpSrcPort = (try tpSrc pkt with Invalid_argument(_) -> 0)
; tcpDstPort = (try tpDst pkt with Invalid_argument(_) -> 0)
; vswitch = vswitch_id
; vport = vport_id
} in
arbitrary_int64 >>= fun switch_id ->
payload >>= fun payload ->
Expand Down
2 changes: 2 additions & 0 deletions lib_test/lib/Flowterp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ module Headers = struct
~vlan:(matches pat.dlVlan)
~vlanPcp:(matches pat.dlVlanPcp)
~ethType:(matches pat.dlTyp)
~vswitch:(fun _ -> true (* TODO FIXME *))
~vport:(fun _ -> true (* TODO FIXME *))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what should go here...

~ipProto:(matches pat.nwProto)
~ipSrc:(matches_mask pat.nwSrc)
~ipDst:(matches_mask pat.nwDst)
Expand Down