summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2015-02-03 16:20:57 +0900
committerLorenzo Colitti <lorenzo@google.com>2015-02-11 14:33:46 +0900
commitf4b4c0973689190659ff972f52305a99f983fb3d (patch)
tree748f656977381572575e02959f3da4e6b9dddb8f /tests
parentffe4195c7b9058bbd3f4e64597d3351c496e90a5 (diff)
downloadextras-f4b4c0973689190659ff972f52305a99f983fb3d.tar.gz
Download the rootfs instead of expecting it to be in the tree.
Change-Id: I17ee3a8389a141218ce8ce99a71e41b9832e8533
Diffstat (limited to 'tests')
-rwxr-xr-xtests/net_test/run_net_test.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/net_test/run_net_test.sh b/tests/net_test/run_net_test.sh
index 0ef1e2cd..fae11457 100755
--- a/tests/net_test/run_net_test.sh
+++ b/tests/net_test/run_net_test.sh
@@ -15,7 +15,9 @@ OPTIONS="$OPTIONS DEVTMPFS DEVTMPFS_MOUNT"
NUMTAPINTERFACES=2
# The root filesystem disk image we'll use.
-ROOTFS=$(dirname $0)/net_test.rootfs
+ROOTFS=net_test.rootfs.20150203
+COMPRESSED_ROOTFS=$ROOTFS.xz
+URL=https://dl.google.com/dl/android/$COMPRESSED_ROOTFS
# Figure out which test to run.
if [ -z "$1" ]; then
@@ -28,13 +30,17 @@ set -e
# Check if we need to uncompress the disk image.
# We use xz because it compresses better: to 42M vs 72M (gzip) / 62M (bzip2).
-if [ $ROOTFS.xz -nt $ROOTFS ]; then
- echo "Deleting $ROOTFS" >&2
- rm -f $ROOTFS
- echo "Uncompressing $ROOTFS.xz" >&2
- unxz --keep $ROOTFS.xz
+cd $(dirname $0)
+if [ ! -f $ROOTFS ]; then
+ echo "Deleting $COMPRESSED_ROOTFS" >&2
+ rm -f $COMPRESSED_ROOTFS
+ echo "Downloading $URL" >&2
+ wget $URL
+ echo "Uncompressing $COMPRESSED_ROOTFS" >&2
+ unxz $COMPRESSED_ROOTFS
fi
-
+echo "Using $ROOTFS"
+cd -
# Create NUMTAPINTERFACES tap interfaces on the host, and prepare UML command
# line params to use them. The interfaces are called <user>TAP0, <user>TAP1,
@@ -86,6 +92,6 @@ make -j12 linux ARCH=um SUBARCH=x86_64 CROSS_COMPILE=
dir=/host$(dirname $(readlink -f $0))
# Start the VM.
-exec ./linux umid=net_test ubda=$(dirname $0)/net_test.rootfs \
+exec ./linux umid=net_test ubda=$(dirname $0)/$ROOTFS \
mem=512M init=/sbin/net_test.sh net_test=$dir/$test \
$netconfig