Rename to test.sh, break if build fails.

This commit is contained in:
linse 2019-05-17 23:17:04 +02:00
parent 1599f63838
commit 09139518fb
2 changed files with 19 additions and 8 deletions

View File

@ -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

View File

@ -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 ->