Skip to content

Commit

Permalink
Merge pull request #377 from hannesm/minor
Browse files Browse the repository at this point in the history
adapt to changes for mirage-random.1.2.0
  • Loading branch information
hannesm authored Nov 12, 2018
2 parents c1b730f + 3430703 commit 20358c0
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ env:
global:
- EXTRA_REMOTES="https://github.com/mirage/mirage-dev.git"
matrix:
- OCAML_VERSION=4.04 PACKAGE=tcpip MIRAGE_MODE=unix
- OCAML_VERSION=4.04 PACKAGE=tcpip MIRAGE_MODE=unix FLAGS="--net=socket"
- UPDATE_GCC_BINUTILS=1 OCAML_VERSION=4.04 PACKAGE=tcpip MIRAGE_MODE=xen
- UPDATE_GCC_BINUTILS=1 OCAML_VERSION=4.05 PACKAGE=tcpip MIRAGE_MODE=hvt
- OCAML_VERSION=4.06 PACKAGE=tcpip MIRAGE_MODE=unix
- UPDATE_GCC_BINUTILS=1 OCAML_VERSION=4.07 PACKAGE=tcpip MIRAGE_MODE=virtio
34 changes: 23 additions & 11 deletions tcpip.opam
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
opam-version: "1.2"
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/mirage/mirage-tcpip"
dev-repo: "https://github.com/mirage/mirage-tcpip.git"
dev-repo: "git+https://github.com/mirage/mirage-tcpip.git"
bug-reports: "https://github.com/mirage/mirage-tcpip/issues"
doc: "https://mirage.github.io/mirage-tcpip/"
authors: [
Expand All @@ -15,14 +15,13 @@ tags: ["org:mirage"]
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
]
build-test: [
["jbuilder" "runtest" "-p" name "-j" jobs]
["jbuilder" "runtest" "-p" name "-j" jobs] {with-test}
]

