Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

soc testing example usign pytest and imagehash#120

Merged
mangelajo merged 1 commit intomainfrom
pytest-with-imagehash
Oct 17, 2024
Merged

soc testing example usign pytest and imagehash#120
mangelajo merged 1 commit intomainfrom
pytest-with-imagehash

Conversation

@mangelajo
Copy link
Copy Markdown
Member

@mangelajo mangelajo commented Oct 9, 2024

Provides a SOC testing example involving drivers like dutlink and ustreamer, console, storage, etc..

Comment thread contrib/dutlink/examples/rpi4_video.py Outdated
Comment thread contrib/ustreamer/jumpstarter_driver_ustreamer/client.py Outdated
@mangelajo mangelajo force-pushed the pytest-with-imagehash branch from 9cb783b to 6f9c0da Compare October 10, 2024 09:11
Comment thread pytest.ini Outdated
Comment thread pytest.ini Outdated
Comment thread jumpstarter/testing/pytest.py Outdated
Comment thread contrib/ustreamer/jumpstarter_driver_ustreamer/client.py Outdated
Comment thread contrib/ustreamer/jumpstarter_driver_ustreamer/client.py Outdated
Comment thread contrib/ustreamer/jumpstarter_driver_ustreamer/client.py Outdated
Comment thread contrib/dutlink/examples/pytest/test_on_rpi4.py Outdated
@mangelajo mangelajo force-pushed the pytest-with-imagehash branch 4 times, most recently from b07dc62 to 7742a37 Compare October 16, 2024 09:16
@mangelajo mangelajo changed the base branch from main to imagehash-lib October 16, 2024 09:17
@mangelajo mangelajo force-pushed the pytest-with-imagehash branch 2 times, most recently from fd04e70 to 18c053a Compare October 16, 2024 09:26
@mangelajo mangelajo changed the base branch from imagehash-lib to main October 16, 2024 09:33
@mangelajo mangelajo changed the base branch from main to imagehash-lib October 16, 2024 09:33
@mangelajo mangelajo force-pushed the pytest-with-imagehash branch from 18c053a to f7ade45 Compare October 16, 2024 09:34
@mangelajo mangelajo changed the title Pytest with imagehash soc testing example usign pytest and imagehash Oct 16, 2024
@mangelajo mangelajo requested a review from NickCao October 16, 2024 09:36
@mangelajo mangelajo marked this pull request as draft October 16, 2024 09:36
@mangelajo mangelajo changed the base branch from imagehash-lib to main October 17, 2024 07:55
@mangelajo mangelajo force-pushed the pytest-with-imagehash branch from f7ade45 to 6519cee Compare October 17, 2024 10:26
@mangelajo mangelajo marked this pull request as ready for review October 17, 2024 10:27
@mangelajo mangelajo force-pushed the pytest-with-imagehash branch 2 times, most recently from 4a4359d to c09297a Compare October 17, 2024 10:41
@mangelajo mangelajo force-pushed the pytest-with-imagehash branch from c09297a to 47fecd5 Compare October 17, 2024 10:46
Comment on lines +15 to +17
# TODO: figure this out
#"jumsptarter_imagehash",
#"jumpstarter_driver_dutlink",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What's not working?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If you can try to uncomment it locally, it doesn't seem to work.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:rtype: pexpect.spawn
"""
log.info("Waiting for login prompt")
pexpect_console.expect("login:", timeout=timeout)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be part of the example, the login prompts could be different across distributions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am OK with moving it to the example, but we should have a generic shell driver/adapter in the long term to help us drive the login/shell interaction with a common interface.

Probably to put in in the core we should make it ready to handle all those other case

def test_power_on_hdmi(self, client, video):
# check all the image snapshots through the rpi4 boot process
client.dutlink.power.on()
time.sleep(1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little concerned about timing, how has this been reliability-wise?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

surprisingly reliable, but yes, this should not be the end goal :)

just a starting point. As we said, something that is going to compare video input and expect images to appear in a specific order, and finally provide a list of appearances, and timestamps, probably running on the exporter itself?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not quite sure if we should put this in core, I feel like while this is common for many Linux systems, it may not be useful for many users who won't get a login prompt or may get a different message.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll move it into the example itself, until we can create a more common adapter for driving shell/login interaction.

@mangelajo
Copy link
Copy Markdown
Member Author

I'll merge for now and follow up with your comments in a separate PR, thanks for reviewing and the meaningful requests.

@mangelajo mangelajo added this pull request to the merge queue Oct 17, 2024
Merged via the queue into main with commit 246d472 Oct 17, 2024
@NickCao NickCao deleted the pytest-with-imagehash branch January 29, 2025 14:38
@mangelajo mangelajo added this to the 0.5.0 milestone May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants