Skip to content

Commit 10e53a9

Browse files
committed
Merge branch 'develop' of github.com:truenas/py-SMART into develop
2 parents e18f803 + 76f70f1 commit 10e53a9

File tree

11 files changed

+1007
-3
lines changed

11 files changed

+1007
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Version 1.4.0
22
=============
33
- Added support for test polling_minutes. Requested in [#77](https://github.com/truenas/py-SMART/issues/77) and [#78](https://github.com/truenas/py-SMART/pull/78). Thanks @Gigahawk
4-
- Minnor typo fixed in NvmeAttributes (issue [#81](https://github.com/truenas/py-SMART/issues/81)). Thanks @petersulyok
4+
- Minnor typo fixed in NvmeAttributes (issue [#81](https://github.com/truenas/py-SMART/issues/81)). Thanks @petersulyok
5+
- Minnor fix for JBOD devices (MR [#85](https://github.com/truenas/py-SMART/pull/85)). Thanks @jackeichen
56
- Fixed __getstate__ method in Device class. (issue [#86](https://github.com/truenas/py-SMART/issues/86)). Thanks @f18m
67
- Added DEVELOP.md file to help developers to get started with the project. (MR [#87](https://github.com/truenas/py-SMART/pull/87/files)). Thanks @ssteinerx
78
- Fixed listing devices on MACOS (issue [#84](https://github.com/truenas/py-SMART/issues/84)). Thanks @evanrich

DEVELOP.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
pySMART
2+
===========
3+
4+
Copyright (C) 2021-2023 [Rafael Leira](https://github.com/ralequi)\
5+
Copyright (C) 2021 [Truenas team](https://www.truenas.com/)\
6+
Copyright (C) 2015 Marc Herndon
7+
8+
Development
9+
-----------
10+
11+
To run the tests, or to contribute to pySMART, you will have to set up a
12+
development environment.
13+
14+
Our development environment will consist of a virtual environment, with the
15+
installation and development dependencies installed.
16+
17+
See the [Python documentation] for more on creating and using virtual
18+
environment.
19+
20+
This document will assume a Linux environment.
21+
22+
The steps are:
23+
24+
1. Clone this repository, go there
25+
1. Create a virtualenv and activate it
26+
1. Install the dependencies
27+
1. Run the tests
28+
29+
- Go where you want to clone the repository, clone it, go there:
30+
31+
```bash
32+
$ cd <wherever you want to clone the repository>
33+
$ git clone https://github.com/truenas/py-SMART
34+
35+
Cloning into 'py-SMART'...
36+
remote: Enumerating objects: 2243, done.
37+
remote: Counting objects: 100% (839/839), done.
38+
remote: Compressing objects: 100% (362/362), done.
39+
remote: Total 2243 (delta 544), reused 743 (delta 463), pack-reused 1404
40+
Receiving objects: 100% (2243/2243), 674.95 KiB | 2.38 MiB/s, done.
41+
Resolving deltas: 100% (1518/1518), done.
42+
43+
$ cd py-SMART
44+
```
45+
46+
- Create a virtualenv and activate it
47+
48+
```bash
49+
$ python -m venv .venv
50+
$ source .venv/bin/activate
51+
(.venv) $
52+
```
53+
54+
We use `.venv` for the directory name of the virtualenv by convention.
55+
Any other legal directory name is fine; we'll assume `.venv`.
56+
57+
- Update pip and setuptools
58+
59+
```bash
60+
$(.venv) $ python -m pip install --upgrade pip setuptools
61+
62+
Requirement already satisfied: pip in <...>/.venv/lib/python3.12/site-packages (23.1)
63+
Collecting pip
64+
Using cached pip-24.0-py3-none-any.whl (2.1 MB)
65+
Requirement already satisfied: setuptools in <...>/.venv/lib/python3.12/site-packages (68.0.0)
66+
Collecting setuptools
67+
Downloading setuptools-69.5.1-py3-none-any.whl (894 kB)
68+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 894.6/894.6 kB 6.1 MB/s eta 0:00:00
69+
Installing collected packages: setuptools, pip
70+
Attempting uninstall: setuptools
71+
Found existing installation: setuptools 68.0.0
72+
Uninstalling setuptools-68.0.0:
73+
Successfully uninstalled setuptools-68.0.0
74+
Attempting uninstall: pip
75+
Found existing installation: pip 23.1
76+
Uninstalling pip-23.1:
77+
Successfully uninstalled pip-23.1
78+
Successfully installed pip-24.0 setuptools-69.5.1
79+
```
80+
81+
- Install the package including development dependencies
82+
83+
```bash
84+
$(.venv) $ python -m pip install --editable .[dev]
85+
```
86+
87+
- Run the tests
88+
89+
```bash
90+
$(.venv) $ pytest
91+
=============== test session starts =====================================
92+
platform linux -- Python 3.12.2, pytest-8.1.1, pluggy-1.5.0
93+
rootdir: <...>/py-SMART
94+
configfile: pyproject.toml
95+
plugins: cov-5.0.0
96+
collected 184 items
97+
< test file names, lots and lots of dots>
98+
=============== 184 passed in 0.99s =====================================
99+
```
100+
101+
**That's it -- you're ready to start developing on pySMART!**
102+
103+
[Python documentation]: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments

pySMART/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ def _classify(self) -> str:
659659
'-l',
660660
'sasphy',
661661
self.dev_reference])
662-
if returncode == 0 and 'SAS SSP' in raw[4]:
662+
if returncode == 0 and len(raw) > 4 and 'SAS SSP' in raw[4]:
663663
fine_interface = 'sas'
664664
# Some older SAS devices do not support the SAS PHY log command.
665665
# For these, see if smartmontools reports a transport protocol.

pySMART/interface/nvme/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def parse(self, data: Iterator[str]) -> None:
678678
value.replace(',', '').replace('.', '').replace('’', ''))
679679
elif name == 'Controller Busy Time':
680680
self.controllerBusyTime = int(
681-
value.replace(',', '').replace('.', ''))
681+
value.replace(',', '').replace('.', '').replace('’', ''))
682682
elif name == 'Power Cycles':
683683
self.powerCycles = int(
684684
value.replace(',', '').replace('.', ''))
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-372.9.1.el8.x86_64] (local build)
2+
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
3+
4+
=== START OF INFORMATION SECTION ===
5+
Vendor: XXXXXXXXXXX
6+
Product: XXXXXXXXXXX
7+
Revision: CA00
8+
Compliance: SPC-5
9+
User Capacity: 800,166,076,416 bytes [800 GB]
10+
Logical block size: 512 bytes
11+
Physical block size: 4096 bytes
12+
LU is resource provisioned, LBPRZ=1
13+
Rotation Rate: Solid State Device
14+
Form Factor: 2.5 inches
15+
Logical Unit id: 0x50025380725029b0
16+
Serial number: XXXXXXXXXXXXXXXX
17+
Device type: disk
18+
Transport protocol: SAS (SPL-3)
19+
Local Time is: Tue Apr 9 08:02:36 2024 EDT
20+
SMART support is: Available - device has SMART capability.
21+
SMART support is: Enabled
22+
Temperature Warning: Enabled
23+
24+
=== START OF READ SMART DATA SECTION ===
25+
SMART Health Status: OK
26+
27+
Percentage used endurance indicator: 0%
28+
Current Drive Temperature: 42 C
29+
Drive Trip Temperature: 65 C
30+
31+
Manufactured in week 07 of year 2022
32+
Accumulated start-stop cycles: 135
33+
Specified load-unload count over device lifetime: 0
34+
Accumulated load-unload cycles: 0
35+
Elements in grown defect list: 0
36+
37+
Error counter log:
38+
Errors Corrected by Total Correction Gigabytes Total
39+
ECC rereads/ errors algorithm processed uncorrected
40+
fast | delayed rewrites corrected invocations [10^9 bytes] errors
41+
read: 0 0 0 0 0 27805.729 0
42+
write: 0 0 0 0 0 9378.908 0
43+
verify: 0 0 0 0 0 0.016 0
44+
45+
Non-medium error count: 84893
46+
47+
SMART Self-test log
48+
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
49+
Description number (hours)
50+
# 1 Background short Completed - 349 - [- - -]
51+
52+
Long (extended) Self-test duration: 3600 seconds [60.0 minutes]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-73-generic] (local build)
2+
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
3+
4+
=== START OF READ SMART DATA SECTION ===
5+
Device does not support Background scan results logging
6+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-372.9.1.el8.x86_64] (local build)
2+
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
3+
4+
=== START OF READ SMART DATA SECTION ===
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
smartctl 7.2 2021-01-17 r5171 [x86_64-linux-5.13.4-200.fc34.x86_64] (local build)
2+
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
3+
4+
/dev/sdd: Device of type 'scsi' [scsi] detected
5+
/dev/sdd: Device of type 'scsi' [scsi] opened

0 commit comments

Comments
 (0)