diff --git a/test/setup.sh b/test/test.sh similarity index 81% rename from test/setup.sh rename to test/test.sh index 9a141ad..05413b5 100755 --- a/test/setup.sh +++ b/test/test.sh @@ -44,7 +44,8 @@ if ! [ -x "$(command -v test-mirage)" ]; then explain_commands >&2 exit 1 fi -if $(qrexec-client-vm dom0 yomimono.updateFirewall); then +qrexec-client-vm dom0 yomimono.updateFirewall +if [ $? -ne 0 ]; then echo "Error: can't update firewall rules." >&2 explain_service >&2 exit 1 @@ -52,15 +53,25 @@ fi echo "We're gonna set up a unikernel for the mirage-fw-test qube" cd .. -mirage configure -t xen -make depend +mirage configure -t xen && \ +make depend && \ make -test-mirage qubes_firewall.xen mirage-fw-test & -cd test +if [ $? -ne 0 ]; then + echo "Could not build unikernel for mirage-fw-test qube" >&2 + exit 1 +fi +cd test echo "We're gonna set up a unikernel for fetchmotron qube" -mirage configure -t qubes -make depend +mirage configure -t qubes && \ +make depend && \ make +if [ $? -ne 0 ]; then + echo "Could not build unikernel for fetchmotron qube" >&2 + exit 1 +fi +cd .. +test-mirage qubes_firewall.xen mirage-fw-test & +cd test test-mirage http_fetch.xen fetchmotron diff --git a/test/unikernel.ml b/test/unikernel.ml index 013f530..36ae305 100644 --- a/test/unikernel.ml +++ b/test/unikernel.ml @@ -13,7 +13,7 @@ let uri = Uri.of_string "http://10.137.0.5:8082" module Client (T: TIME) (C: CONSOLE) (RES: Resolver_lwt.S) (CON: Conduit_mirage.S) = struct let http_fetch c resolver ctx = - C.log c (sprintf "Fetching %s with Cohttp:" (Uri.to_string uri)) >>= fun () -> + C.log c (yellow "Fetching %s with Cohttp:" (Uri.to_string uri)) >>= fun () -> let ctx = Cohttp_mirage.Client.ctx resolver ctx in Cohttp_mirage.Client.get ~ctx uri >>= fun (response, body) -> Cohttp_lwt.Body.to_string body >>= fun body ->