Skip to content

util/managedfile: ensure directory containing symlink exists for sync_to_resource() - #1662

Open
rvdgracht wants to merge 1 commit into
labgrid-project:masterfrom
rvdgracht:master
Open

util/managedfile: ensure directory containing symlink exists for sync_to_resource()#1662
rvdgracht wants to merge 1 commit into
labgrid-project:masterfrom
rvdgracht:master

Conversation

@rvdgracht

@rvdgracht rvdgracht commented Jun 4, 2025

Copy link
Copy Markdown
Contributor

When the internal dir contains a subdir that does not yet exist (i.e. '/srv/tftp/board-23/') the symlink creation will fail.

@Emantor
Emantor requested a review from Bastian-Krause June 4, 2025 08:36
@Bastian-Krause

Copy link
Copy Markdown
Member

I think until now we simply expected the provider's internal directory to exist. I'm not sure if we should change that. @jluebbe @Emantor What do you think?

@codecov

codecov Bot commented Jun 4, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.0%. Comparing base (97e7cea) to head (5f2ed41).
⚠️ Report is 40 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1662     +/-   ##
========================================
- Coverage    61.0%   61.0%   -0.1%     
========================================
  Files         182     182             
  Lines       14874   14901     +27     
========================================
+ Hits         9083    9098     +15     
- Misses       5791    5803     +12     
Flag Coverage Δ
3.10 61.0% <100.0%> (-0.1%) ⬇️
3.11 61.0% <100.0%> (-0.1%) ⬇️
3.12 61.0% <100.0%> (-0.1%) ⬇️
3.13 61.0% <100.0%> (-0.1%) ⬇️
3.14 60.9% <100.0%> (-0.1%) ⬇️

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

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

@Bastian-Krause Bastian-Krause added the needs rebase Needs a rebase onto the master branch, maintainter could probably not push to submitter branch. label Jul 4, 2025
@Bastian-Krause Bastian-Krause self-assigned this Jul 7, 2026
@Bastian-Krause
Bastian-Krause force-pushed the master branch 2 times, most recently from da22369 to a46186f Compare July 8, 2026 10:27
@Bastian-Krause Bastian-Krause changed the title TFTPProviderDriver/HTTPProviderDriver should create symlinks when staging files for local TFTPProvider/HTTPProvider util/managedfile: ensure directory containing symlink exists for sync_to_resource() Jul 8, 2026
@Bastian-Krause Bastian-Krause added enhancement and removed fix needs rebase Needs a rebase onto the master branch, maintainter could probably not push to submitter branch. labels Jul 8, 2026
@Bastian-Krause

Copy link
Copy Markdown
Member

After looking at this again, I think this makes sense. I've rebased this and added the local use case.

@Bastian-Krause
Bastian-Krause requested review from Emantor and removed request for Bastian-Krause July 8, 2026 10:33
…_to_resource()

When the internal dir contains a subdir that does not yet exist
(i.e. '/srv/tftp/board-23/') the symlink creation fails. Try to create
the necessary directories.

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
[bst: added local mkdir path, adjusted commit message]
Signed-off-by: Bastian Krause <bst@pengutronix.de>
@Bastian-Krause

Copy link
Copy Markdown
Member

@Emantor Could you take a look at this?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants