Home | History | Annotate | Download | only in hardware_StorageQualBase
      1 # Copyright (c) 2014 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 
      5 from autotest_lib.server import autotest
      6 from autotest_lib.server import hosts
      7 from autotest_lib.server import test
      8 
      9 
     10 class hardware_StorageQualBase(test.test):
     11     """Tests run at the beginning over the disk qual test.
     12 
     13     This code runs simple tests to ensure the device meet basic critera.
     14     """
     15 
     16     version = 1
     17     CLIENT_FUNCTIONAL_TESTS = [
     18         ('hardware_DiskSize', {'constraints': ['gb_main_disk_size >= 8']}),
     19         ('hardware_SsdDetection', {
     20             'constraints': ['mb_ssd_device_size >= 8000']}),
     21         ('hardware_StorageFio', {'constraints': [
     22             '_seq_read_read_bw_mean >= 50 * 1024',
     23             '_seq_write_write_bw_mean >= 15 * 1024',
     24             '_16k_write_write_iops >= 10'],
     25             'requirements': [
     26                 ('seq_read', []),
     27                 ('seq_write', []),
     28                 ('16k_write', [])],
     29                 })
     30     ]
     31 
     32     CRYPTO_RUNTIME = 5 * 60  # seconds.
     33 
     34     CRYPTO_TESTS = [
     35         'surfing',
     36         'boot',
     37         'login',
     38         'seq_read',
     39         'seq_write',
     40         '16k_read',
     41         '16k_write',
     42         '8k_read',
     43         '8k_write',
     44         '4k_read',
     45         '4k_write',
     46     ]
     47 
     48 
     49     def run_once(self, client_ip, client_tag='', crypto_runtime=CRYPTO_RUNTIME):
     50         client = hosts.create_host(client_ip)
     51         client_at = autotest.Autotest(client)
     52         for test_name, argv in self.CLIENT_FUNCTIONAL_TESTS:
     53             client_at.run_test(test_name, disable_sysinfo=True, tag=client_tag,
     54                                **argv)
     55 
     56         # Test real life performance
     57         for script in self.CRYPTO_TESTS:
     58             client_at.run_test('platform_CryptohomeFio',
     59                 disable_sysinfo=True,
     60                 from_internal_disk_only=True,
     61                 script=script,
     62                 tag='_'.join([client_tag, script]),
     63                 runtime=crypto_runtime,
     64                 disk_configs=['crypto', 'plain'])
     65