Skip to content
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

Another approach to write netboot-lib #639

Open
wants to merge 14 commits into
base: ubuntu-automatic-installation
Choose a base branch
from

Conversation

pietrushnic
Copy link
Contributor

Current state:

Dasharo (coreboot+UEFI)

Test env preparation:

./scripts/ci/remote-runner.sh user@host . nographic os_install uefi
ssh -t user@host 'cd /tmp/osfv && source venv/bin/activate && ./scripts/ci/qemu-self-test.sh

self-test was moded to execute only self-test/netbootxyz.robot

==============================================================================
Netbootxyz :: This suite verifies the correct operation of keywords parsing...
==============================================================================
Enter Netboot.Xyz Menu :: Test Enter Netboot.Xyz Menu kwd             | PASS |
------------------------------------------------------------------------------
Enter Netboot.Xyz Menu And Return Construction :: Test Enter Netbo... | PASS |
------------------------------------------------------------------------------
Netbootxyz :: This suite verifies the correct operation of keyword... | PASS |
2 tests, 2 passed, 0 failed
==============================================================================
Output:  /tmp/osfv/logs/2024.12.17_23.53.40/nextboot/output.xml
Log:     /tmp/osfv/logs/2024.12.17_23.53.40/nextboot/log.html
Report:  /tmp/osfv/logs/2024.12.17_23.53.40/nextboot/report.html

Dasharo (coreboot+SeaBIOS)

Test env preparation:

./scripts/ci/remote-runner.sh user@host . nographic os_install seabios
ssh -t user@host 'cd /tmp/osfv && source venv/bin/activate && ./scripts/ci/qemu-self-test-seabios.sh

self-test was moded to execute only self-test/netbootxyz.robot

==============================================================================
Netbootxyz :: This suite verifies the correct operation of keywords parsing...
==============================================================================
Enter Netboot.Xyz Menu :: Test Enter Netboot.Xyz Menu kwd             | PASS |
------------------------------------------------------------------------------
Enter Netboot.Xyz Menu And Return Construction :: Test Enter Netbo... | PASS |
------------------------------------------------------------------------------
Netbootxyz :: This suite verifies the correct operation of keyword... | PASS |
2 tests, 2 passed, 0 failed
==============================================================================
Output:  /tmp/osfv/logs/2024.12.17_23.59.28/nextboot/output.xml
Log:     /tmp/osfv/logs/2024.12.17_23.59.28/nextboot/log.html
Report:  /tmp/osfv/logs/2024.12.17_23.59.28/nextboot/report.html

With this PR we should be able to remove two branches:

Obviously there is redundancy here and we should clean this PR first.

@pietrushnic pietrushnic requested a review from macpijan December 17, 2024 23:02
Copy link
Contributor

@macpijan macpijan left a comment

Choose a reason for hiding this comment

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

So far looks good, thanks.

The question is if it works further as well - whether it will allow us to enter the menus (and then select OS) we need.

@pietrushnic
Copy link
Contributor Author

@macpijan, that is my goal; please let me know what test you want. I would like to have an Ubuntu installation. Do we also want to boot arbitrary Live distro?

@macpijan
Copy link
Contributor

I would like to have an Ubuntu installation

I think it's more than enough if this works.

Library RequestsLibrary
# TODO: maybe have a single file to include if we need to include the same
# stuff in all test cases
Resource ../sonoff-rest-api/sonoff-api.robot
Copy link
Contributor

Choose a reason for hiding this comment

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

please drop - triggers: Resource file '../sonoff-rest-api/sonoff-api.robot' does not exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

# TODO: maybe have a single file to include if we need to include the same
# stuff in all test cases
Resource ../sonoff-rest-api/sonoff-api.robot
Resource ../rtectrl-rest-api/rtectrl.robot
Copy link
Contributor

Choose a reason for hiding this comment

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

as above - we do not use them anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@macpijan
Copy link
Contributor

Apart from the mentioned errors, strangely enough it does not work for me for UEFI:

 SNIPEIT_NO=true RTE_IP=127.0.0.1 CONFIG=qemu-selftests-uefi  DEVICE_IP=127.0.0.1 ./scripts/run.sh self-tests/netbootxyz.robot
