snapd icon indicating copy to clipboard operation
snapd copied to clipboard

snapdtool: update command line when re-executing

Open valentindavid opened this issue 1 year ago • 7 comments

Snap re-execution looked confusing since it did not update cmdline in /proc. That means ps, top, systemd-cgls showed /usr/lib/snapd/snapd as running when the binary comes from the snap.

valentindavid avatar Dec 04 '24 16:12 valentindavid

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 0.00%. Comparing base (d6d95f0) to head (396e498). Report is 67 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #14795       +/-   ##
===========================================
- Coverage   78.09%        0   -78.10%     
===========================================
  Files        1190        0     -1190     
  Lines      158458        0   -158458     
===========================================
- Hits       123746        0   -123746     
+ Misses      27017        0    -27017     
+ Partials     7695        0     -7695     
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Dec 04 '24 16:12 codecov[bot]

There could be some refinement to do here. For example if argv[0] is just a name without /, meaning it was found from PATH, we do not really have to change argv[0]. So for example calling in the command line snap install steam for example, we should not really need to change snap to the full path, because that would not confuse users if it is actually executing another snap than the one in path.

valentindavid avatar Dec 05 '24 12:12 valentindavid

Ah, we cannot really test it, since SNAPD_DEB_FROM_REPO is used during the preparation for the first test that run on that machine.

valentindavid avatar Dec 05 '24 16:12 valentindavid

I have removed the spread test, since it is not really testable.

valentindavid avatar Jan 13 '25 12:01 valentindavid

That seems to break running apps through symlinks... Maybe we should pass the origin path through environment?

valentindavid avatar Jan 14 '25 10:01 valentindavid

Mon Mar 31 09:03:19 UTC 2025 The following results are from: https://github.com/canonical/snapd/actions/runs/14109922153

Failures:

Executing:

  • openstack:debian-sid-64:tests/main/progress
  • google:ubuntu-25.04-64:tests/main/microk8s-smoke:edge
  • google:ubuntu-22.04-64:tests/main/progress
  • google:ubuntu-18.04-64:tests/main/preseed-lxd

github-actions[bot] avatar Jan 14 '25 13:01 github-actions[bot]

@bboozzoo I re-re-request a review, because I had to add conditions on when we rewrite the command line.

valentindavid avatar Jan 15 '25 14:01 valentindavid