Skip to content

Allow a host test to reset the device under test #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2017

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Nov 16, 2017

Add a host test reset function to allow the current DUT to be reset. This allow unexpected power loss to be tested.

CC @bridadan @studavekar @theotherjimmy

@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage decreased (-0.03%) to 45.778% when pulling b4dbbea on c1728p9:reset_dut_from_host_test into c1aa092 on ARMmbed:master.

@@ -64,6 +64,14 @@ def reset_dut(self, value):
if self.__event_queue:
self.__event_queue.put(('__reset_dut', value, time()))

def reset(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I wrote this code pretty hastily, but let's get the keys matching the function names if at all possible.

Can we make this function soft_reset_dut?

This would mean you'd need to update your custom host test as well.

@@ -64,6 +64,14 @@ def reset_dut(self, value):
if self.__event_queue:
self.__event_queue.put(('__reset_dut', value, time()))

def reset(self):
"""
Reset device under test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this comment different from the function above. Something like

Reset device under test (without restarting the host test)

connector.finish()
return 0
if not connector.write_kv(key, value):
elif key == '__reset_dut':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this key match the event queue key: __reset_dut -> __soft_reset_dut.

@@ -366,6 +366,9 @@ def process_code_coverage(key, value, timestamp):
self.logger.prn_inf("%s(%s)" % (key, str(value)))
result = value
event_queue.put(('__exit_event_queue', 0, time()))
elif key == '__soft_reset_dut':
# This event only resets the dut, not the host test
dut_event_queue.put(('__reset_dut', True, time()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this key match the event queue key: __reset_dut -> __soft_reset_dut.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 45.778% when pulling b66e122 on c1728p9:reset_dut_from_host_test into c1aa092 on ARMmbed:master.

1 similar comment
@coveralls
Copy link

coveralls commented Nov 20, 2017

Coverage Status

Coverage decreased (-0.03%) to 45.778% when pulling b66e122 on c1728p9:reset_dut_from_host_test into c1aa092 on ARMmbed:master.

Add a host test reset function to allow the current DUT to be reset.
This allow unexpected power loss to be tested.
@c1728p9 c1728p9 force-pushed the reset_dut_from_host_test branch from b66e122 to 8b00025 Compare November 20, 2017 18:24
@c1728p9
Copy link
Contributor Author

c1728p9 commented Nov 20, 2017

PR in little FS for this change:
ARMmbed/mbed-littlefs#10

@coveralls
Copy link

coveralls commented Nov 20, 2017

Coverage Status

Coverage decreased (-0.03%) to 45.778% when pulling 8b00025 on c1728p9:reset_dut_from_host_test into c1aa092 on ARMmbed:master.

@theotherjimmy
Copy link
Contributor

@c1728p9 Thanks! Could you update the function names as @bridadan recommended? After that, a clean test run is all that's required.

@theotherjimmy
Copy link
Contributor

@c1728p9 Will we need to release a new version of htrun after this patch goes in?

@bridadan
Copy link
Contributor

Hi @theotherjimmy I forgot to post an update here but offline we decided to just go with the reset naming instead of the soft_reset_dut since it's not really a soft reset. There is an existing function called reset_dut, however I'm not currently aware of anything that's actually using it. And yes we'll need to get a new version out at some point.

@theotherjimmy
Copy link
Contributor

Thanks @bridadan. Sorry for the noise guys.

@theotherjimmy theotherjimmy merged commit 1debc33 into ARMmbed:master Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants