labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

Add copy-files client command

Open sephalon opened this issue 5 years ago • 14 comments

Description

Adds a copy-files client command to copy files onto mass storage. In our workflow, we often need to update individual boot files (i.e. BOOT.BIN and image.ub on Xilinx SoC devices), but not the whole partition or device image. The user interface tries to reproduce the semantics of the UNIX cp command as much as possible.

As of now, we can only copy individual files, but not recursively on directories; in the future we might want to extend the ManagedFile class to support this use case as well.

Tested with an USB-SD-Mux on Ubuntu 18.04 LTS with pmount installed.

Checklist

  • [x] Documentation for the feature
  • [ ] Tests for the feature
  • [x] The arguments and description in doc/configuration.rst have been updated
  • [x] CHANGES.rst has been updated
  • [x] PR has been tested
  • [x] Man pages have been regenerated

sephalon avatar Dec 20 '19 16:12 sephalon

Codecov Report

Merging #548 (49017b6) into master (41b297f) will increase coverage by 1.5%. The diff coverage is 25.0%.

:exclamation: Current head 49017b6 differs from pull request most recent head 9d18be3. Consider uploading reports for the commit 9d18be3 to get more accurate results Impacted file tree graph

@@           Coverage Diff            @@
##           master    #548     +/-   ##
========================================
+ Coverage    56.8%   58.4%   +1.5%     
========================================
  Files         144     133     -11     
  Lines       10669    9554   -1115     
========================================
- Hits         6064    5580    -484     
+ Misses       4605    3974    -631     
Impacted Files Coverage Δ
labgrid/remote/client.py 46.8% <24.2%> (+2.1%) :arrow_up:
labgrid/driver/usbstoragedriver.py 36.8% <25.4%> (-4.1%) :arrow_down:
labgrid/util/helper.py 62.6% <0.0%> (-13.2%) :arrow_down:
labgrid/driver/openocddriver.py 35.8% <0.0%> (-4.8%) :arrow_down:
labgrid/driver/sshdriver.py 54.5% <0.0%> (-3.8%) :arrow_down:
labgrid/resource/common.py 85.5% <0.0%> (-2.9%) :arrow_down:
labgrid/driver/power/digipower.py 20.0% <0.0%> (-2.3%) :arrow_down:
labgrid/driver/ubootdriver.py 59.7% <0.0%> (-1.3%) :arrow_down:
labgrid/util/agentwrapper.py 96.5% <0.0%> (-1.2%) :arrow_down:
... and 42 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 41b297f...9d18be3. Read the comment docs.

codecov[bot] avatar Feb 13 '20 08:02 codecov[bot]

All comments should have been addressed now; please rereview.

sephalon avatar Feb 21 '20 10:02 sephalon

I actually used YAPF to reformat the code at some point, but now I realized that the line length limit is not set in setup.cfg (defaults to PEP8 then). Is the YAPF configuration abandoned?

sephalon avatar Feb 21 '20 10:02 sephalon

I actually used YAPF to reformat the code at some point, but now I realized that the line length limit is not set in setup.cfg (defaults to PEP8 then). Is the YAPF configuration abandoned?

Looks like it. I think the .pylintrc is more relevant.

Bastian-Krause avatar Mar 03 '20 14:03 Bastian-Krause

Thanks, fixup looks good to me. Should I squash now or are you doing that?

sephalon avatar Mar 13 '20 11:03 sephalon

I squashed the fixup. I tested this and stumbled upon more bugs. I pushed the fixes as fixups. Please have a look one more time.

Bastian-Krause avatar Mar 25 '20 10:03 Bastian-Krause

LGTM, please squash.

sephalon avatar Mar 27 '20 16:03 sephalon

Squashed commits, rebased on current master.

@sephalon Please have another look.

Bastian-Krause avatar Apr 06 '20 10:04 Bastian-Krause

LGTM, please merge.

sephalon avatar Apr 06 '20 10:04 sephalon

This needs a rebase for CHANGES.rst.

Emantor avatar Apr 01 '21 07:04 Emantor

Done, rebased.

sephalon avatar Apr 01 '21 09:04 sephalon

Rebased once again.

sephalon avatar Aug 25 '21 06:08 sephalon

The only thing I don't like about this PR is the reliance on pmount instead of a standard DBUS interface like udisks2. There is also #820 now, so you may be able to collaborate on this.

Emantor avatar Sep 15 '21 14:09 Emantor

Do you want us to continue on this PR or do you prefer the #820 and we shall not spend any time in this PR as it will not be accepted anyways? Any opinions here? If it makes sense to continue we are happy to do so!

sessl3r avatar Nov 05 '21 16:11 sessl3r

Closing this, I will open a new issue with the relevant information.

Emantor avatar Jan 25 '23 09:01 Emantor