am ae48cd80: Merge "Download the rootfs instead of expecting it to be in the tree."

* commit 'ae48cd80a5d656714694f3b6b4f132603ce36284':
  Download the rootfs instead of expecting it to be in the tree.
diff --git a/tests/net_test/run_net_test.sh b/tests/net_test/run_net_test.sh
index 0ef1e2c..fae1145 100755
--- a/tests/net_test/run_net_test.sh
+++ b/tests/net_test/run_net_test.sh
@@ -15,7 +15,9 @@
 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 @@
 
 # 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 @@
 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