Add rumprun CI and get tests passing
diff --git a/ci/rumprun/Dockerfile b/ci/rumprun/Dockerfile
new file mode 100644
index 0000000..16c7d37
--- /dev/null
+++ b/ci/rumprun/Dockerfile
@@ -0,0 +1,12 @@
+FROM ubuntu:15.04
+
+RUN apt-get update
+RUN apt-get install -y binutils git g++ make qemu
+
+WORKDIR /build
+RUN git clone --recursive http://repo.rumpkernel.org/rumprun
+WORKDIR /build/rumprun
+RUN CC=cc ./build-rr.sh hw
+
+ENV PATH=$PATH:/build/rumprun/rumprun/bin
+WORKDIR /root
diff --git a/ci/run-travis.sh b/ci/run-travis.sh
index 1e4b144..ec55d86 100644
--- a/ci/run-travis.sh
+++ b/ci/run-travis.sh
@@ -16,16 +16,21 @@
fi
MAIN_TARGETS=https://static.rust-lang.org/dist
-EXTRA_TARGETS=https://people.mozilla.org/~acrichton/libc-test/2015-09-08
+DATE=$(echo $TRAVIS_RUST_VERSION | sed s/nightly-//)
+EXTRA_TARGETS=https://people.mozilla.org/~acrichton/libc-test/$DATE
install() {
sudo apt-get update
sudo apt-get install -y $@
}
+mkdir -p .cargo
+cp ci/cargo-config .cargo/config
+
case "$TARGET" in
- *-apple-ios)
- curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
+ *-apple-ios | *-rumprun-*)
+ curl -s $EXTRA_TARGETS/$TARGET.tar.gz | \
+ tar xzf - -C `rustc --print sysroot`/lib/rustlib
;;
*)
@@ -44,27 +49,23 @@
esac
-case "$TARGET" in
- # Pull a pre-built docker image for testing android, then run tests entirely
- # within that image. Note that this is using the same rustc installation that
- # travis has (sharing it via `-v`) and otherwise the tests run entirely within
- # the container.
- arm-linux-androideabi)
- script="
-cp -r /checkout/* .
-mkdir .cargo
-cp ci/cargo-config .cargo/config
-exec sh ci/run.sh $TARGET
-"
- exec docker run \
- --entrypoint bash \
- -v $HOME/rust:/usr/local:ro \
- -v `pwd`:/checkout:ro \
- -e LD_LIBRARY_PATH=/usr/local/lib \
- -it alexcrichton/rust-slave-android:2015-10-21 \
- -c "$script"
- ;;
+# Pull a pre-built docker image for testing android, then run tests entirely
+# within that image. Note that this is using the same rustc installation that
+# travis has (sharing it via `-v`) and otherwise the tests run entirely within
+# the container.
+if [ "$DOCKER" != "" ]; then
+ exec docker run \
+ --entrypoint bash \
+ -v `rustc --print sysroot`:/usr/local:ro \
+ -v `pwd`:/checkout \
+ -e LD_LIBRARY_PATH=/usr/local/lib \
+ -e CARGO_TARGET_DIR=/tmp \
+ -w /checkout \
+ -it $DOCKER \
+ ci/run.sh $TARGET
+fi
+case "$TARGET" in
x86_64-unknown-linux-musl)
install musl-tools
export CC=musl-gcc
@@ -107,8 +108,6 @@
esac
-mkdir .cargo
-cp ci/cargo-config .cargo/config
sh ci/run.sh $TARGET
if [ "$TARGET" = "x86_64-unknown-linux-gnu" ] && \
diff --git a/ci/run.sh b/ci/run.sh
index 635422c..4f3b84c 100644
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -21,9 +21,9 @@
arm-linux-androideabi)
emulator @arm-18 -no-window &
adb wait-for-device
- adb push libc-test/target/$TARGET/debug/libc-test /data/libc-test
- adb shell /data/libc-test 2>&1 | tee out
- grep "^PASSED .* tests" out
+ adb push /tmp/$TARGET/debug/libc-test /data/libc-test
+ adb shell /data/libc-test 2>&1 | tee /tmp/out
+ grep "^PASSED .* tests" /tmp/out
;;
arm-unknown-linux-gnueabihf)
@@ -39,6 +39,14 @@
libc-test/target/$TARGET/debug/libc-test
;;
+ *-rumprun-netbsd)
+ rumprun-bake hw_virtio /tmp/libc-test.img /tmp/$TARGET/debug/libc-test
+ qemu-system-x86_64 -nographic -vga none -m 64 \
+ -kernel /tmp/libc-test.img 2>&1 | tee /tmp/out &
+ sleep 5
+ grep "^PASSED .* tests" /tmp/out
+ ;;
+
*-apple-ios)
libc-test/target/$TARGET/debug/libc-test
;;