summaryrefslogtreecommitdiffstats
path: root/unitest.py
diff options
context:
space:
mode:
authorTim Nibert <docz2a@gmail.com>2018-08-18 17:47:36 +1000
committerTim Nibert <docz2a@gmail.com>2018-08-20 18:18:21 +1000
commitc15a97093717253f0305890fbb7ee7c06b1ed00b (patch)
treeaa028f4fd6e6d99b6ce98c607530d0f1c4edf2fa /unitest.py
parent1d2add124852cb8e88a7e99aaab631c7103f49e4 (diff)
Hard disk SMART plugin, includes python3 patched pySMART
Diffstat (limited to 'unitest.py')
-rwxr-xr-xunitest.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/unitest.py b/unitest.py
index 8918f6de..7db7377d 100755
--- a/unitest.py
+++ b/unitest.py
@@ -254,6 +254,20 @@ class TestGlances(unittest.TestCase):
l_subsample = subsample(l[0], l[1])
self.assertLessEqual(len(l_subsample), l[1])
+ def test_016_hddsmart(self):
+ """Check hard disk SMART data plugin."""
+ from glances.plugins.glances_smart import is_admin
+ stat = 'DeviceName'
+ print('INFO: [TEST_016] Check SMART stats: {}'.format(stat))
+ stats_grab = stats.get_plugin('smart').get_raw()
+ if not is_admin():
+ print("INFO: Not admin, SMART list should be empty")
+ assert len(stats_grab) == 0
+ else:
+ self.assertTrue(stat in stats_grab[0].keys(), msg='Cannot find key: %s' % stat)
+
+ print('INFO: SMART stats: %s' % stats_grab)
+
def test_094_thresholds(self):
"""Test thresholds classes"""
print('INFO: [TEST_094] Thresholds')