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

Side by Side Diff: client/site_tests/platform_StackProtector/platform_StackProtector.py

Issue 3116009: Update autotest tests to use make -j where possible. (Closed) Base URL: ssh://git@chromiumos-git/autotest.git
Patch Set: Convert last two tests to use utils.make(), saving another 20 seconds. Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « client/site_tests/platform_MiniJailVfsNamespace/platform_MiniJailVfsNamespace.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 6
7 from autotest_lib.client.bin import test, utils 7 from autotest_lib.client.bin import test, utils
8 from autotest_lib.client.common_lib import error 8 from autotest_lib.client.common_lib import error
9 9
10 class platform_StackProtector(test.test): 10 class platform_StackProtector(test.test):
11 version = 2 11 version = 2
12 12
13 # http://build.chromium.org/mirror/chromiumos/mirror/distfiles/ 13 # http://build.chromium.org/mirror/chromiumos/mirror/distfiles/
14 # binutils-2.19.1.tar.bz2 14 # binutils-2.19.1.tar.bz2
15 def setup(self, tarball="binutils-2.19.1.tar.bz2"): 15 def setup(self, tarball="binutils-2.19.1.tar.bz2"):
16 # clean 16 # clean
17 if os.path.exists(self.srcdir): 17 if os.path.exists(self.srcdir):
18 utils.system("rm -rf %s" % self.srcdir) 18 utils.system("rm -rf %s" % self.srcdir)
19 19
20 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) 20 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
21 utils.extract_tarball_to_dir(tarball, self.srcdir) 21 utils.extract_tarball_to_dir(tarball, self.srcdir)
22 22
23 os.chdir(self.srcdir) 23 os.chdir(self.srcdir)
24 utils.system("patch -p1 < ../binutils-2.19-arm.patch"); 24 utils.system("patch -p1 < ../binutils-2.19-arm.patch");
25 utils.configure() 25 utils.configure()
26 utils.system("make") 26 utils.make()
27 27
28 28
29 def run_once(self, rootdir="/"): 29 def run_once(self, rootdir="/"):
30 """ 30 """
31 Do a find for all files on the system 31 Do a find for all files on the system
32 For each one, run objdump on them. We'll get either: 32 For each one, run objdump on them. We'll get either:
33 * output containing stack_chk (good) 33 * output containing stack_chk (good)
34 * stderr containing 'not recognized' on e.g. shell scripts (ok) 34 * stderr containing 'not recognized' on e.g. shell scripts (ok)
35 For those, the egrep -q exit(0)'s and there's no output. 35 For those, the egrep -q exit(0)'s and there's no output.
36 But, for files compiled without stack protector, the egrep will 36 But, for files compiled without stack protector, the egrep will
(...skipping 20 matching lines...) Expand all
57 ) 57 )
58 badfiles = utils.system_output(cmd % (rootdir, libc_glob)) 58 badfiles = utils.system_output(cmd % (rootdir, libc_glob))
59 59
60 # special case check for libc, needs different objdump flags 60 # special case check for libc, needs different objdump flags
61 cmd = "binutils/objdump -D %s | egrep -q stack_chk || echo %s" 61 cmd = "binutils/objdump -D %s | egrep -q stack_chk || echo %s"
62 libc_stack_chk = utils.system_output(cmd % (libc_glob, libc_glob)) 62 libc_stack_chk = utils.system_output(cmd % (libc_glob, libc_glob))
63 63
64 if badfiles or libc_stack_chk: 64 if badfiles or libc_stack_chk:
65 raise error.TestFail("Missing -fstack-protector:\n" 65 raise error.TestFail("Missing -fstack-protector:\n"
66 + badfiles + libc_stack_chk) 66 + badfiles + libc_stack_chk)
OLDNEW
« no previous file with comments | « client/site_tests/platform_MiniJailVfsNamespace/platform_MiniJailVfsNamespace.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698