diff options
Diffstat (limited to '.travis/cmake-freebsd-env.sh')
-rw-r--r-- | .travis/cmake-freebsd-env.sh | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/.travis/cmake-freebsd-env.sh b/.travis/cmake-freebsd-env.sh index 7d698940..96bf2d49 100644 --- a/.travis/cmake-freebsd-env.sh +++ b/.travis/cmake-freebsd-env.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/bash |
2 | 2 | ||
3 | # Common variables and functions | 3 | # Common variables and functions |
4 | 4 | ||
@@ -8,19 +8,19 @@ SCREEN_SESSION=freebsd | |||
8 | SSH_PORT=10022 | 8 | SSH_PORT=10022 |
9 | 9 | ||
10 | FREEBSD_VERSION="12.1" | 10 | FREEBSD_VERSION="12.1" |
11 | IMAGE_NAME=FreeBSD-${FREEBSD_VERSION}-RELEASE-amd64.raw | 11 | IMAGE_NAME=FreeBSD-$FREEBSD_VERSION-RELEASE-amd64.raw |
12 | # https://download.freebsd.org/ftp/releases/VM-IMAGES/12.1-RELEASE/amd64/Latest/ | 12 | # https://download.freebsd.org/ftp/releases/VM-IMAGES/12.1-RELEASE/amd64/Latest/ |
13 | IMAGE_SHA512="a65da6260f5f894fc86fbe1f27dad7800906da7cffaa5077f82682ab74b6dd46c4ce87158c14b726d74ca3c6d611bea3bb336164da3f1cb990550310b110da22" | 13 | IMAGE_SHA512="a65da6260f5f894fc86fbe1f27dad7800906da7cffaa5077f82682ab74b6dd46c4ce87158c14b726d74ca3c6d611bea3bb336164da3f1cb990550310b110da22" |
14 | 14 | ||
15 | RUN() { | 15 | RUN() { |
16 | ssh -t -o ConnectionAttempts=120 -o ConnectTimeout=2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@localhost -p $SSH_PORT "$@" | 16 | ssh -t -o ConnectionAttempts=120 -o ConnectTimeout=2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@localhost -p "$SSH_PORT" "$@" |
17 | } | 17 | } |
18 | 18 | ||
19 | start_vm() { | 19 | start_vm() { |
20 | screen -d -m qemu-system-x86_64 -curses -m 2048 -smp $NPROC -net user,hostfwd=tcp::${SSH_PORT}-:22 -net nic "$IMAGE_NAME" | 20 | screen -d -m qemu-system-x86_64 -curses -m 2048 -smp "$NPROC" -net user,hostfwd=tcp::"$SSH_PORT"-:22 -net nic "$IMAGE_NAME" |
21 | 21 | ||
22 | # Wait for ssh to start listening on the port | 22 | # Wait for ssh to start listening on the port |
23 | while ! echo "exit" | nc localhost ${SSH_PORT} | grep 'OpenSSH'; do | 23 | while ! echo "exit" | nc localhost "$SSH_PORT" | grep 'OpenSSH'; do |
24 | sleep 5 | 24 | sleep 5 |
25 | done | 25 | done |
26 | 26 | ||
@@ -29,8 +29,7 @@ start_vm() { | |||
29 | RUN last | 29 | RUN last |
30 | } | 30 | } |
31 | 31 | ||
32 | stop_vm() | 32 | stop_vm() { |
33 | { | ||
34 | # Turn it off | 33 | # Turn it off |
35 | # We use this contraption because for some reason `shutdown -h now` and | 34 | # We use this contraption because for some reason `shutdown -h now` and |
36 | # `poweroff` result in FreeBSD not shutting down on Travis (they work on my | 35 | # `poweroff` result in FreeBSD not shutting down on Travis (they work on my |