summaryrefslogtreecommitdiffstats
path: root/unitest.py
diff options
context:
space:
mode:
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')