Index: client/tests/run_isolated_test.py |
diff --git a/client/tests/run_isolated_test.py b/client/tests/run_isolated_test.py |
index d34e8aafaaff16a5ee25f0c708f05f87f7ef1ce5..aa05fb5d0c1dc35aa1a6a9431f29d6b01809f9e5 100755 |
--- a/client/tests/run_isolated_test.py |
+++ b/client/tests/run_isolated_test.py |
@@ -775,10 +775,20 @@ class RunIsolatedTestOutputFiles(RunIsolatedTestBase): |
# back after the task completed. |
server = isolateserver_mock.MockIsolateServer() |
try: |
+ # Output two files. If we're on Linux, we'll try to make one of them a |
+ # symlink to ensure that we correctly follow symlinks. Note that this only |
+ # tests file symlinks, not directory symlinks. |
+ # TODO(aludwin): follow directory symlinks |
script = ( |
'import sys\n' |
+ 'import os\n' |
M-A Ruel
2017/06/09 20:16:22
OMG it's not sorted.
aludwin
2017/06/12 12:59:11
Done.
|
'open(sys.argv[1], "w").write("bar")\n' |
- 'open(sys.argv[2], "w").write("baz")\n') |
+ 'if sys.platform.startswith("linux"):\n' |
+ ' realpath = os.path.join(os.getcwd(), "contents_of_symlink")\n' |
M-A Ruel
2017/06/09 20:16:22
realpath = os.path.abspath("contents_of_symlink")
aludwin
2017/06/12 12:59:11
Fixed. Because "sys.argv[2]" can be in another dir
|
+ ' open(realpath, "w").write("baz")\n' |
+ ' os.symlink(realpath, sys.argv[2])\n' |
+ 'else:\n' |
+ ' open(sys.argv[2], "w").write("baz")\n') |
script_hash = isolateserver_mock.hash_content(script) |
isolated['files']['cmd.py'] = { |
'h': script_hash, |