Skip to content

evetest: add TestLocalDatastore for mDNS-discovered datastores - #7097

Merged
milan-zededa merged 1 commit into
lf-edge:masterfrom
milan-zededa:local-datastore-test
Nov 12, 2026
Merged

milan-zededa merged 1 commit into
lf-edge:masterfrom
milan-zededa:local-datastore-test

Conversation

@milan-zededa

@milan-zededa milan-zededa commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Rewrite of the Eden local_datastore test for evetest. It covers the "local
datastore" feature: a datastore whose host name ends with .local is not
resolved with DNS, but discovered with mDNS on the bridges of EVE's network
instances (pkg/pillar/cmd/downloader/mdns.go). This code is currently
exercised only by Eden.

TestLocalDatastore (added to TestDatastoreSuite):

  1. Deploys a new test app, lfedge/evetest-local-ds, in a Local network
    instance. The app advertises evetest-local-ds.local over mDNS (avahi) and
    serves files over plain HTTP, like the ubuntu-http-server of the Eden test.
  2. Creates a random file in the app and reads back its SHA256.
  3. Declares a standalone volume downloaded from http://evetest-local-ds.local
    and waits for it to reach CREATED_VOLUME (the SHA256 is verified by EVE).
  4. Deletes the volume and waits for it to disappear.
  5. Negative variant: a .local host that nobody advertises fails with
    mDNS host not found.

The image size is configurable with EVETEST_LOCAL_DS_IMAGE_SIZE_MIB
(default 4).

Other changes:

  • New test app evetest/testapps/local-ds (avahi + python3 -m http.server).
  • HTTPStorage gets an OmitPort option. The downloader recognizes a local
    datastore by the URL host ending with .local, which the :80 suffix that
    evetest always added would hide.

PR dependencies

The lfedge/evetest-local-ds:1.0 image is published by publish-evetest.yml
only after this PR is merged to master, so TestLocalDatastore cannot pull it
before that (build it locally with make build-test-apps in evetest/).

How to test and validate this PR

Build the test app image, then run the test:

make -C evetest build-test-apps
make evetest NAME=TestLocalDatastore

Also runs as part of TestDatastoreSuite. To check the coverage gap it is
meant to fill, run it against a COVER=y EVE image and check that
findDSmDNS, queryService, findLocalBridges and findLocalDsSrc in
pkg/pillar/cmd/downloader/mdns.go are covered.

Changelog notes

No user-facing changes (adds an evetest test).

PR Backports

All four branches contain the local datastore code (mdns.go is identical to
master's).

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR
  • I've checked the boxes above, or I've provided a good reason why I didn't check them.

🤖 Generated with Claude Code

Rewrite of the Eden local_datastore test. An app running in a Local
network instance advertises evetest-local-ds.local over mDNS and serves
a random file over HTTP. A standalone volume is then downloaded from
that ".local" datastore and verified by SHA256. A negative variant uses
a host name nobody advertises and expects "mDNS host not found".

The app is a new test app, lfedge/evetest-local-ds. HTTPStorage gets an
OmitPort option, because the downloader recognizes a local datastore by
the URL host ending with ".local", which a ":port" suffix would hide.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Milan Lenco <milan@zededa.com>
@milan-zededa milan-zededa added stable Should be backported to stable release(s) testing New test or test framework changes labels Nov 12, 2026
@github-actions
github-actions Bot requested a review from europaul November 12, 2026 10:38
@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.58%. Comparing base (6a1353e) to head (d41e028).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7097      +/-   ##
==========================================
+ Coverage   29.08%   29.58%   +0.49%     
==========================================
  Files         550      561      +11     
  Lines       99453   101048    +1595     
==========================================
+ Hits        28926    29893     +967     
- Misses      68243    68919     +676     
+ Partials     2284     2236      -48     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rene rene 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.

LGTM

@github-actions

Copy link
Copy Markdown
Contributor

Evetest: Claude chose to skip 26 test/suite name(s) as unrelated to or redundant for this PR. Which ones and why: run summary.

Comment /evetest all to run the full suite, or /evetest <name> <name> ... to run only specific tests/suites.

@github-actions

Copy link
Copy Markdown
Contributor

TestDatastoreSuite: failures likely caused by this PR

TestLocalDatastore

Failure
timed out after 10m0.000528267s (excluding download) waiting for app "20d63c80-a85c-46cb-a876-53779efe5b68" (local-datastore-app) on device "edge-dev" to reach RUNNING state (last state: RESOLVING_TAG)
Claude's conclusion

This confirms it directly: the registry mirror knows lfedge/evetest-ubuntu-ctr (existing testapp, tags 1.0/1.1/1.2) but has no record at all of lfedge/evetest-local-ds — it was never published/pushed anywhere EVE's pull-through registry can see it.

Root cause

Live evidence shows local-datastore-app stuck in RESOLVING_TAG, with containerd repeatedly failing (evetest eve app-info) with MANIFEST_UNKNOWN: manifest unknown when pulling lfedge/evetest-local-ds:1.0 from the pull-through registry mirror at 192.168.170.2:5000. Querying that registry directly confirms it has NAME_UNKNOWN for lfedge/evetest-local-ds — the repository doesn't exist there at all — while the pre-existing lfedge/evetest-ubuntu-ctr testapp image (tags 1.0/1.1/1.2) is present and pullable fine. This is exactly the new container image added by this PR (evetest/testapps/local-ds/), whose Makefile defaults DOCKER_TARGET to load (local docker daemon only); per evetest/README.md, test-app images must separately be built and pushed (make build-test-apps DOCKER_TARGET=push) to a registry before any device can pull them, and that publish step evidently hasn't happened for this new image yet. This failure has never appeared in the ledger before (TestLocalDatastore/local-ds has zero prior entries), consistent with this being the test's very first run. It also doesn't share a root cause with the superficially similar 2026-11-11 RESOLVING_TAG ledger entry, which was a hung resolver goroutine against an already-published, healthy image — here the registry answers immediately and correctly that the image simply isn't there.

@milan-zededa

milan-zededa commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Regarding the TestDatastoreSuite failure -- it is expected to fail until this PR is merged and lfedge/evetest-local-ds:1.0 is published by the publish-evetest workflow.

@milan-zededa

milan-zededa commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

I'm going to merge this and will check tomorrow how it went in the nightly evetest run.
Eden results are not relevant here, these are purely evetest changes.

@milan-zededa
milan-zededa merged commit d18718f into lf-edge:master Nov 12, 2026
77 of 83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stable Should be backported to stable release(s) testing New test or test framework changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants