New issue
Advanced search Search tips

Issue 829612 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

cros_run_vm_test has some trouble when pushing relative paths that are above cwd

Project Member Reported by bpastene@chromium.org, Apr 5 2018

Issue description

If you run `cros_run_vm_test --files ../../some_dir/some_file.txt` it'll complain with:
"mkdir: cannot create directory '/usr/local/vm_test/../../some_dir': Read-only file system

The presence of a '--cwd' option doesn't seem to affect the failure mode.

Work-around is to simply cd into the common root dir of every file that needs pushing. But maybe this is WAI? I'm having a hard time imagining what it should do.
 
Cc: -achuith@chromium.org
Labels: OS-Chrome
Owner: achuith@chromium.org
Status: Assigned (was: Untriaged)
We should probably have a better error at least. Let me look at this.
So I think it's probably possible to fix this. In this case, we'd need to find the actual parent directory, so for 
../../some_dir/some_file.txt, it would be something like
foo/bar/some_dir/some_file.txt

and we'd have to use that as the root on the target, so on the VM, we'd have:
/usr/local/vm_test/foo/bar/some_dir/some_file.txt

Referring to some_file.txt later in --cmd also becomes tricky. Presumably you want to do something like:
cros_run_vm_test --file ../../some_dir/some_file.txt --cmd -- cat ../../some_dir/some_file.txt

I'm worried that this could end up being quite buggy and unintuitive.

I'd like to mark this as WontFix if you don't mind. 

If there's a specific case you'd like me to fix (without attempting the general solution), I can look at that.
Thanks for looking into it Achuith. Yeah, wontfix'ing seems reasonable given the complexity of supporting all the different edge-cases you pointed out, especially since just cd'ing into a common root dir works well enough.
Status: WontFix (was: Assigned)
WontFix for now. We can re-open if there's a specific use case that's worth addressing.
Project Member

Comment 5 by bugdroid1@chromium.org, May 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/b15c2c28232c383962b1b63844243a1a216bc0de

commit b15c2c28232c383962b1b63844243a1a216bc0de
Author: Achuith Bhandarkar <achuith@chromium.org>
Date: Mon May 14 03:11:51 2018

cros_run_vm_test: Fix remote directory creation.

* Don't create the remote base directory if there are no files to copy.
* Don't delete the remote base directory if we didn't create it.
* Don't cwd if there is no cwd directory.
* cwd must be either absolute or relative to CWD on the host. Do not
permit ..
* Move sanity checks for --files and --files-from to options parsing.
* Don't allow both --files and --files-from
* Fix a bug when a directory specified in --files has a trailing slash.

BUG= chromium:829612 
TEST=cros_run_vm_test --cmd -- cat /etc/lsb-release
cros_run_vm_test --cwd /etc/ --cmd -- cat lsb-release
cros_run_vm_test --cwd /etc --cmd -- cat lsb-release
and others.

Change-Id: Ib2a4b3cd9897479f1a5faf22ddeb1b15e209a36f
Reviewed-on: https://chromium-review.googlesource.com/1053420
Commit-Ready: Achuith Bhandarkar <achuith@chromium.org>
Tested-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>

[modify] https://crrev.com/b15c2c28232c383962b1b63844243a1a216bc0de/scripts/cros_run_vm_test.py

Project Member

Comment 6 by bugdroid1@chromium.org, May 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ac04371c34cbe076990b24fbba5281ca25750918

commit ac04371c34cbe076990b24fbba5281ca25750918
Author: chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com <chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Date: Mon May 14 04:23:23 2018

Roll src/third_party/chromite/ 193c9144b..b15c2c282 (1 commit)

https://chromium.googlesource.com/chromiumos/chromite.git/+log/193c9144b170..b15c2c28232c

$ git log 193c9144b..b15c2c282 --date=short --no-merges --format='%ad %ae %s'
2018-05-09 achuith cros_run_vm_test: Fix remote directory creation.

Created with:
  roll-dep src/third_party/chromite
BUG= chromium:829612 


The AutoRoll server is located here: https://chromite-chromium-roll.skia.org

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.


TBR=chrome-os-gardeners@chromium.org

Change-Id: Ic04b37f26f6554a286a21836d2f1fb5fa913fedd
Reviewed-on: https://chromium-review.googlesource.com/1056791
Commit-Queue: Chromite Chromium Autoroll <chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Reviewed-by: Chromite Chromium Autoroll <chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#558190}
[modify] https://crrev.com/ac04371c34cbe076990b24fbba5281ca25750918/DEPS

Sign in to add a comment