Skip to content

Web test check#1539

Open
troglobit wants to merge 6 commits into
mainfrom
web-test-check
Open

Web test check#1539
troglobit wants to merge 6 commits into
mainfrom
web-test-check

Conversation

@troglobit

Copy link
Copy Markdown
Contributor

Description

Minor fixes, and a diff view!

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@troglobit troglobit requested a review from mattiaswal June 16, 2026 19:24
@troglobit troglobit added the ci:main Build default defconfig, not minimal label Jun 17, 2026

# The web UI is an optional package (BR2_PACKAGE_WEBUI); minimal
# builds omit it. Skip rather than fail when it isn't installed.
tgtssh = env.attach("target", "mgmt", "ssh")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, shouldn't this be a feature on the infix-services yang model and feature in infix? I think this is the way we want to go.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If it is even possible, previously we have on checked if a module exist.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like it is a has_feature in transport.py 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Tricky question, previously we've had a simple landing page shown at :80/443 when the web interface was enabled, for both minimal and regular builds. Now that landing page is only shown for minimal builds. So, one approach could be to add a conditional /web/management/ container that is only included when the webui is built. Another could be a take on my earlier proposal to make the minimal build really minimal and make the entire /web section optional, i.e., no nginx or restconf even.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could accept this change as-is now, so we fix the test issue of all branches from main, and open a discussion on the services feature as a separate topic?

@mattiaswal mattiaswal Jun 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just skipping the UI (management node as you suggest) is enough. Dropping restconf from minimal is still a bad idea I think since we use it for tests. Dropping restconf I feel will be to much loss of test coverage.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another approach is that you just can have a feature enabled without limit any containers in the model

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure I follow, what does "have a feature enabled without limit any containers in the model"?

Currently we have a LOT of enabled flags in the /web service tree:

module: infix-services
  +--rw web
     +--rw certificate?   ks:central-asymmetric-key-ref
     +--rw enabled?       boolean
     +--rw console
     |  +--rw enabled?   boolean
     +--rw netbrowse
     |  +--rw enabled?   boolean
     +--rw restconf
        +--rw enabled?   boolean

Personally I feel that /web/enabled is the logical knob for users to toggle to enable/disable the webui, adding a /web/management/enabled knob will be confusing for sure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wait, @mattiaswal, is it a YANG feature you're talking about?

Add conditional YANG feature 'web-ui' to infix-services.yang, set when
the webui is built.  This feature is what the test now looks for to
determine if it should be skipped or not.

Also, clean up remnant of old test, which was entirely replaced by
Mattias' login/csrf test.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Move the per-user shell editor out of the always-visible row into the
expanded detail; the summary now reports the shell as plain text.  This
also fixes the editor showing "bash" for non-bash users: the dropdown
matched the module-prefixed option value against the bare stored shell,
so it never matched and fell back to the first option.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Adds a button next to "Save to startup" that opens a modal showing a
unified diff between startup-config and running-config, so the pending
changes can be reviewed before persisting them.  The handler fetches
both datastores over RESTCONF (same serializer → low-noise diff),
writes them to temp files, and runs busybox `diff -u`.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add a Hash dropdown to the add-user and change-password forms — yescrypt
(default), SHA-512, SHA-256, MD5 — passed through to mkpasswd. These are
exactly the four hashes the infix-system:crypt-hash YANG type accepts;
unknown values fall back to the default. Password inputs switch to the
CSS-masked type=text used by keystore secrets, which keeps the browser
password manager from offering to save device credentials. Each add-user
field gets a YANG description as a hover tooltip.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
These two shortcuts are toggleable in the configuration but were only
detected once at login and baked into the session, so disabling them
didn't drop the topbar icon / user-menu entry until re-login.

Refresh just those two from running-config on full page loads (htmx
swaps and pollers, which never re-draw them, are skipped), so toggling
takes effect on the next reload without logging out.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The "unsaved changes" banner was set unconditionally at every site that
touches config, so it could appear when running-config actually equals
startup — contradicting the "Show diff" modal, which correctly showed
nothing.  A shared updateCfgUnsaved helper now compares running against
startup (the same datastore pair the diff uses) and sets or clears the
banner cookie to match:

 - Apply and restore-to-running clear it when an Apply/restore reverts
   an out-of-band (e.g. CLI) change back to match startup, instead of
   always showing it.
 - The advanced-tree presence toggle writes only the candidate
   datastore, so it no longer sets the running-vs-startup banner at all
   (matching the other candidate-only tree handlers).

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>

@mattiaswal mattiaswal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work! Looking forward to do some additions myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:main Build default defconfig, not minimal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants