labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

Update protocols, make drivers follow protocols

Open Bastian-Krause opened this issue 5 years ago • 8 comments

Description Make method args of CommandProtocol, FileTransferProtocol consistent/reflect driver reality. Now let drivers implementing protocols follow them strictly.

This PR includes converting run()'s/run_check()'s codec/decodeerrors kwargs to driver attributes.

Checklist

  • [x] The arguments and description in doc/configuration.rst have been updated
  • [ ] PR has been tested (parts of it)

Bastian-Krause avatar Feb 05 '20 13:02 Bastian-Krause

Codecov Report

Merging #574 into master will increase coverage by 0.9%. The diff coverage is 73.0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #574     +/-   ##
========================================
+ Coverage    58.1%   59.1%   +0.9%     
========================================
  Files         123     123             
  Lines        8436    8658    +222     
========================================
+ Hits         4909    5117    +208     
- Misses       3527    3541     +14     
Impacted Files Coverage Δ
labgrid/driver/serialdigitaloutput.py 56.2% <33.3%> (+2.9%) :arrow_up:
labgrid/driver/smallubootdriver.py 47.2% <50.0%> (+3.1%) :arrow_up:
labgrid/driver/shelldriver.py 28.4% <54.8%> (+1.1%) :arrow_up:
labgrid/driver/commandmixin.py 60.0% <73.3%> (+1.0%) :arrow_up:
labgrid/driver/bareboxdriver.py 62.7% <100.0%> (+1.5%) :arrow_up:
labgrid/driver/sshdriver.py 72.2% <100.0%> (+0.2%) :arrow_up:
labgrid/driver/ubootdriver.py 59.3% <100.0%> (+2.2%) :arrow_up:
labgrid/protocol/commandprotocol.py 100.0% <100.0%> (ø)
labgrid/protocol/filetransferprotocol.py 100.0% <100.0%> (ø)
labgrid/util/timeout.py 100.0% <0.0%> (ø)
... and 61 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 a630074...ba68a70. Read the comment docs.

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

Force-push:

  • mentioned codec and decodeerrors in CHANGES.rst's "Breaking" section
  • make SSHDriver.run() pass timeout argument, set default timeout to 30 as specified by CommandProtocol

Bastian-Krause avatar Feb 07 '20 13:02 Bastian-Krause

Force-push:

  • rebased on current master
  • remove default timeout of CommandProtocol run() and run_check()
  • set default timeout of SSHDriver run() and run_check() to None
  • moved decodeerrors to CommandMixin

Note: the new process handling API being discussed in #552 will return bytes instead of strings. There is no need to decode for (sub)string search or regex matching when this is used.

Bastian-Krause avatar Feb 19 '20 13:02 Bastian-Krause

Force-push: rebased on master

Bastian-Krause avatar Feb 21 '20 11:02 Bastian-Krause

Rebased on current master to fix merge conflict in sshdriver.py.

Emantor avatar Mar 20 '20 06:03 Emantor

@Bastian-Krause please recheck the rebase was done correctly.

Emantor avatar Mar 20 '20 06:03 Emantor

@Emantor Rebase looks good.

Rebased it once again on current master.

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

Ping?

Bastian-Krause avatar May 19 '20 18:05 Bastian-Krause