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 >= 50 * 1024',
     23             '_seq_write_write_bw >= 15 * 1024',
     24             '_16k_write_write_iops >= 10'],
     25             'requirements': [
     26                 ('seq_read', []),
     27                 ('seq_write', []),
     28                 ('16k_read', []),
     29                 ('16k_write', [])],
     30                 })
     31     ]
     32 
     33     CRYPTO_RUNTIME = 5 * 60  # seconds.
     34 
     35     CRYPTO_TESTS = [
     36         'surfing',
     37         'boot',
     38         'login',
     39         'seq_read',
     40         'seq_write',
     41         '16k_read',
     42         '16k_write',
     43         '8k_read',
     44         '8k_write',
     45         '4k_read',
     46         '4k_write',
     47     ]
     48 
     49 
     50     def run_once(self, client_ip, client_tag='', crypto_runtime=CRYPTO_RUNTIME):
     51         client = hosts.create_host(client_ip)
     52         client_at = autotest.Autotest(client)
     53         for test_name, argv in self.CLIENT_FUNCTIONAL_TESTS:
     54             client_at.run_test(test_name, disable_sysinfo=True, tag=client_tag,
     55                                **argv)
     56 
     57         # Test real life performance
     58         for script in self.CRYPTO_TESTS:
     59             client_at.run_test('platform_CryptohomeFio',
     60                 disable_sysinfo=True,
     61                 from_internal_disk_only=True,
     62                 script=script,
     63                 tag='_'.join([client_tag, script]),
     64                 runtime=crypto_runtime,
     65                 disk_configs=['crypto', 'plain'])
     66