Skip to content

Commit

Permalink
Merge pull request #165 from xcp-ng/gtn-test-smartctl
Browse files Browse the repository at this point in the history
Add a test for plugin smartctl
  • Loading branch information
stormi committed Sep 27, 2023
2 parents b7fba88 + 762548b commit 81ebaf1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/xapi-plugins/plugin_smartctl/test_smartctl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import json
import pytest

# Requirements:
# From --hosts parameter:
# - host(A1): first XCP-ng host >= 8.3.

def _call_plugin(host, fn):
ret = host.call_plugin("smartctl.py", fn)
try:
json.loads(ret)
except ValueError:
pytest.fail("JSON string was expected but ValueError was raised")

@pytest.mark.usefixtures("host_at_least_8_3")
def test_smartctl_information(host):
_call_plugin(host, "information")

@pytest.mark.usefixtures("host_at_least_8_3")
def test_smartctl_health(host):
_call_plugin(host, "health")

0 comments on commit 81ebaf1

Please sign in to comment.