depends: [
"jbuilder" {build & >="1.0+beta10"}
"configurator" {build}
"ocaml" {>= "4.03.0"}
"rresult" {>= "0.5.0"}
"cstruct" {>= "3.0.2"}
"cstruct-lwt"
Expand All @@ -43,10 +42,23 @@ depends: [
"duration"
"io-page-unix"
"randomconv"
"mirage-flow" {test & >= "1.2.0"}
"mirage-vnetif" {test & >= "0.4.0"}
"alcotest" {test & >="0.7.0"}
"pcap-format" {test}
"mirage-clock-unix" {test & >= "1.2.0"}
"mirage-flow" {with-test & >= "1.2.0"}
"mirage-vnetif" {with-test & >= "0.4.0"}
"alcotest" {with-test & >="0.7.0"}
"pcap-format" {with-test}
"mirage-clock-unix" {with-test & >= "1.2.0"}
"mirage-random-test" {with-test}
]
available: [ocaml-version >= "4.03.0"]
synopsis: "OCaml TCP/IP networking stack, used in MirageOS"
description: """
`mirage-tcpip` provides a networking stack for the [Mirage operating
system](https://mirage.io). It provides implementations for the following module types
(which correspond with the similarly-named protocols):

* ETHERNET
* ARP
* IP (via the IPv4 and IPv6 modules)
* ICMP
* UDP
* TCP
"""
2 changes: 1 addition & 1 deletion test/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(executables
((names (test))
(libraries (
alcotest lwt.unix io-page-unix tcpip.unix
alcotest mirage-random-test lwt.unix io-page-unix tcpip.unix
logs logs.fmt mirage-profile mirage-flow mirage-vnetif
mirage-clock-unix pcap-format duration mirage-random
rresult mirage-protocols-lwt mirage-stack-lwt
Expand Down
4 changes: 2 additions & 2 deletions test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ let run test () =
Lwt_main.run (test ())

let () =
(* someone has to call Stdlibrandom.initialize () *)
Stdlibrandom.initialize ();
(* someone has to call Mirage_random_test.initialize () *)
Mirage_random_test.initialize ();
(* enable logging to stdout for all modules *)
Logs.set_reporter (Logs_fmt.reporter ());
Logs.set_level ~all:true (Some Logs.Debug);
Expand Down
4 changes: 2 additions & 2 deletions test/test_deadlock.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Client_log = (val Logs.src_log client_log : Logs.LOG)

module TCPIP =
struct
module RANDOM = Stdlibrandom
module RANDOM = Mirage_random_test

module TIME =
struct
Expand Down Expand Up @@ -76,7 +76,7 @@ let test_digest netif1 netif2 =
TCPIP.make `Server netif2 >>= fun server_stack ->

let send_data () =
let data = Stdlibrandom.generate 100_000_000 |> Cstruct.to_string in
let data = Mirage_random_test.generate 100_000_000 |> Cstruct.to_string in
let t0 = Unix.gettimeofday () in
TCPIP.TCPV4.create_connection
TCPIP.(tcpv4 @@ tcpip server_stack) (TCPIP.client_ip, port) >>= function
Expand Down
4 changes: 2 additions & 2 deletions test/test_icmpv4.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type decomposed = {
ethernet_header : Ethif_packet.t;
}

module Ip = Static_ipv4.Make(Stdlibrandom)(Mclock)(E)(Static_arp)
module Ip = Static_ipv4.Make(Mirage_random_test)(Mclock)(E)(Static_arp)
module Icmp = Icmpv4.Make(Ip)

module Udp = Udp.Make(Ip)(Stdlibrandom)
module Udp = Udp.Make(Ip)(Mirage_random_test)

type stack = {
backend : B.t;
Expand Down
4 changes: 2 additions & 2 deletions test/test_ipv6.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module B = Vnetif_backends.Basic
module V = Vnetif.Make(B)
module E = Ethif.Make(V)

module Ipv6 = Ipv6.Make(E)(Stdlibrandom)(Time)(Mclock)
module Udp = Udp.Make(Ipv6)(Stdlibrandom)
module Ipv6 = Ipv6.Make(E)(Mirage_random_test)(Time)(Mclock)
module Udp = Udp.Make(Ipv6)(Mirage_random_test)
open Lwt.Infix

let ip =
Expand Down
2 changes: 1 addition & 1 deletion test/test_rfc5961.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module Time = Vnetif_common.Time
module V = Vnetif.Make(Vnetif_backends.Basic)
module E = Ethif.Make(V)
module A = Arpv4.Make(E)(Vnetif_common.Clock)(Time)
module I = Static_ipv4.Make(Stdlibrandom)(Vnetif_common.Clock)(E)(A)
module I = Static_ipv4.Make(Mirage_random_test)(Vnetif_common.Clock)(E)(A)
module Wire = Tcp.Wire
module WIRE = Wire.Make(I)
module Tcp_wire = Tcp.Tcp_wire
Expand Down
4 changes: 2 additions & 2 deletions test/test_udp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module B = Basic_backend.Make
module V = Vnetif.Make(B)
module E = Ethif.Make(V)
module Static_arp = Static_arp.Make(E)(Mclock)(Time)
module Ip = Static_ipv4.Make(Stdlibrandom)(Mclock)(E)(Static_arp)
module Udp = Udp.Make(Ip)(Stdlibrandom)
module Ip = Static_ipv4.Make(Mirage_random_test)(Mclock)(E)(Static_arp)
module Udp = Udp.Make(Ip)(Mirage_random_test)

type stack = {
clock : Mclock.t;
Expand Down
8 changes: 4 additions & 4 deletions test/vnetif_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ struct
module V = Vnetif.Make(B)
module E = Ethif.Make(V)
module A = Arpv4.Make(E)(Clock)(Time)
module Ip = Static_ipv4.Make(Stdlibrandom)(Clock)(E)(A)
module Ip = Static_ipv4.Make(Mirage_random_test)(Clock)(E)(A)
module Icmp = Icmpv4.Make(Ip)
module U = Udp.Make(Ip)(Stdlibrandom)
module T = Tcp.Flow.Make(Ip)(Time)(Clock)(Stdlibrandom)
module U = Udp.Make(Ip)(Mirage_random_test)
module T = Tcp.Flow.Make(Ip)(Time)(Clock)(Mirage_random_test)
module Stackv4 =
Tcpip_stack_direct.Make(Time)(Stdlibrandom)(V)(E)(A)(Ip)(Icmp)(U)(T)
Tcpip_stack_direct.Make(Time)(Mirage_random_test)(V)(E)(A)(Ip)(Icmp)(U)(T)

let create_backend () =
B.create ()
Expand Down

0 comments on commit 20358c0

Please sign in to comment.