Add basic IPv4/IPv6 connectivity test #504
No reviewers
Labels
No labels
ai-review-please
Closed As
Duplicate
Closed As
Fixed
Closed As
Invalid
easyfix
freeipa
improvetest
iot
newtest
silverblue
tracker
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
quality/os-autoinst-distri-fedora!504
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "newtest/basic_networking"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a new parallel client/server test pair that validates basic network
connectivity on an installed system, covering static IPv4, ULA IPv6,
HTTP, and SSH (via scp).
tests/basic_networking_server.pm: new server-side job that creates a
test user if absent, configures a ULA IPv6 address, installs and
starts httpd and sshd, opens firewall ports, and signals readiness to
client jobs via a mutex.
tests/basic_networking_client.pm: new client-side job that sets up an
ed25519 SSH key pair, copies it to the server, then exercises the
connection through the appropriate desktop (GNOME, KDE, or TTY),
including static IPv6 configuration via NetworkManager, HTTP checks
via Firefox, and SSH/SFTP checks via Nautilus or Dolphin.
lib/tapnet.pm: export and implement setup_ipv6_ula(), a helper that
configures a ULA IPv6 address on the active ethernet connection using
nmcli and verifies the address is present afterwards.
needles: add GNOME and KDE needle pairs for the new UI interactions
(network settings gear, wired toggle, IPv4/IPv6 tabs, NM connection
list, SSH connect button, and SSH/SFTP content views).
AI Code Review
📋 MR Summary
This merge request introduces a basic networking test for installed systems, implementing a parallel client/server architecture. It validates IPv4, static IPv6 (ULA), HTTP, and SSH connectivity across different desktop environments (GNOME, KDE) and TTY.
lib/tapnet.pm::setup_ipv6_ulato configure a static IPv6 connection usingnmcli.tests/basic_networking_server.pmto set up a test server, configuring IPv6, installinghttpd, setting up a test user, and configuring firewalld.tests/basic_networking_client.pmto act as a client that establishes an SSH keypair, tests HTTP via Firefox, and tests SSH/SFTP via file managers or SCP.Detailed Code Review
The test implementation provides good coverage for basic networking features across multiple desktop environments. However, there are several robustness and security issues in the test scripts. The use of strict timeouts without loops can lead to flaky tests on slow CI runners. There are multiple instances of insecure file permissions, and
setfaclusage requires the$serialor$serialdevvariable to be defined, which is inconsistent. Input validation and error handling on command outputs (likenmcliorcut) should be improved.📂 File Reviews
📄 `lib/tapnet.pm` - Added a new helper function `setup_ipv6_ula` to configure static IPv6 on the active ethernet connection.
grep ethernet$will always match something. If no ethernet connection exists,head -1will be empty, and subsequentnmclicommands will fail with a syntax error or operate on an invalid connection name.$connectionis empty before proceeding withnmcli con mod.📄 `tests/basic_networking_client.pm` - Implements the client-side network tests, interacting with the GUI or TTY to verify connectivity.
$serialdevis used in the TTY block at line 231, but it is not defined in this scope. A similar variable$serialis defined at line 86 usingget_serialdev(), but in the TTY block it uses$serialdevwhich will evaluate to empty or undefined.$serialvariable instead of the undefined$serialdev.chmod 666 /dev/${serialdev}makes the serial device world-writable and readable, which is a security risk even in a test environment. It was correctly handled withsetfaclearlier in the file (line 87).setfaclto grant permissions to the specific user instead ofchmod 666.send_key('alt-f4')immediately after asserting the HTTP confirmation screen. On slow systems, Firefox might not fully render or close properly, leaving the application open for subsequent tests.📄 `tests/basic_networking_server.pm` - Implements the server-side setup for the basic networking test.
$serialdevis used at line 56, but it is never defined. Unlikebasic_networking_client.pmwhich callsget_serialdev(), this file does not retrieve it.get_serialdev()before using it.testline.txtfile is created withechoand redirected to the user's home directory by root without setting correct ownership. Depending on umask, the test user might not have read access, or it might be owned by root, causing SCP failures on the client.✅ Summary
$serialdevusage in both client and server scripts by properly retrievingget_serialdev().setup_ipv6_ulato prevent silent failures if no ethernet connection is found./home/$username/testline.txtcreated by root in the server script.chmod 666on the serial device in the client TTY section withsetfaclfor better security posture.send_keyinteractions to improve robustness against slow rendering in CI.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
c99af1a8a8dcdc4c87b0dcdc4c87b0dc50566312dc5056631221b317d02c21b317d02c69bc62d56dI fixed the majority of issues reported by the AI review. I am not sure what the
checkwikitest does and how to fix it. It complains about tests not being inTESTSUITES. but I grepped the repository and could not find any TESTSUITES.69bc62d56d2329ac423a2329ac423a3df843db6ccheckwiki is a cross-repo test between os-autoinst-distri-fedora and fedora_openqa that checks whether they're aligned for the purposes of wiki reporting, basically: it checks whether we have explicit config in conf_test_suites.py for every test that exists in the templates here.
It's been around for a long time but I only recently wired it up to run in CI, because we keep forgetting to sync them up and then I have to do a big catch-up commit like this one.
To deal with the 'synchronization problem' I made it so, whenever the test is running for a PR on one repo, it tries to check out the branch with the same name in the other repo. If that doesn't exist, it uses
main.So: to fix this, you should create a branch called
newtest/basic_networkingon the fedora_openqa repo, add wiki reporting configuration for the new test, and submit a PR from that branch. If we both got everything right, thecheckwikitest should then pass on both PRs. Then we have to remember to merge the two PRs together (so it's probably a good idea to link them from each other).Ok, noted. I will connect it with the base networking test case then. Thanks.
AI Code Review
📋 MR Summary
Introduces parallel client/server tests for basic IPv4 and IPv6 network connectivity, validating configuration and services via UI and CLI.
basic_networking_server.pmto configure server state, create a test user, setup ULA IPv6, and expose HTTP/SSH services.basic_networking_client.pmto validate HTTP/SSH access from GNOME, KDE, and TTY environments.setup_ipv6_ula()inlib/tapnet.pmfor static IPv6 configuration.check-needles.pyand provides corresponding needles.Detailed Code Review
The implementation of the parallel networking tests is solid and provides good coverage across both CLI and desktop environments. The synchronization between the client and server using mutexes appears correct.
However, there are a few implementation bugs that need to be addressed to prevent test failures. Specifically, an undefined variable is referenced in the TTY fallback block of the client test, and unquoted shell variables in the server test could lead to failures if the configured credentials contain spaces or special characters. Additionally, reading output from CLI tools into variables should account for potential trailing newlines.
📂 File Reviews
📄 `tests/basic_networking_client.pm` - Client-side test logic for validating network connectivity via desktop apps or TTY.
$usernameis undefined in this scope. The correct variable initialized at the beginning of therunmethod is$login.$usernamewith$login.📄 `tests/basic_networking_server.pm` - Server-side test logic configuring the test user, network, and exposed services.
$usernameand$passwordvariables are passed unquoted toprintfinsideassert_script_run. If the password contains spaces or shell metacharacters, the command will fail or result in command injection.📄 `lib/tapnet.pm` - Helper module for network configuration.
script_outputmay capture a trailing newline from the command execution. Passing this variable directly into subsequentnmclicommands can cause the shell string to break across lines, leading to command failures.✅ Summary
$usernamevariable inbasic_networking_client.pmby changing it to$login.$usernameand$passwordin thechpasswdcommand withinbasic_networking_server.pm.chomp $connection;afterscript_outputinlib/tapnet.pmto prevent newline injection in subsequentnmclicommands.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
There is no untrusted input to this system, and the tests run on ephemeral VMs with no secret contents, so it's not really an issue. The variables are derived from test variables in this same project, which we control. We're not going to command inject ourselves, and if we did, there'd be no point, as we also entirely control the contents and lifecycle of the VMs.
assert_screen 'browser'. That's what we do indesktop_browser. Please just do the same, and drop all the newapps_run_firefoxneedles and the change to check-needles.disable_firefox_studiesto disable a lot of annoying features that cause Firefox to behave unpredictably on first start; it's a good idea to call that before running Firefox.apps_run_system-settingsneedle, but we already haveapps_run_system_settings, fortests/apps_startstop/kde/system_settings.pm. Please avoid the duplication. This would also mean you don't need to change check-needles for this either. (The needle is also in the wrong directory - it's in the GNOME dir even though it's a KDE needle).checkstartfor launching Settings on either KDE or GNOME anyway, because if it doesn't start properly, the nextassert_and_clickwill fail and it will be obvious why. If we just leave it out, we don't need to add theapps_run_settingsneedle for GNOME.network_apply_buttonneedles could instead begnome_apply_buttonneedles, they're generic GNOME buttons. We already have agnome_apply_buttonneedle - the current one won't work here as it's red, but we don't need a new tag, we can use the same one, and then the button is potentially usable for any other GNOME test with an Apply button.if (script_run("getent passwd '$username'") != 0) {block really necessary? Is there ever a case where the user doesn't already exist? Conversely, if it's always necessary, can we skip the conditional? It just feels like this should be predictable.assert_script_run("setfacl -m u:$username:rw /dev/$serial");inbasic_networking_server? AFAICS it doesn't need it, nothing after that point seems to run as a regular user.--add-servicecommand and thereloadcommand.Yeah, I changed this according to the AI review.
I do not think this is really needed, we have a plenty of other such uses elsewhere. We do not expect passwords to have weird symbols in them.
I added this.
@adamwill wrote in #504 (comment):
I changed this accordingly, however should not we be using
menu_launch_typeconstantly even fordesktop_browsertests? However, this should be a matter of a different ticket.Technically, if we follow the same pattern as we always do, this would indeed be unnecessary. However, the server part starts by spinning a pre-installed image where the user is
test. If we in the future need to use different user name, we could make that happen by adding a variable to the templates. This conditional will make sure the user gets created.Should we not want this, I can remove it. Please, let me know.
In case we decide to keep it, I will update the VARIABLES file, too.
Otherwise, I changed it as requested.
9dccdc388f69b25c275469b25c2754f3b9c5a4a9f3b9c5a4a9c390d33c97desktop_keyring, but you chose to do things differently here (using the file managers not console commands). It seems a bit unnecessary to have two different workflows with different needle sets. Why not just do things the same way as in desktop_keyring and re-use the logic/needles as much as possible? We're testing the network here, not the desktop appsassert_screen 'browser';rather than just doing await_still_screenbecause browser startup can be slow sometimes. in fact, do both - do the assert_screen, then the wait_still_screenSilly review which recommended using
type_password, hidden.📋 MR Summary
This MR introduces a basic networking test pair (client and server) to validate IPv4/IPv6 connectivity, HTTP, and SSH functionality via both CLI and Desktop environments (GNOME/KDE).
basic_networking_server.pmto configure a server with HTTP, SSH, and static IPv6.basic_networking_client.pmto validate connections via GNOME, KDE, or TTY.setup_ipv6_ulahelper intapnet.pmfor static IPv6 configuration.Detailed Code Review
The implementation generally looks good and covers the intended networking capabilities across multiple environments. The transition towards using standard library helpers like
tapnet.pmand standard browser launch logic is a positive direction.However, there are a few structural and maintainability improvements to address. The usage of
type_stringfor typing passwords instead oftype_passwordexposes credentials in the test execution logs. Even in ephemeral test environments, it's best practice to usetype_passwordto prevent log pollution and adhere to openQA standards. Additionally, therunsubroutine in the client test has duplicatedif ($desktop eq "gnome") ... elsif ($desktop eq "kde")blocks that could be consolidated to improve readability.As noted in the active discussions, the
checkwikiCI test failure needs to be resolved by creating a matching branch in thefedora_openqarepository and updatingconf_test_suites.py.📂 File Reviews
📄 `tests/basic_networking_client.pm` - Client-side networking validation test for GNOME, KDE, and TTY environments.
type_stringto input passwords, which will record the plaintext password in the openQA execution logs. OpenQA providestype_passwordspecifically to mask credential input in the test results.type_string("$password\n")withtype_password("$password\n")whenever entering credentials.Minor [Complexity]: The
runsubroutine contains two consecutive blocks checkingif ($desktop eq "gnome")andelsif ($desktop eq "kde")separated by a gap. These could be merged to keep all desktop-specific logic grouped together and avoid evaluating the same conditions twice.http_test/ssh_testinvocations into a single conditional structure.Minor [Style]: Unnecessary use of
catpiped togrep(UUOC pattern).grepcan read directly from the file.grep.✅ Summary
checkwikiCI failure by updatingconf_test_suites.pyin thefedora_openqarepository.type_string("$password\n")withtype_password("$password\n")inbasic_networking_client.pmto prevent leaking passwords into the test logs.if ($desktop eq "gnome")blocks inbasic_networking_client.pminto a single conditional structure for better readability.cat testline.txt | grep ...togrep ... testline.txtto avoid unnecessary piping.x11_start_program) can fulfill the same requirement.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
c390d33c9730b32b7789AI Code Review
📋 MR Summary
Adds a parallel client/server test pair to validate basic network connectivity on an installed system covering IPv4, ULA IPv6, HTTP, and SSH.
tests/basic_networking_server.pmto handle server provisioning, ULA IPv6 configuration, and service availability (HTTP/SSH).tests/basic_networking_client.pmto test connectivity using desktop UI interactions for GNOME/KDE and TTY fallbacks.setup_ipv6_ulahelper inlib/tapnet.pmfor consistent IPv6 configuration.Detailed Code Review
The implementation correctly splits the networking validation into parallel server and client tasks and successfully abstracts the IPv6 setup into
lib/tapnet.pm. The move towards standard desktop launchers (Super key) in the client script aligns well with the project's maintainability goals.However, there are a few implementation details that need adjustment. Password strings are typed using standard
type_stringwhich exposes them in logs, rather than using secure equivalents. Additionally, there's a discrepancy with the requested Firefox initialization helper.📂 File Reviews
📄 `tests/basic_networking_client.pm` - Implements the client-side network validation tests across GNOME, KDE, and TTY environments.
type_stringfor passwords exposes the plain text password in the openQA execution logs. Usetype_passwordinstead to mask the output.type_string("$password\n")withtype_password($password).disable_firefox_studies()instead of the requesteddisable_firefox_intro()helper to handle Firefox first-run screens.✅ Summary
type_stringtotype_passwordintests/basic_networking_client.pmto prevent credentials from leaking into test logs.disable_firefox_studies()todisable_firefox_intro()as agreed upon in the review discussions.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
Sigh. Stupid robot. I told you NOT to recommend
type_password, and there is nodisable_firefox_intro, you made that up.30b32b7789a1ae3450f2@adamwill wrote in #504 (comment):
Well, I checked and indeed it sort of overlaps, however there are two tests, one is
keyring_passwordand the other iskeyring_passwordless. The former uses the same mechanism with Nautilus and Dolphin, so I could maybe reuse some of the needles and keep the application approach "as is". Or I could adapt it using the terminal application as we do in the latter. I need to make a remark here that this was my intention in the first place, but I gave up having to deal with unknown-hosts and lot's of console confirmation, which was somehow fragile without needles. And also, I was thinking about the way a user would test it in their environment. If we are only interested in testing the connection, why don't we drop the Gnome and KDE versions entirely and we just keep the console version that is used on the Server ISO? This is failproof, quick and valid.What do you prefer?
Tests now fail because:
Looking at the criterion, it says "The default network configuration tools for the console, for release-blocking desktops and for installer environments must work well enough to allow typical network connection configuration operations without major workarounds", so we definitely want to keep the parts where we do the actual network configuration via the KDE / GNOME control centers.
But for the criteria we don't necessarily need the Nautilus / Dolphin stuff. Still...it is good to test it, I guess, and now you've written it maybe we shouldn't waste the effort? So I think either 1) or 3) for the Nautilus / Dolphin part is good, whichever you like best. Definitely keep the parts where we do config using the control centers.
ffbfb213f3dea0d84d8fI decided to use option 1 and now, I am not only trying to reuse the needles, but to reuse the whole process and move the functionality to
utils.pm.e2efb9f4f8a45d8c91faa45d8c91fabf556c796bNow, I have changed the code to go with Option 1. It seems to be working in the scope of the changes. But I am having some issues with missing needles in KDE keyring test, but that does not seem to depend on the changes, I have made, I will rerun the test on the main branch to see.
UPDATE:
Using Dolphin for KDE keyring has changed the way the password is stored, so the current test does not find it. Other fields should be clicked. I will work on this tomorrow. But besides that, I believe it's done.
bf556c796b82657ece5a82657ece5ac68164488dAI Code Review
📋 MR Summary
This MR introduces a basic networking client and server test pair for openQA to validate IPv4, IPv6, HTTP, and SSH connectivity across different desktop environments and the console.
ssh_testhelper inlib/utils.pm.setup_ipv6_ula()inlib/tapnet.pmfor standardized IPv6 network interface configuration.utils.pm,tapnet.pm), which could inadvertently affect other tests relying on them if edge cases are hit.Detailed Code Review
The implementation generally looks solid and aligns well with the previously discussed consensus. The refactoring to use a shared
ssh_testhelper inutils.pmis a great way to handle KDE and GNOME consistently while adhering to established UI test patterns.One minor detail is that
ssh_testhandles previously stored passwords by checking forkeyring_askpass_rememberwith a timeout. While functional, this introduces an unconditional 15-second delay when reconnecting. This is acceptable but could be optimized if reconnect times become an issue.📂 File Reviews
📄 `lib/utils.pm` - Added a shared `ssh_test` helper for validating SSH/SFTP connections through UI file managers.
check_screen("keyring_askpass_remember", timeout => 15)will wait the full 15 seconds before timing out and proceeding. This slows down reconnect tests.$is_reconnect), you could bypass this check entirely or use a much shorter timeout.✅ Summary
ssh_testto avoid waiting 15 seconds for the keyring prompt on reconnections.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
Reneedling the keyring application was all it needed to pass, the AI review also does not complain, I considered the minor suggestion, but I think it does not create any harm waiting for 15 seconds to give the dialogue some time to appear, mostly it does not take that long.
I think it's done.
Awesome. Maybe go ahead and deploy this version on lab over the weekend and we can see how it does?
This version was deployed to Staging on Monday morning (2026-03-23)
c68164488d0995e5eb580995e5eb5803cae15570Rebased. Also lab was on main when I checked just now, so I've put it back on this branch.
03cae15570940b5a49bb940b5a49bbcd2d42818bThis is pretty big, and it's a bit hard to parse the factoring out to make sure it's identical, but the new version sure looks nicer and shorter, and the tests seem to be passing. So I think let's call it good. Thanks a lot for the work!