Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT Monitoring Module
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
DIOT Monitoring Module
Commits
835d20b6
Commit
835d20b6
authored
Jul 25, 2022
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pytest/main_fw: check TMR_ERROR_CNT after each test
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
42dcede5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
conftest.py
pytest/conftest.py
+3
-0
test_fw_main.py
pytest/test-00-basic/test_fw_main.py
+11
-0
No files found.
pytest/conftest.py
View file @
835d20b6
...
...
@@ -125,6 +125,9 @@ class monimod:
data
=
self
.
pmbus_read_block_cmd
(
self
.
cmd_ids
[
"TMR_ERROR_CNT"
])
return
int
.
from_bytes
(
bytes
(
data
),
"little"
)
def
clear_tmr
(
self
):
data
=
self
.
pmbus_write_block_cmd
(
self
.
cmd_ids
[
"TMR_ERROR_CNT"
],
[
0
,
0
,
0
,
0
])
def
set_pec
(
self
,
pec_val
):
# Turn off PEC in Linux i2c driver if enabled.
# Setting PEC in Monimod is possible only with PEC disabled in
...
...
pytest/test-00-basic/test_fw_main.py
View file @
835d20b6
...
...
@@ -102,6 +102,17 @@ def check_boot_mode(monimod_bus):
pytest
.
skip
(
"Monimod not in main mode! Unable to switch to main mode!"
)
warnings
.
warn
(
UserWarning
(
"Monimod not in main mode! Switched to main mode."
))
# check the content of TMR_ERROR_CNT after each test
# clear TMR_ERROR_CNT if non zero
@
pytest
.
fixture
(
scope
=
"function"
,
autouse
=
True
)
def
check_tmr
(
monimod_bus
):
yield
TMR_val
=
monimod_bus
.
get_tmr
()
if
TMR_val
!=
0
:
monimod_bus
.
clear_tmr
()
assert
TMR_val
==
0
,
(
"TMR_ERROR_CNT is not zero"
)
class
TestFwMainRegAccess
(
object
):
@
pytest
.
mark
.
check_uptime
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment