Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Unified Diff: src/scripts/image_to_usb.sh

Issue 1780011: Skip dropping caches in each test and between iterations during factory tests. (Closed) Base URL: ssh://git@chromiumos-git/chromiumos
Patch Set: fix bug Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/scripts/mod_for_factory_scripts/400configAutotest » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/image_to_usb.sh
diff --git a/src/scripts/image_to_usb.sh b/src/scripts/image_to_usb.sh
index 69d7ba465d93975140b585f8c4d4546841d16820..e22e2bf62d6218950ca3187d508b15bce5446805 100755
--- a/src/scripts/image_to_usb.sh
+++ b/src/scripts/image_to_usb.sh
@@ -90,33 +90,6 @@ FLAGS_to=`eval readlink -f ${FLAGS_to}`
# Use this image as the source image to copy
SRC_IMAGE="${FLAGS_from}/chromiumos_image.bin"
-# If we're asked to modify the image for test, then let's make a copy and
-# modify that instead.
-if [ ${FLAGS_test_image} -eq ${FLAGS_TRUE} ] ; then
- if [ ! -f "${FLAGS_from}/chromiumos_test_image.bin" ] || \
- [ ${FLAGS_force_copy} -eq ${FLAGS_TRUE} ] ; then
- # Copy it.
- echo "Creating test image from original..."
- cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin"
-
- # Check for manufacturing image.
- if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then
- FACTORY_ARGS="--factory"
- fi
-
- # Modify it. Pass --yes so that mod_image_for_test.sh won't ask us if we
- # really want to modify the image; the user gave their assent already with
- # --test-image and the original image is going to be preserved.
- "${SCRIPTS_DIR}/mod_image_for_test.sh" --image \
- "${FLAGS_from}/chromiumos_test_image.bin" ${FACTORY_ARGS} --yes
- echo "Done with mod_image_for_test."
- else
- echo "Using cached test image."
- fi
- SRC_IMAGE="${FLAGS_from}/chromiumos_test_image.bin"
- echo "Source test image is: ${SRC_IMAGE}"
-fi
-
STATEFUL_DIR="${FLAGS_from}/stateful_partition"
mkdir -p "${STATEFUL_DIR}"
@@ -175,6 +148,34 @@ if [ ${FLAGS_install_autotest} -eq ${FLAGS_TRUE} ] ; then
fi
+# If we're asked to modify the image for test, then let's make a copy and
+# modify that instead.
+if [ ${FLAGS_test_image} -eq ${FLAGS_TRUE} ] ; then
+ if [ ! -f "${FLAGS_from}/chromiumos_test_image.bin" ] || \
+ [ ${FLAGS_force_copy} -eq ${FLAGS_TRUE} ] ; then
+ # Copy it.
+ echo "Creating test image from original..."
+ cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin"
+
+ # Check for manufacturing image.
+ if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then
+ FACTORY_ARGS="--factory"
+ fi
+
+ # Modify it. Pass --yes so that mod_image_for_test.sh won't ask us if we
+ # really want to modify the image; the user gave their assent already with
+ # --test-image and the original image is going to be preserved.
+ "${SCRIPTS_DIR}/mod_image_for_test.sh" --image \
+ "${FLAGS_from}/chromiumos_test_image.bin" ${FACTORY_ARGS} --yes
+ echo "Done with mod_image_for_test."
+ else
+ echo "Using cached test image."
+ fi
+ SRC_IMAGE="${FLAGS_from}/chromiumos_test_image.bin"
+ echo "Source test image is: ${SRC_IMAGE}"
+fi
+
+
# Let's do it.
if [ -b "${FLAGS_to}" ]
then
« no previous file with comments | « no previous file | src/scripts/mod_for_factory_scripts/400configAutotest » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698