labgrid-project / labgrid-project/labgrid

AndroidFastboot: discrepancy between relative and absolute paths

Open
#433 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
528
Forks
278
Avg merge
2d 19h
Merged PRs (30d)
4

Description

Initial situation

I got 2 systems: client and exporter, client has labgrid-client running and exporter, labgrid-exporter. I am in directory /build, which on client is a symlink to local file system /mnt/something, which is also exported via NFS. On exporter, /build is a symlink to that NFS share.

Steps to reproduce

Fastboot upload with absolute path works as expected:

$ labgrid-client -d -v fastboot flash rootfs $PWD/rootfs.img

DEBUG: Sending command: ['ssh', '-x', '-o', 'LogLevel=ERROR', '-o', 'PasswordAuthentication=no', '-o', 'ControlMaster=no', '-o', 'ControlPath=/tmp/labgrid-connection-xxxxx/control-exporter', 'exporter', "stat --format 'inode=%i,size=%s,birth=%W,modified=%Y' /build/rootfs.img"]

ManagedFile applies its heuristic and detects that both files are the same, so it foregoes a rsync from client to exporter.

While using a relative path doesn't:

$ labgrid-client fastboot flash rootfs ./rootfs.img

DEBUG: Sending command: ['ssh', '-x', '-o', 'LogLevel=ERROR', '-o', 'PasswordAuthentication=no', '-o', 'ControlMaster=no', '-o', 'ControlPath=/tmp/labgrid-connection-xxxxx/control-exporter', 'exporter', "stat --format 'inode=%i,size=%s,birth=%W,modified=%Y' /mnt/something/rootfs.img"]
DEBUG: remote: stat: unsuccessful error code 1

Here labgrid does a rsync between the systems.

Expected Behavior

Whether a relative or absolute path is used shouldn't change the behavior if both refer to the same file. They both should result in stat suceeding and no rsync.

I assume there's an erroneous path canonization somewhere.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the AndroidFastboot and ManagedFile path-handling entry points, then reproduce the absolute and relative fastboot flash commands from the issue. Compare the paths used for remote stat; done means both forms identify the same file and avoid an unnecessary rsync.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.