Skip to content

omamobile-modem-sit 0.3.35: its tests no longer read the phone's own network devices - #677

Merged
derekross merged 1 commit into
derekross:mainfrom
W4HO-ham:sit-test-host-net
Nov 12, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
W4HO-ham:sit-test-host-net

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

packages/omamobile-modem-sit/test/all fails on a phone whose modem is up, so tools/phone-install-package packages/omamobile-modem-sit can't build the package there.

data_call.deactivate() refuses while the bearer's network device is up. It reads that from /sys/class/net/<device>/flags, for rmnet<CID-1> and for the device omamobile-sit-data recorded in /run/omamobile-sit/data-interface. test_attach_bearer.py left both at the host's ("no rmnet device exists on the host, so none is up"). On the Pixel 9a today, with the modem up, rmnet0 read 0x1091 and the recorded device was rmnet0:

ERROR: test_internet_setup_goes_ahead_beside_the_modem_owned_bearer
  File ".../lib/data_call.py", line 620, in deactivate
    raise RuntimeError('remove host data configuration first')

The change:

  • data_call.py: the two paths get names, NET and DATA_INTERFACE. Nothing else changes in the library.
  • test_attach_bearer.py and test_data_call.py point both, and in the second the modem-owned record too, at the test's own directory. The two tests that patched Path.read_text for rmnet0's flags write the file in that directory instead.
  • A new test holds the refusal itself, which had none: a device that is up, by its CID's name or by the recorded name, stops the release with nothing sent and the record kept.

Tested: packages/omamobile-modem-sit/test/all on the laptop, and on the palmtop with the modem up (the package directory copied to /tmp and the tests run as the palmtop's user, nothing installed): ok - unit tests, where main's fails as above. tools/pr-check origin/main passes.

The version is one above main's; #374's chain and others claim the same number, so it is yours to set.

…network devices

deactivate() refuses while the bearer's network device is up, and reads that from /sys/class/net and from the device omamobile-sit-data recorded in /run. The tests left both at the host's: on a build machine there is no rmnet0, but on a phone with the modem up there is, and it is up, so test_attach_bearer failed there and tools/phone-install-package could not build the package (the Pixel 9a, 2026-11-11, "remove host data configuration first").

The two paths get names in data_call (NET, DATA_INTERFACE), the tests point them and the modem-owned record at their own directory, the two tests that patched Path.read_text for rmnet0's flags write the file instead, and a new test holds the refusal itself: a device that is up, by its CID's name or by the recorded name, stops the release with nothing sent.
@derekross

Copy link
Copy Markdown
Owner

Thank you, this is a real fix and a tidy one. A test that reads the build machine's own rmnet0 is exactly the kind that passes everywhere except on the phone it matters for.

I checked three things. The library change is only two names for the two paths the function already built, with RUN bound at import before and after, so the shipped refusal reads the same files on every phone. Running the package's tests on main and on your head with a hook that logs every host path they touch, main's tests look at /sys/class/net/rmnet0/flags four times and yours at nothing under /sys or /run. And the new test bites: with the refusal removed, or with the recorded device left out of the set, it fails. I like that it also asserts nothing was sent and the record was kept. test/all with the simulator, tools/pr-check and CI are all green.

I'm merging this as 0.3.35, ahead of the others that claim that number, since they need it to build on a phone. Nothing for you to change here.

For your chain afterwards: #376, #378 and #380 will conflict with this in test_data_call.py. Their new tests can use your device() helper where they patch Path.read_text today.

One thought for later, not for this PR: data_network.INTERFACE is the same path under a second name. Importing one from the other would keep a test from patching only half of it.

@derekross
derekross merged commit 38fc39a into derekross:main Nov 12, 2026
2 checks passed
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…network devices (derekross#677)

`deactivate()` refuses while the bearer's network device is up, and reads that from `/sys/class/net` and from the device `omamobile-sit-data` recorded in `/run`. The tests left both at the host's, so on a phone with the modem up `test_attach_bearer` failed and `tools/phone-install-package` could not build the package (the Pixel 9a, 2026-11-11). The two paths get names in `data_call` (`NET`, `DATA_INTERFACE`), the tests point them at their own directory, and a new test holds the refusal itself. The library reads the same paths as before.
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