autotest: Remove unused storage tests
These tests do not provide any value for hw verification and/or
there are newer tast versions.
BUG=b:274808467
TEST=None
Change-Id: Ida3cb710b184958282272ef3934e95a5b1c654ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/5673760
Tested-by: Sarthak Kukreti <sarthakkukreti@google.com>
Commit-Queue: Sarthak Kukreti <sarthakkukreti@google.com>
Reviewed-by: Sarthak Kukreti <sarthakkukreti@google.com>
diff --git a/client/site_tests/hardware_DiskSize/control b/client/site_tests/hardware_DiskSize/control
deleted file mode 100644
index ff3b6e2..0000000
--- a/client/site_tests/hardware_DiskSize/control
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2010 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-AUTHOR = 'The ChromiumOS Authors'
-NAME = 'hardware_DiskSize'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Checks the size of the main disk',
- 'hw_agnostic': False
-}
-PURPOSE = 'Ensure the hard disk is large enough.'
-CRITERIA = 'Fails if the main disk is less than gb_main_disk_size.'
-TIME='SHORT'
-TEST_CATEGORY = 'Functional'
-TEST_CLASS = "hardware"
-TEST_TYPE = 'client'
-PY_VERSION = 3
-
-DOC = """
-This test will find the disk where /dev is located by searching /proc/cmdline,
-and will then determine the size of the main disk by reading /proc/partitions.
-"""
-
-job.run_test('hardware_DiskSize')
diff --git a/client/site_tests/hardware_DiskSize/hardware_DiskSize.py b/client/site_tests/hardware_DiskSize/hardware_DiskSize.py
deleted file mode 100644
index 5411c97..0000000
--- a/client/site_tests/hardware_DiskSize/hardware_DiskSize.py
+++ /dev/null
@@ -1,91 +0,0 @@
-# Lint as: python2, python3
-# Copyright 2010 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import os
-
-from autotest_lib.client.bin import test, utils
-from autotest_lib.client.common_lib import error
-
-DEFAULT_MIN_GB = 16
-# Allowable amount of bits eMMC vendor can use in firmware to support bad block
-# replacement and metadata.
-EMMC_VENDOR_ALLOWED_GB = 0.25
-# Amount of data available for user data in device, the rest is left for
-# over provisioning.
-# Typically a SATA device will use 7% over provisioning [the difference
-# between GB and GiB], but some eMMC device can use 9%.
-# With Flash becoming more error prone as lithography shrinks, the trend
-# is to increase over provisioning.
-DEFAULT_USER_DENSITY = 0.9
-
-
-class hardware_DiskSize(test.test):
- """
- Check that disk size is around 16GB at least.
- """
-
- version = 1
-
- def _is_emmc(self):
- path = os.path.join("/sys/class/block/", self._device,
- "device", "type")
- if not os.path.exists(path):
- return False
- return utils.read_one_line(path) == 'MMC'
-
-
- @classmethod
- def _gib_to_gb(cls, gib):
- return float(gib) * (1 << 30) / (10 ** 9)
-
- def _compute_min_gb(self):
- """Computes minimum size allowed primary storage device.
-
- TODO(tbroch): Add computation of raw bytes in eMMC using 'Chip Specific
- Data' (CSD & EXT_CSD) defined by JEDEC JESD84-A44.pdf if possible.
-
- CSD :: /sys/class/block/<device>/device/csd
- EXT_CSD :: debugfs
-
- Algorithm should look something like this:
- CSD[C_SIZE] = 0xfff == eMMC > 2GB
- EXT_CSD[SEC_COUNT] = # of 512byte sectors
-
- Now for existing eMMC I've examined I do see the C_SIZE == 0xfff.
- Unfortunately the SEC_COUNT appears to have excluded the sectors
- reserved for metadata & repair. Perhaps thats by design in which case
- there is no mechanism to determine the actual raw sectors.
-
- For now I use 0.25GB as an acceptable fudge.
-
- Returns:
- integer, in GB of minimum storage size.
- """
-
- min_gb = DEFAULT_MIN_GB
- if self._is_emmc():
- min_gb -= EMMC_VENDOR_ALLOWED_GB
- min_gb *= DEFAULT_USER_DENSITY
- return self._gib_to_gb(min_gb)
-
-
- def run_once(self):
- root_dev = utils.get_root_device()
- self._device = os.path.basename(root_dev)
- disk_size = utils.get_disk_size(root_dev)
- if not disk_size:
- raise error.TestError('Unable to determine main disk size')
-
- # Capacity of a hard disk is quoted with SI prefixes, incrementing by
- # powers of 1000, instead of powers of 1024.
- gb = float(disk_size) / (10 ** 9)
-
- self.write_perf_keyval({"gb_main_disk_size": gb})
- min_gb = self._compute_min_gb()
- logging.info("DiskSize: %.3f GB MinDiskSize: %.3f GB", gb, min_gb)
- if (gb < min_gb):
- raise error.TestError("DiskSize %.3f GB below minimum (%.3f GB)" \
- % (gb, min_gb))
diff --git a/client/site_tests/hardware_SsdDetection/control b/client/site_tests/hardware_SsdDetection/control
deleted file mode 100644
index 60ec705..0000000
--- a/client/site_tests/hardware_SsdDetection/control
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2012 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_SsdDetection'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Determine if main disk is a solid state device.',
- 'hw_agnostic': False
-}
-AUTHOR = 'The ChromiumOS Authors'
-PURPOSE = 'Determine if main disk is a solid state device.'
-CRITERIA = 'Fails if the main disk is not a solid state device.'
-TIME='SHORT'
-TEST_CATEGORY = 'Functional'
-TEST_CLASS = "hardware"
-TEST_TYPE = 'client'
-PY_VERSION = 3
-
-DOC = """
-This test uses hdparm to determine if the rotation rate properties match that of
-a solid state device.
-"""
-
-job.run_test('hardware_SsdDetection',
- constraints=['mb_ssd_device_size >= 8000'])
diff --git a/client/site_tests/hardware_SsdDetection/hardware_SsdDetection.py b/client/site_tests/hardware_SsdDetection/hardware_SsdDetection.py
deleted file mode 100644
index c0a8228..0000000
--- a/client/site_tests/hardware_SsdDetection/hardware_SsdDetection.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# Lint as: python2, python3
-# Copyright 2010 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import re
-
-from autotest_lib.client.bin import test, utils
-from autotest_lib.client.common_lib import error
-
-class hardware_SsdDetection(test.test):
- """Verify that a flash device is present. """
-
- version = 1
- # Keep a list of boards that are expected to ship with hard drive.
- boards_with_hdd = ['butterfly', 'kiev', 'parrot', 'stout']
-
- def setup(self):
- """
- create a empty srcdir to prevent the error that checks
- .version file
- """
- if not os.path.exists(self.srcdir):
- utils.system('mkdir %s' % self.srcdir)
-
-
- def run_once(self, check_link_speed=()):
- """
- Use rootdev to find the underlying block device even if the
- system booted to /dev/dm-0.
- """
- device = utils.get_root_device()
-
- def is_fixed(dev):
- """ Check the device is fixed.
-
- @param dev: device to check, i.e. 'sda'.
- """
- sysfs_path = '/sys/block/%s/removable' % dev
- return (os.path.exists(sysfs_path) and
- open(sysfs_path).read().strip() == '0')
-
- # Catch device name like sda, mmcblk0, nvme0n1.
- device_re = re.compile(r'^/dev/([a-zA-Z0-9]+)$')
- dev = device_re.findall(device)
- if len(dev) != 1 or not is_fixed(dev[0]):
- raise error.TestFail('The main disk %s is not fixed' % dev)
-
- # If it is an mmcblk or nvme device, then it is SSD.
- # Else run hdparm to check for SSD.
- if re.search("nvme", device):
- return
-
- if re.search("mmcblk", device):
- return
-
- type_path = '/sys/block/%s/device/type' % dev[0]
- type = os.path.realpath(type_path)
- if re.search("ufs", type):
- return
-
- hdparm = utils.run('/sbin/hdparm -I %s' % device)
-
- # Check if device is a SSD
- match = re.search(r'Nominal Media Rotation Rate: (.+)$',
- hdparm.stdout, re.MULTILINE)
- if match and match.group(1):
- if match.group(1) != 'Solid State Device':
- if utils.get_board() in self.boards_with_hdd:
- return
- raise error.TestFail('The main disk is not a SSD, '
- 'Rotation Rate: %s' % match.group(1))
- else:
- raise error.TestFail(
- 'Rotation Rate not reported from the device, '
- 'unable to ensure it is a SSD')
-
- # Check if SSD is > 8GB in size
- match = re.search("device size with M = 1000\*1000: (.+) MBytes",
- hdparm.stdout, re.MULTILINE)
- if match and match.group(1):
- size = int(match.group(1))
- self.write_perf_keyval({"mb_ssd_device_size" : size})
- else:
- raise error.TestFail(
- 'Device size info missing from the device')
-
- # Check supported link speed.
- #
- # check_link_speed is an empty tuple by default, which does not perform
- # link speed checking. You can run the test while specifying
- # check_link_speed=('1.5Gb/s', '3.0Gb/s') to check the 2 signaling
- # speeds are both supported.
- for link_speed in check_link_speed:
- if not re.search(r'Gen. signaling speed \(%s\)' % link_speed,
- hdparm.stdout, re.MULTILINE):
- raise error.TestFail('Link speed %s not supported' % link_speed)
diff --git a/client/site_tests/hardware_StorageFio/control.integrity_full_disk b/client/site_tests/hardware_StorageFio/control.integrity_full_disk
deleted file mode 100644
index 2e2bc58..0000000
--- a/client/site_tests/hardware_StorageFio/control.integrity_full_disk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2012 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_StorageFio.integrity_full_disk'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Verify that data written to disk remains valid after 72 hours',
- 'hw_agnostic': False
-}
-AUTHOR = 'puthik'
-PURPOSE = 'Verify that data written to disk remains valid after 72 hours.'
-TIME = 'LENGTHY'
-TEST_TYPE = 'client'
-PY_VERSION = 3
-
-DOC = """
-Test full drive integrity for internal disk.
-
-This test uses FIO to spawn a number of threads to perform a particular type of
-I/O. This test will do data integrity checks by first running a workload that
-writes data to the spare root partition and then verifying, after 72 hours,
-that the data on storage is still valid.
-
-NOTE: Must boot from USB or SD card to run this test.
-"""
-
-job.run_test(url='hardware_StorageFio', filesize=0, integrity='True',
- wait=60 * 60 * 72, max_run_time_mins=60 * 73)
diff --git a/client/site_tests/hardware_StorageFio/control.quick_integrity b/client/site_tests/hardware_StorageFio/control.quick_integrity
deleted file mode 100644
index ea1e43a..0000000
--- a/client/site_tests/hardware_StorageFio/control.quick_integrity
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2012 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_StorageFio.quick_integrity'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Short integrity test to verify the integrity test',
- 'hw_agnostic': False
-}
-AUTHOR = 'jcasse, grundler'
-PURPOSE = 'Short integrity test to verify the integrity test'
-TIME = 'LENGTHY'
-TEST_TYPE = 'client'
-PY_VERSION = 3
-ATTRIBUTES = "suite:storagequal"
-PY_VERSION = 3
-
-DOC = """
-This test uses FIO to spawn a number of threads to perform a particular type of
-I/O. This test will write data to the spare root partition, wait for 1 minute,
-then verify the data is still valid.
-"""
-
-job.run_test(url='hardware_StorageFio', integrity='True', wait=60)
diff --git a/client/site_tests/hardware_StorageFio/control.stress b/client/site_tests/hardware_StorageFio/control.stress
deleted file mode 100644
index a3b4ae0..0000000
--- a/client/site_tests/hardware_StorageFio/control.stress
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2012 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_StorageFio.stress'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Test the root device, when booted from a USB stick',
- 'hw_agnostic': False
-}
-AUTHOR = 'gwendal'
-PURPOSE = 'Test the root device, when booted from a USB stick'
-TIME = 'LENGTHY'
-TEST_TYPE = 'client'
-PY_VERSION = 3
-ATTRIBUTES = "suite:storagequal"
-PY_VERSION = 3
-
-DOC = """
-Send stress pattern to the disk for 30 minutes: 64K random write with 15% of
-read.
-"""
-
-job.run_test(url='hardware_StorageFio', filesize=0,
- requirements = [('64k_stress', [])])
diff --git a/client/site_tests/hardware_StorageFio/control.trim b/client/site_tests/hardware_StorageFio/control.trim
deleted file mode 100644
index 5dc6ee5..0000000
--- a/client/site_tests/hardware_StorageFio/control.trim
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2013 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_StorageFio.trim'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Test the root device for trim command support',
- 'hw_agnostic': False
-}
-AUTHOR = 'puthik'
-PURPOSE = 'Test the root device for trim command support'
-TIME = 'MEDIUM'
-TEST_TYPE = 'client'
-PY_VERSION = 3
-
-DOC = """
-This test uses FIO to test for trim command support for the root device.
-Currently this test doesn't support eMMC discard command and will fail
-when run on eMMC device.
-"""
-
-job.run_test(url='hardware_StorageFio', requirements = [('rand_trim', [])])
diff --git a/client/site_tests/hardware_StorageFio/control.vendor b/client/site_tests/hardware_StorageFio/control.vendor
deleted file mode 100644
index 227da6b..0000000
--- a/client/site_tests/hardware_StorageFio/control.vendor
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2014 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_StorageFio.vendor'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Test the internal device for new storage vendor',
- 'hw_agnostic': False
-}
-AUTHOR = 'puthik'
-PURPOSE = 'Test the internal device for new storage vendor'
-TIME = 'LENGTHY'
-TEST_TYPE = 'client'
-PY_VERSION = 3
-
-DOC = """
-This test uses FIO test for new storage vendor using the following workload.
-And collect the IOPs / Bandwidth and latency
-- Trim the drive
-- QD32 16K random write 1st pass
-- QD32 16K random read 1st pass
-- QD32 16K random write 2nd pass
-- QD32 16K random read 2nd pass
-- QD32 16K random write 3rd pass
-- QD32 16K random read 3rd pass
-- Trim the drive
-- QD1 512K seq write 1st pass
-- QD1 512K seq read 1st pass
-- QD1 512K seq write 2nd pass
-- QD1 512K seq read 2nd pass
-- QD1 512K seq write 3rd pass
-- QD1 512K seq read 3rd pass
-- Trim the drive
-- QD4 1M read 15% random read write 1st pass
-- QD4 1M read 15% random read write 2nd pass
-- QD4 1M read 15% random read write 3rd pass
-- Trim the drive
-
-NOTE: Must boot from USB or SD card to run this test.
-"""
-
-job.run_test(url='hardware_StorageFio', filesize=0,
- requirements = [('vendor_perf_fill_device', [])])
diff --git a/client/site_tests/hardware_StorageWearoutDetect/control b/client/site_tests/hardware_StorageWearoutDetect/control
deleted file mode 100644
index 16e3d35..0000000
--- a/client/site_tests/hardware_StorageWearoutDetect/control
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2014 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_StorageWearoutDetect'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Detect wear out status of storage device',
- 'hw_agnostic': False
-}
-AUTHOR = 'puthik'
-PURPOSE = 'Detect wear out status of storage device'
-TIME = 'SHORT'
-TEST_CLASS = 'hardware'
-TEST_TYPE = 'client'
-PY_VERSION = 3
-JOB_RETRIES = 2
-PY_VERSION = 3
-
-DOC = """
-This test check wear out status for storage device available in SMART for SSD
-and in ext_csd for eMMC version 5.0 or later. For previous version of eMMC,
-it will be treat as data not available. The test will be failed if there is
-SMART value is failing or eMMC wear out is in 90-100% band or higher.
-"""
-
-job.run_test('hardware_StorageWearoutDetect')
diff --git a/client/site_tests/hardware_StorageWearoutDetect/control.non_cache b/client/site_tests/hardware_StorageWearoutDetect/control.non_cache
deleted file mode 100644
index e9c860c..0000000
--- a/client/site_tests/hardware_StorageWearoutDetect/control.non_cache
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2014 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_StorageWearoutDetect.non_cache'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Detect wear out status of storage device',
- 'hw_agnostic': False
-}
-AUTHOR = 'puthik'
-PURPOSE = 'Detect wear out status of storage device'
-TIME = 'SHORT'
-TEST_CLASS = 'hardware'
-TEST_TYPE = 'client'
-PY_VERSION = 3
-
-DOC = """
-This test check wear out status for storage device available in SMART for SSD
-and in ext_csd for eMMC version 5.0 or later. For previous version of eMMC,
-it will be treat as data not available. The test will be failed if there is
-SMART value is failing or eMMC wear out is in 90-100% band or higher.
-"""
-
-job.add_sysinfo_logfile('/var/log/storage_info.txt', on_every_test=True)
-job.run_test('hardware_StorageWearoutDetect', use_cached_result=False)
diff --git a/client/site_tests/hardware_StorageWearoutDetect/hardware_StorageWearoutDetect.py b/client/site_tests/hardware_StorageWearoutDetect/hardware_StorageWearoutDetect.py
deleted file mode 100644
index 62c3da8..0000000
--- a/client/site_tests/hardware_StorageWearoutDetect/hardware_StorageWearoutDetect.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# Lint as: python2, python3
-# Copyright 2014 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging, os, re
-from autotest_lib.client.bin import test, utils
-from autotest_lib.client.common_lib import error
-
-
-class hardware_StorageWearoutDetect(test.test):
- """
- Check wear out status for storage device available in SMART for SSD and
- in ext_csd for eMMC version 5.0 or later. For previous version of eMMC,
- it will be treat as data not available.
-
- The test will be failed if:
- - At least one SMART variable has value under its threshold
- or
- - Percentage Used reported by SMART for NVMe or SATA is above 90
- or
- - eMMC wear out status variable is in 90-100% band or higher (
- DEVICE_LIFE_TIME_EST_TYP_A). Seeing this consistently means the lab
- device may have to be replaced.
- """
-
- version = 1
- STORAGE_INFO_PATH = '/var/log/storage_info.txt'
- STORAGE_INFO_COMMON_PATH = '/usr/share/misc/storage-info-common.sh'
-
- # Example "SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)"
- SATA_DETECT = r"SATA Version is:.*"
-
- # Example " Extended CSD rev 1.7 (MMC 5.0)"
- MMC_DETECT = r"\s*Extended CSD rev.*MMC (?P<version>\d+.\d+)"
-
- # Example "SMART/Health Information (NVMe Log 0x02, NSID 0xffffffff)"
- NVME_DETECT = r".*NVMe Log .*"
-
- # Field meaning and example line that have failing attribute
- # ID# ATTRIBUTE_NAME FLAGS VALUE WORST THRESH FAIL RAW_VALUE
- # 184 End-to-End_Error PO--CK 001 001 097 NOW 135
- SSD_FAIL = r"""\s*(?P<param>\S+\s\S+) # ID and attribute name
- \s+[P-][O-][S-][R-][C-][K-] # flags
- (\s+\d{3}){3} # three 3-digits numbers
- \s+NOW # fail indicator"""
-
- # We want to detect and fail if we see a non-zero value for either
- # attribute 160 Uncorrectable_Error_Cnt or attribute 187 Reported_Uncorrect
- # ID# ATTRIBUTE_NAME FLAGS VALUE WORST THRESH FAIL RAW_VALUE
- # 160 Uncorrectable_Error_Cnt ----- 100 100 100 - 10
- SATA_FAIL = r"""\s*(?P<param>(160\s+Uncorrectable_Error_Cnt|
- 187\s+Reported_Uncorrect))
- \s+[P-][O-][S-][R-][C-][K-]
- (\s+\d{1,3}){3}
- \s+(NOW|[-])
- \s+[1-9][0-9]*"""
-
- # Ex "Pre EOL information [PRE_EOL_INFO: 0x02]"
- # 0x02 means Warning, consumed 80% of reserved blocks
- # 0x03 means Urgent
- MMC_FAIL = r".*(?P<param>PRE_EOL_INFO]?: 0x0[23])"
-
- # Ex Available Spare: 100%
- # We want to fail when the available spare is below the
- # available spare threshold.
- NVME_SPARE = r"Available Spare:\s+(?P<param>\d{1,3})%"
-
- #Available Spare Threshold: 10%
- NVME_THRESH = r"Available Spare Threshold:\s+(?P<param>\d{1,3})%"
-
- def run_once(self, use_cached_result=True):
- """
- Run the test
-
- @param use_cached_result: Use the result that generated when machine
- booted or generate new one.
- """
-
- if not use_cached_result:
- if not os.path.exists(self.STORAGE_INFO_COMMON_PATH):
- msg = str('Test failed with error: %s not exist'
- % self.STORAGE_INFO_COMMON_PATH)
- raise error.TestFail(msg)
- cmd = ' '.join(['. %s;' % (self.STORAGE_INFO_COMMON_PATH, ),
- 'get_storage_info'])
- utils.run(cmd, stdout_tee=open(self.STORAGE_INFO_PATH, 'w'),
- stderr_tee=utils.TEE_TO_LOGS)
-
- # Check that storage_info file exist.
- if not os.path.exists(self.STORAGE_INFO_PATH):
- msg = str('Test failed with error: %s not exist'
- % self.STORAGE_INFO_PATH)
- raise error.TestFail(msg)
-
- mmc_detect = False
- sata_detect = False
- legacy_mmc = False
- nvme_detect = False
- fail_msg = ''
-
- with open(self.STORAGE_INFO_PATH) as f:
- for line in f:
- m = re.match(self.SATA_DETECT, line)
- if m:
- sata_detect = True
- logging.info('Found SATA device')
-
- m = re.match(self.MMC_DETECT, line)
- if m:
- version = m.group('version')
- if float(version) < 5.0:
- legacy_mmc = True
- mmc_detect = True
- logging.info('Found eMMC version %s', version)
-
- m = re.match(self.NVME_DETECT, line)
- if m:
- nvme_detect = True
- logging.info('Found NVMe device')
-
- m = re.match(self.SSD_FAIL, line, re.X)
- if m:
- param = m.group('param')
- fail_msg += 'SSD failure ' + param
-
- m = re.match(self.MMC_FAIL, line)
- if m:
- param = m.group('param')
- fail_msg += 'MMC failure ' + param
-
- m = re.match(self.SATA_FAIL, line, re.X)
- if m:
- param = m.group('param')
- fail_msg += 'SATA failure, attribute ' + param
-
- m = re.match(self.NVME_SPARE, line)
- if m:
- # Check the next line for the available spare threshold.
- # Fail if available spare is below the threshold.
- spare = m.group('param')
- nextLine = next(f)
- nm = re.match(self.NVME_THRESH, nextLine)
- if nm:
- thresh = nm.group('param')
- if int(spare) < int(thresh):
- fail_msg += 'NVMe failure, Available Spare ' + \
- spare + '% below threshold ' + \
- thresh + '%'
-
- if not sata_detect and not mmc_detect and not nvme_detect:
- raise error.TestFail('Can not detect storage device.')
-
- if fail_msg:
- msg = 'Detected wearout parameter:%s' % fail_msg
- raise error.TestFail(msg)
-
- if legacy_mmc:
- msg = 'eMMC version %s detected. ' % version
- msg += 'Wearout attributes are supported in eMMC 5.0 and later.'
- logging.info(msg)
diff --git a/client/site_tests/hardware_TrimIntegrity/control b/client/site_tests/hardware_TrimIntegrity/control
deleted file mode 100644
index c3b0413..0000000
--- a/client/site_tests/hardware_TrimIntegrity/control
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2014 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_TrimIntegrity'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Verifies trim acts as expected.',
- 'hw_agnostic': False
-}
-AUTHOR = 'puthik'
-PURPOSE = 'Perform data integrity trim test on an unmounted partition.'
-TIME = 'LENGTHY'
-TEST_TYPE = 'client'
-PY_VERSION = 3
-
-DOC = """
-Performs data integrity trim test on an unmounted partition.
-
-This test will write 1 GB of data and verify that trimmed data are gone and
-untrimmed data are unaffected. The verification will be run in 5 passes with
-0%, 25%, 50%, 75%, and 100% of data trimmed.
-
-"""
-
-job.run_test('hardware_TrimIntegrity')
diff --git a/client/site_tests/hardware_TrimIntegrity/control.full_disk b/client/site_tests/hardware_TrimIntegrity/control.full_disk
deleted file mode 100644
index b7fe631..0000000
--- a/client/site_tests/hardware_TrimIntegrity/control.full_disk
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2014 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_TrimIntegrity.full_disk'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Verifies trim acts as expected.',
- 'hw_agnostic': False
-}
-AUTHOR = 'puthik'
-PURPOSE = 'Perform data integrity trim test on internal disk.'
-TIME = 'LENGTHY'
-TEST_TYPE = 'client'
-PY_VERSION = 3
-ATTRIBUTES = "suite:mmc_qual"
-
-DOC = """
-Performs data integrity trim test on an internal disk while booting from usb.
-
-This test will fill the internal disk and verify that trimmed data are gone and
-untrimmed data are unaffected. The verification will be run in 5 passes with
-0%, 25%, 50%, 75%, and 100% of data trimmed.
-
-"""
-
-job.run_test('hardware_TrimIntegrity', file_size=0)
diff --git a/client/site_tests/hardware_TrimIntegrity/control.quick b/client/site_tests/hardware_TrimIntegrity/control.quick
deleted file mode 100644
index b4181fd..0000000
--- a/client/site_tests/hardware_TrimIntegrity/control.quick
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2014 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-NAME = 'hardware_TrimIntegrity.quick'
-METADATA = {
- 'contacts': ['chromeos-storage@google.com'],
- 'bug_component': 'b:974567',
- 'criteria': 'Verifies trim acts as expected.',
- 'hw_agnostic': False
-}
-AUTHOR = 'puthik'
-PURPOSE = 'Perform data integrity trim test on an unmounted partition.'
-TIME = 'SHORT'
-TEST_TYPE = 'client'
-PY_VERSION = 3
-ATTRIBUTES = "suite:experimental"
-
-DOC = """
-Performs data integrity trim test on an unmounted partition.
-
-This test will write 16 MB of data and verify that trimmed data are gone and
-untrimmed data are unaffected. The verification will be run in 5 passes with
-0%, 25%, 50%, 75%, and 100% of data trimmed.
-
-"""
-
-job.run_test('hardware_TrimIntegrity', file_size=16*1024*1024)
diff --git a/client/site_tests/hardware_TrimIntegrity/hardware_TrimIntegrity.py b/client/site_tests/hardware_TrimIntegrity/hardware_TrimIntegrity.py
deleted file mode 100644
index 542df15..0000000
--- a/client/site_tests/hardware_TrimIntegrity/hardware_TrimIntegrity.py
+++ /dev/null
@@ -1,264 +0,0 @@
-# Lint as: python2, python3
-# Copyright 2014 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os, fcntl, logging, struct, random
-
-from autotest_lib.client.bin import test, utils
-from autotest_lib.client.common_lib import error
-
-
-class hardware_TrimIntegrity(test.test):
- """
- Performs data integrity trim test on an unmounted partition.
-
- This test will write 1 GB of data and verify that trimmed data are gone and
- untrimmed data are unaffected. The verification will be run in 5 passes with
- 0%, 25%, 50%, 75%, and 100% of data trimmed.
-
- Also, perform 4K random read QD32 before and after trim. We should see some
- speed / latency difference if the device firmware trim data properly.
-
- Condition for test result:
- - Trim command is not supported
- -> Target disk is a harddisk : TestNA
- -> Target disk is SCSI disk w/o trim : TestNA
- -> Otherwise : TestFail
- - Can not verify integrity of untrimmed data
- -> All case : TestFail
- - Trim data is not Zero
- -> SSD with RZAT : TestFail
- -> NVMe with dlfeat:1 : TestFail
- -> Otherwise : TestNA
- """
-
- version = 1
- FILE_SIZE = 1024 * 1024 * 1024
- CHUNK_SIZE = 192 * 1024
- TRIM_RATIO = [0, 0.25, 0.5, 0.75, 1]
-
- hdparm_trim = 'Data Set Management TRIM supported'
- hdparm_rzat = 'Deterministic read ZEROs after TRIM'
- nvme_dlfeat = 'dlfeat'
-
- # Use hash value to check integrity of the random data.
- HASH_CMD = 'sha256sum | cut -d" " -f 1'
- # 0x1277 is ioctl BLKDISCARD command
- IOCTL_TRIM_CMD = 0x1277
- IOCTL_NOT_SUPPORT_ERRNO = 95
-
- def _get_hash(self, chunk_count, chunk_size):
- """
- Get hash for every chunk of data.
- """
- cmd = str('for i in $(seq 0 %d); do dd if=%s of=/dev/stdout bs=%d'
- ' count=1 skip=$i iflag=direct | %s; done' %
- (chunk_count - 1, self._filename, chunk_size, self.HASH_CMD))
- return utils.run(cmd).stdout.split()
-
- def _do_trim(self, fd, offset, size):
- """
- Invoke ioctl to trim command.
- """
- fcntl.ioctl(fd, self.IOCTL_TRIM_CMD, struct.pack('QQ', offset, size))
-
- def _verify_trim_support(self, size):
- """
- Check for trim support in ioctl. Raise TestNAError if not support.
-
- @param size: size to try the trim command
- """
- try:
- fd = os.open(self._filename, os.O_RDWR, 0o666)
- self._do_trim(fd, 0, size)
- except IOError as err:
- if err.errno == self.IOCTL_NOT_SUPPORT_ERRNO:
- reason = 'IOCTL Does not support trim.'
- msg = utils.get_storage_error_msg(self._diskname, reason)
-
- if utils.is_disk_scsi(self._diskname):
- if utils.is_disk_harddisk(self._diskname):
- msg += ' Disk is a hard disk.'
- raise error.TestNAError(msg)
- if utils.verify_hdparm_feature(self._diskname,
- self.hdparm_trim):
- msg += ' Disk claims trim supported.'
- else:
- msg += ' Disk does not claim trim supported.'
- raise error.TestNAError(msg)
- # SSD with trim support / mmc / sd card
- raise error.TestFail(msg)
- else:
- raise
- finally:
- os.close(fd)
-
- def initialize(self):
- self.job.use_sequence_number = True
-
- def run_once(self, filename=None, file_size=FILE_SIZE,
- chunk_size=CHUNK_SIZE, trim_ratio=TRIM_RATIO):
- """
- Executes the test and logs the output.
- @param file_name: file/disk name to test
- default: spare partition of internal disk
- @param file_size: size of data to test. default: 1GB
- @param chunk_size: size of chunk to calculate hash/trim. default: 64KB
- @param trim_ratio: list of ratio of file size to trim data
- default: [0, 0.25, 0.5, 0.75, 1]
- """
-
- if not filename:
- self._diskname = utils.get_fixed_dst_drive()
- if self._diskname == utils.get_root_device():
- self._filename = utils.get_free_root_partition()
- else:
- self._filename = self._diskname
- else:
- self._filename = filename
- self._diskname = utils.get_disk_from_filename(filename)
-
- if file_size == 0:
- fulldisk = True
- file_size = utils.get_disk_size(self._filename)
- if file_size == 0:
- cmd = ('%s seem to have 0 storage block. Is the media present?'
- % filename)
- raise error.TestError(cmd)
- else:
- fulldisk = False
-
- # Make file size multiple of 4 * chunk size
- file_size -= file_size % (4 * chunk_size)
-
- logging.info('filename: %s, filesize: %d', self._filename, file_size)
-
- self._verify_trim_support(chunk_size)
-
- # Calculate hash value for zero'ed and one'ed data
- cmd = str('dd if=/dev/zero bs=%d count=1 | %s' %
- (chunk_size, self.HASH_CMD))
- zero_hash = utils.run(cmd).stdout.strip()
-
- cmd = str("dd if=/dev/zero bs=%d count=1 | tr '\\0' '\\xff' | %s" %
- (chunk_size, self.HASH_CMD))
- one_hash = utils.run(cmd).stdout.strip()
-
- trim_hash = ""
-
- # Write random data to disk
- chunk_count = file_size // chunk_size
- cmd = str('dd if=/dev/urandom of=%s bs=%d count=%d oflag=direct' %
- (self._filename, chunk_size, chunk_count))
- utils.run(cmd)
-
- ref_hash = self._get_hash(chunk_count, chunk_size)
-
- # Check read speed/latency when reading real data.
- self.job.run_test('hardware_StorageFio',
- disable_sysinfo=True,
- filesize=file_size,
- blkdiscard=False,
- requirements=[('4k_read_qd32', [])],
- tag='before_trim')
-
- # Generate random order of chunk to trim
- trim_order = list(range(0, chunk_count))
- random.shuffle(trim_order)
- trim_status = [False] * chunk_count
-
- # Init stat variable
- data_verify_count = 0
- data_verify_match = 0
- trim_verify_count = 0
- trim_verify_zero = 0
- trim_verify_one = 0
- trim_verify_non_delete = 0
- trim_deterministic = True
-
- last_ratio = 0
- for ratio in trim_ratio:
-
- # Do trim
- begin_trim_chunk = int(last_ratio * chunk_count)
- end_trim_chunk = int(ratio * chunk_count)
- fd = os.open(self._filename, os.O_RDWR, 0o666)
- for chunk in trim_order[begin_trim_chunk:end_trim_chunk]:
- self._do_trim(fd, chunk * chunk_size, chunk_size)
- trim_status[chunk] = True
- os.close(fd)
- last_ratio = ratio
-
- cur_hash = self._get_hash(chunk_count, chunk_size)
-
- trim_verify_count += int(ratio * chunk_count)
- data_verify_count += chunk_count - int(ratio * chunk_count)
-
- # Verify hash
- for cur, ref, trim in zip(cur_hash, ref_hash, trim_status):
- if trim:
- if not trim_hash:
- trim_hash = cur
- elif cur != trim_hash:
- trim_deterministic = False
-
- if cur == zero_hash:
- trim_verify_zero += 1
- elif cur == one_hash:
- trim_verify_one += 1
- elif cur == ref:
- trim_verify_non_delete += 1
- else:
- if cur == ref:
- data_verify_match += 1
-
- keyval = dict()
- keyval['data_verify_count'] = data_verify_count
- keyval['data_verify_match'] = data_verify_match
- keyval['trim_verify_count'] = trim_verify_count
- keyval['trim_verify_zero'] = trim_verify_zero
- keyval['trim_verify_one'] = trim_verify_one
- keyval['trim_verify_non_delete'] = trim_verify_non_delete
- keyval['trim_deterministic'] = trim_deterministic
- self.write_perf_keyval(keyval)
-
- # Check read speed/latency when reading from trimmed data.
- self.job.run_test('hardware_StorageFio',
- disable_sysinfo=True,
- filesize=file_size,
- blkdiscard=False,
- requirements=[('4k_read_qd32', [])],
- tag='after_trim')
-
- if data_verify_match < data_verify_count:
- reason = 'Fail to verify untrimmed data.'
- msg = utils.get_storage_error_msg(self._diskname, reason)
- raise error.TestFail(msg)
-
- if trim_verify_zero < trim_verify_count:
- reason = 'Trimmed data are not zeroed.'
- msg = utils.get_storage_error_msg(self._diskname, reason)
- if utils.is_disk_scsi(self._diskname):
- if utils.verify_hdparm_feature(self._diskname,
- self.hdparm_rzat):
- msg += ' Disk claim deterministic read zero after trim.'
- raise error.TestFail(msg)
- elif utils.is_disk_nvme(self._diskname):
- dlfeat = utils.get_nvme_id_ns_feature(self._diskname,
- self.nvme_dlfeat)
- if dlfeat == "None":
- msg += ' Expected values for trimmed data not reported.'
- raise error.TestNAError(msg)
- elif int(dlfeat, 16) & 7 == 1:
- msg += ' Disk indicates values should be zero after trim.'
- raise error.TestFail(msg)
- # TODO(asavery): NVMe 1.3 specification allows all bytes set
- # to FF from a deallocated logical block
- elif int(dlfeat, 16) & 7 == 2:
- msg += ' Unexpected values, test does not check for ones.'
- raise error.TestFail(msg)
- else:
- msg += ' Expected values for trimmed data not specified.'
- raise error.TestNAError(msg)
- raise error.TestNAError(msg)
diff --git a/server/site_tests/hardware_StorageStress/hardware_StorageStress.py b/server/site_tests/hardware_StorageStress/hardware_StorageStress.py
index 4e5519f..a153445 100644
--- a/server/site_tests/hardware_StorageStress/hardware_StorageStress.py
+++ b/server/site_tests/hardware_StorageStress/hardware_StorageStress.py
@@ -212,8 +212,3 @@
wait=0, integrity=True)
self._power_func()
-
- self._client_at.run_test('hardware_StorageWearoutDetect',
- tag='%s_%d' % ('wearout', self._loop_count),
- wait=0, use_cached_result=False)
- # No checkout for wearout, to test device pass their limits.