Skip to content

Conversation

@philipanda
Copy link
Contributor

@philipanda philipanda commented Oct 29, 2025

implementing changes for #748

@philipanda philipanda changed the title dasharo-security/me-neuter: Separate suite file into subfiles per OS Reduce unnecessary reboots: part 1 Oct 29, 2025
@philipanda philipanda changed the title Reduce unnecessary reboots: part 1 Reduce unnecessary reboots: part 1, me-neuter Oct 29, 2025
@philipanda philipanda force-pushed the reducing-unnecessary-power-on-part1 branch 4 times, most recently from d7d97af to 45b5dfd Compare October 31, 2025 17:00
@philipanda
Copy link
Contributor Author

Logs showing:

  1. A normal test case over serial that enters the setup menu works as before
    custom-boot-menu-key_log.html

  2. AUD test suite, which had the platform power state control turned on by overriding a variable in *** Variables *** section and removing forced Power On calls. By doing so, the platform is rebooted only once per OS, to boot into the OS, which saves about 50% of execution time in this case: audio-subsystem_log.html

@philipanda
Copy link
Contributor Author

Splitting the suites into multiple files per OS was supposed to be a way to achieve less reboots during tests. Turns out, that this approach is essentially what was used in a PR to solve #1099 in #1130. The approach where we first gather all the data required for all tests (for a given OS) and then we only interpret the collected data in test cases is essentially what the solution for concurrent execution is. Splitting into multiple files, one per OS, allows to run data gathering on every OS independently.

Just monitoring the power state and reducing reboots if not needed can work without this change. Just ${PLATFORM_STATE_CONTROL}= ${TRUE} and removing forced power ons (Power On Ex force_reboot=${True}) is enough to benefit from reduced reboots. That makes the tests much more tidy though, so I'd stand for keeping the splits from this PR.

Logs after splitting the AUD test suite into files per OS. audio-subsystem_log.html

@philipanda philipanda force-pushed the reducing-unnecessary-power-on-part1 branch from 07db682 to b49faad Compare November 3, 2025 14:14
@philipanda philipanda changed the title Reduce unnecessary reboots: part 1, me-neuter Reduce unnecessary reboots: part 1, AUD, MNE Nov 3, 2025
@philipanda philipanda marked this pull request as ready for review November 3, 2025 14:25


*** Keywords ***
Init Power State Control
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to have some tests for these new keywords on QEMU under self-tests to ensure they work properly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess the best way to test them would be to just do the same setup menu tests as now, just with the power state control ON and Power On Ex force_reboot=${TRUE} swapped to Power On Ex force_reboot=${FALSE}. Alternatively a separate test case could be added that just moves between setup/bootmenu/OS repeatedly a couple times.

Power Cycle On
Boot State Control Notify State booting

Power On Ex
Copy link
Contributor

Choose a reason for hiding this comment

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

Ex stand for what exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extended/Expanded, something to differentiate from Power On for which Power On Ex is a wrapper

ELSE
Press Enter
Login To Linux Over Serial Console ${DEVICE_OS_USERNAME} ${DEVICE_OS_PASSWORD}
${line}= Read From Terminal
Copy link
Contributor

Choose a reason for hiding this comment

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

should we explain why do we need to handle this case?

Copy link
Contributor Author

@philipanda philipanda Nov 4, 2025

Choose a reason for hiding this comment

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

I think the commit message should show more or less what's the intention: Login To Linux: Handle already logged in via serial. It's added so that if the OS is already booted and the user (or root) is already logged in, we can just continue instead of waiting for the login prompt (which will never appear)

@macpijan
Copy link
Contributor

macpijan commented Nov 3, 2025

Do you have some metrics - how long it took to run modified test suite - before and after the changes?

@philipanda
Copy link
Contributor Author

Do you have some metrics - how long it took to run modified test suite - before and after the changes?

Sure @macpijan , here's a direct comparison from logs:

That's 44% time reduction for just the automatic reboot reduction. Suprisingly after splitting into files-per-OS it gets even better at 51% time reduction. I'm nut quite sure what has changed, maybe it's just variation.

@philipanda philipanda force-pushed the reducing-unnecessary-power-on-part1 branch from d12a3e1 to 3fdc06b Compare November 5, 2025 08:48
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.

3 participants