From 39ed0d0ebe3bbea1bef6d42ca9a5b16e794e0cd3 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Mon, 31 Jan 2011 12:12:41 -0800 Subject: [PATCH] Clear cache for runs of ctest if --cache not set. Change-Id: I013c838c83dd23cbfe04f77f87df74778d8e874e BUG=chromium-os:10723 TEST=Ran it Review URL: http://codereview.chromium.org/6389004 --- bin/ctest.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/ctest.py b/bin/ctest.py index 3f7da2b9f8..f675dfd2c1 100755 --- a/bin/ctest.py +++ b/bin/ctest.py @@ -225,6 +225,15 @@ def GrabZipAndExtractImage(zip_url, download_folder, image_name) : fh.close() +def WipeDevServerCache(): + """Wipes the cache of the dev server.""" + RunCommand(['sudo', + './start_devserver', + '--clear_cache', + '--exit', + ], enter_chroot=True) + + def RunAUTestHarness(board, channel, latest_url_base, zip_server_base, no_graphics, type, remote): """Runs the auto update test harness. @@ -274,6 +283,8 @@ def main(): help='board for the image to compare against.') parser.add_option('-c', '--channel', help='channel for the image to compare against.') + parser.add_option('--cache', default=False, action='store_true', + help='Cache payloads') parser.add_option('-l', '--latestbase', help='Base url for latest links.') parser.add_option('-z', '--zipbase', @@ -301,6 +312,10 @@ def main(): if not options.zipbase: parser.error('Need zip url base to get images.') + if not options.cache: + Info('Wiping dev server cache.') + WipeDevServerCache() + RunAUTestHarness(options.board, options.channel, options.latestbase, options.zipbase, options.no_graphics, options.type, options.remote)