-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:truenas/py-SMART into develop
- Loading branch information
Showing
11 changed files
with
1,007 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
pySMART | ||
=========== | ||
|
||
Copyright (C) 2021-2023 [Rafael Leira](https://github.com/ralequi)\ | ||
Copyright (C) 2021 [Truenas team](https://www.truenas.com/)\ | ||
Copyright (C) 2015 Marc Herndon | ||
|
||
Development | ||
----------- | ||
|
||
To run the tests, or to contribute to pySMART, you will have to set up a | ||
development environment. | ||
|
||
Our development environment will consist of a virtual environment, with the | ||
installation and development dependencies installed. | ||
|
||
See the [Python documentation] for more on creating and using virtual | ||
environment. | ||
|
||
This document will assume a Linux environment. | ||
|
||
The steps are: | ||
|
||
1. Clone this repository, go there | ||
1. Create a virtualenv and activate it | ||
1. Install the dependencies | ||
1. Run the tests | ||
|
||
- Go where you want to clone the repository, clone it, go there: | ||
|
||
```bash | ||
$ cd <wherever you want to clone the repository> | ||
$ git clone https://github.com/truenas/py-SMART | ||
|
||
Cloning into 'py-SMART'... | ||
remote: Enumerating objects: 2243, done. | ||
remote: Counting objects: 100% (839/839), done. | ||
remote: Compressing objects: 100% (362/362), done. | ||
remote: Total 2243 (delta 544), reused 743 (delta 463), pack-reused 1404 | ||
Receiving objects: 100% (2243/2243), 674.95 KiB | 2.38 MiB/s, done. | ||
Resolving deltas: 100% (1518/1518), done. | ||
|
||
$ cd py-SMART | ||
``` | ||
|
||
- Create a virtualenv and activate it | ||
|
||
```bash | ||
$ python -m venv .venv | ||
$ source .venv/bin/activate | ||
(.venv) $ | ||
``` | ||
|
||
We use `.venv` for the directory name of the virtualenv by convention. | ||
Any other legal directory name is fine; we'll assume `.venv`. | ||
- Update pip and setuptools | ||
```bash | ||
$(.venv) $ python -m pip install --upgrade pip setuptools | ||
Requirement already satisfied: pip in <...>/.venv/lib/python3.12/site-packages (23.1) | ||
Collecting pip | ||
Using cached pip-24.0-py3-none-any.whl (2.1 MB) | ||
Requirement already satisfied: setuptools in <...>/.venv/lib/python3.12/site-packages (68.0.0) | ||
Collecting setuptools | ||
Downloading setuptools-69.5.1-py3-none-any.whl (894 kB) | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 894.6/894.6 kB 6.1 MB/s eta 0:00:00 | ||
Installing collected packages: setuptools, pip | ||
Attempting uninstall: setuptools | ||
Found existing installation: setuptools 68.0.0 | ||
Uninstalling setuptools-68.0.0: | ||
Successfully uninstalled setuptools-68.0.0 | ||
Attempting uninstall: pip | ||
Found existing installation: pip 23.1 | ||
Uninstalling pip-23.1: | ||
Successfully uninstalled pip-23.1 | ||
Successfully installed pip-24.0 setuptools-69.5.1 | ||
``` | ||
- Install the package including development dependencies | ||
```bash | ||
$(.venv) $ python -m pip install --editable .[dev] | ||
``` | ||
- Run the tests | ||
```bash | ||
$(.venv) $ pytest | ||
=============== test session starts ===================================== | ||
platform linux -- Python 3.12.2, pytest-8.1.1, pluggy-1.5.0 | ||
rootdir: <...>/py-SMART | ||
configfile: pyproject.toml | ||
plugins: cov-5.0.0 | ||
collected 184 items | ||
< test file names, lots and lots of dots> | ||
=============== 184 passed in 0.99s ===================================== | ||
``` | ||
**That's it -- you're ready to start developing on pySMART!** | ||
[Python documentation]: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_--all__dev_sdd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-372.9.1.el8.x86_64] (local build) | ||
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org | ||
|
||
=== START OF INFORMATION SECTION === | ||
Vendor: XXXXXXXXXXX | ||
Product: XXXXXXXXXXX | ||
Revision: CA00 | ||
Compliance: SPC-5 | ||
User Capacity: 800,166,076,416 bytes [800 GB] | ||
Logical block size: 512 bytes | ||
Physical block size: 4096 bytes | ||
LU is resource provisioned, LBPRZ=1 | ||
Rotation Rate: Solid State Device | ||
Form Factor: 2.5 inches | ||
Logical Unit id: 0x50025380725029b0 | ||
Serial number: XXXXXXXXXXXXXXXX | ||
Device type: disk | ||
Transport protocol: SAS (SPL-3) | ||
Local Time is: Tue Apr 9 08:02:36 2024 EDT | ||
SMART support is: Available - device has SMART capability. | ||
SMART support is: Enabled | ||
Temperature Warning: Enabled | ||
|
||
=== START OF READ SMART DATA SECTION === | ||
SMART Health Status: OK | ||
|
||
Percentage used endurance indicator: 0% | ||
Current Drive Temperature: 42 C | ||
Drive Trip Temperature: 65 C | ||
|
||
Manufactured in week 07 of year 2022 | ||
Accumulated start-stop cycles: 135 | ||
Specified load-unload count over device lifetime: 0 | ||
Accumulated load-unload cycles: 0 | ||
Elements in grown defect list: 0 | ||
|
||
Error counter log: | ||
Errors Corrected by Total Correction Gigabytes Total | ||
ECC rereads/ errors algorithm processed uncorrected | ||
fast | delayed rewrites corrected invocations [10^9 bytes] errors | ||
read: 0 0 0 0 0 27805.729 0 | ||
write: 0 0 0 0 0 9378.908 0 | ||
verify: 0 0 0 0 0 0.016 0 | ||
|
||
Non-medium error count: 84893 | ||
|
||
SMART Self-test log | ||
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ] | ||
Description number (hours) | ||
# 1 Background short Completed - 349 - [- - -] | ||
|
||
Long (extended) Self-test duration: 3600 seconds [60.0 minutes] |
6 changes: 6 additions & 0 deletions
6
tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_-l_background__dev_sdd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-73-generic] (local build) | ||
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org | ||
|
||
=== START OF READ SMART DATA SECTION === | ||
Device does not support Background scan results logging | ||
|
4 changes: 4 additions & 0 deletions
4
tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_-l_sasphy__dev_sdd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-372.9.1.el8.x86_64] (local build) | ||
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org | ||
|
||
=== START OF READ SMART DATA SECTION === |
5 changes: 5 additions & 0 deletions
5
tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_test__dev_sdd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
smartctl 7.2 2021-01-17 r5171 [x86_64-linux-5.13.4-200.fc34.x86_64] (local build) | ||
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org | ||
|
||
/dev/sdd: Device of type 'scsi' [scsi] detected | ||
/dev/sdd: Device of type 'scsi' [scsi] opened |
Oops, something went wrong.