Logs will be saved at logs/qemu-selftests-uefi/2024_12_18_11_35_43
Watch "logs/qemu-selftests-uefi/2024_12_18_11_35_43/self-tests/netbootxyz.robot_debug.log" to monitor the progress of the test
[ ERROR ] Error in file '/home/macpijan/projects/github/dasharo/open-source-firmware-validation/self-tests/netbootxyz.robot' on line 13: Resource file '../sonoff-rest-api/sonoff-api.robot' does not exist.
[ ERROR ] Error in file '/home/macpijan/projects/github/dasharo/open-source-firmware-validation/self-tests/netbootxyz.robot' on line 14: Resource file '../rtectrl-rest-api/rtectrl.robot' does not exist.
==============================================================================
Netbootxyz :: This suite verifies the correct operation of keywords parsing...
==============================================================================
Enter Netboot.Xyz Menu :: Test Enter Netboot.Xyz Menu kwd             | FAIL |
No keyword with name 'Enter Boot Menu Tianocore And Return Construction' found. Did you mean:
    edk2.Enter Setup Menu Tianocore And Return Construction
    common.Enter Boot Menu And Return Construction
------------------------------------------------------------------------------
Enter Netboot.Xyz Menu And Return Construction :: Test Enter Netbo... ^CSecond signal will force exit.
Enter Netboot.Xyz Menu And Return Construction :: Test Enter Netbo... | FAIL |
Setup failed:
Execution terminated by signal
------------------------------------------------------------------------------
Netbootxyz :: This suite verifies the correct operation of keyword... | FAIL |
2 tests, 0 passed, 2 failed
==============================================================================
Debug:   /home/macpijan/projects/github/dasharo/open-source-firmware-validation/logs/qemu-selftests-uefi/2024_12_18_11_35_43/self-tests/netbootxyz.robot_debug.log
Output:  /home/macpijan/projects/github/dasharo/open-source-firmware-validation/logs/qemu-selftests-uefi/2024_12_18_11_35_43/self-tests/netbootxyz.robot_out.xml
Log:     /home/macpijan/projects/github/dasharo/open-source-firmware-validation/logs/qemu-selftests-uefi/2024_12_18_11_35_43/self-tests/netbootxyz.robot_log.html
Report:  /home/macpijan/projects/github/dasharo/open-source-firmware-validation/logs/qemu-selftests-uefi/2024_12_18_11_35_43/self-tests/netbootxyz.robot_report.html

@pietrushnic
Copy link
Contributor Author

Jeez, sorry. I didn't pushed all the changes.

@pietrushnic
Copy link
Contributor Author

@macpijan, please check now. All those PRs are so convoluted that changes are not logically separated because I'm fixing issues where I find them. To clarify things, we should split my PRs into many and describe those much better. If you have suggestions, please let me know. I know it is currently quite dirty, but at least I'm following the lib structure instead of bling keystrokes and hope for not changing menus.

@macpijan
Copy link
Contributor

Now parsing of the main menu works fine 👍

@pietrushnic
Copy link
Contributor Author

Now, parsing of the Linux Install menu works. It cost me a couple of hours of work, but I'm so far happy with the results:

==============================================================================
Netbootxyz :: This suite verifies the correct operation of keywords parsing...
==============================================================================
Enter Netboot.Xyz Linux Install Menu And Return Construction :: Te... | PASS |
------------------------------------------------------------------------------
Netbootxyz :: This suite verifies the correct operation of keyword... | PASS |
1 test, 1 passed, 0 failed
==============================================================================

We should have a goo foundation for kicking off any OS installation.

@pietrushnic
Copy link
Contributor Author

With these changes, I can enter Debian, Ubuntu and Fedora installation menus:

==============================================================================
Netbootxyz :: This suite verifies the correct operation of keywords parsing...
==============================================================================
Enter Netboot.Xyz Linux Distro Install Menu And Return Constructio... | PASS |
------------------------------------------------------------------------------
Enter Netboot.Xyz Linux Distro Install Menu And Return Constructio... | PASS |
------------------------------------------------------------------------------
Enter Netboot.Xyz Linux Distro Install Menu And Return Constructio... | PASS |
------------------------------------------------------------------------------
Netbootxyz :: This suite verifies the correct operation of keyword... | PASS |
3 tests, 3 passed, 0 failed
==============================================================================

@pietrushnic
Copy link
Contributor Author

Above change allows to set kernel cmdline parameters in Utilities menu:

==============================================================================
Netbootxyz :: This suite verifies the correct operation of keywords parsing...
==============================================================================
Enter Netboot.Xyz And Set Kernel Cmdline Params :: Test Enter Netb... | PASS |
------------------------------------------------------------------------------
Netbootxyz :: This suite verifies the correct operation of keyword... | PASS |
1 test, 1 passed, 0 failed
==============================================================================

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.

2 participants