1# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import os 6 7from autotest_lib.client.bin import test 8from autotest_lib.client.common_lib import error 9 10OPENSSL = '/usr/bin/openssl' 11VERIFY = OPENSSL + ' verify' 12 13class security_OpenSSLRegressions(test.test): 14 version = 1 15 16 def verify(self): 17 r = os.system('%s %s' % (VERIFY, self.cert)) 18 return r 19 20 def run_once(self, opts=None): 21 self.cert = '%s/cert.pem' % self.srcdir 22 23 # Checking for openssl-0.9.8r-verify-retcode.patch (see 24 # chromiumos-overlay:2ea51e44669062977689ff09a43ac8438f55673f). 25 if self.verify() == 0: 26 raise error.TestFail('Verify returned zero on error.') 27