Skip to content

Commit 04b27e0

Browse files
authored
Merge pull request #18584 from jrose-apple/remote-run
[test] Add 'remote-run', a tool to run executable tests over SSH
2 parents 910894a + 290bf08 commit 04b27e0

20 files changed

+541
-1
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ filename = *.py,
2323
./utils/recursive-lipo,
2424
./utils/round-trip-syntax-test,
2525
./utils/rth,
26+
./utils/run-remote,
2627
./utils/run-test,
2728
./utils/scale-test,
2829
./utils/submit-benchmark-results,

docs/Testing.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ targets mentioned above and modify it as necessary. lit.py also has several
8080
useful features, like timing tests and providing a timeout. Check these features
8181
out with ``lit.py -h``. We document some of the more useful ones below:
8282

83-
##### Extra lit.py invocation options
83+
##### Standard lit.py invocation options
8484

8585
* ``-s`` reduces the amount of output that lit shows.
8686
* ``-v`` causes a test's commandline and output to be printed if the test fails.
@@ -100,6 +100,9 @@ out with ``lit.py -h``. We document some of the more useful ones below:
100100
running a single test (in seconds). 0 (the default means no time limit.
101101
* ``--max-failures=<MAXFAILURES>`` stops execution after ``MAXFAILURES`` number
102102
of failures.
103+
104+
##### Swift-specific testing options
105+
103106
* ``--param gmalloc`` will run all tests under Guard Malloc (macOS only). See
104107
``man libgmalloc`` for more information.
105108
* ``--param swift-version=<MAJOR>`` overrides the default Swift language
@@ -111,6 +114,22 @@ out with ``lit.py -h``. We document some of the more useful ones below:
111114
mentioned above. Again, it's best to get the invocation from the existing
112115
build system targets and modify it rather than constructing it yourself.
113116

117+
##### Remote testing options
118+
119+
* ``--param remote_run_host=[USER@]<HOST>[:PORT]`` causes execution tests that
120+
would normally be run on the host (via the ``%target-run`` substitutions
121+
described below) to be run over SSH on another machine instead, using the
122+
`remote-run` tool in the `utils` directory. Requires that `remote_run_tmpdir`
123+
also be provided.
124+
* ``--param remote_run_tmpdir=<PATH>`` specifies the scratch directory to be
125+
used on the remote machine when testing with `remote_run_host`.
126+
* ``--param remote_run_identity=<FILE>`` provides an SSH private key to be used
127+
when testing with `remote_run_host`. (`remote-run` does not support
128+
passwords.)
129+
* ``--param remote_run_skip_upload_stdlib`` assumes that the standard library
130+
binaries have already been uploaded to `remote_run_tmpdir` and are up to date.
131+
This is meant for repeat runs and probably shouldn't be used in automation.
132+
114133
#### CMake
115134

116135
Although it is not recommended for day-to-day contributions, it is also

test/lit.cfg

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,50 @@ ENV_VAR_PREFIXES = {
940940
'appletvsimulator': SIMULATOR_ENV_PREFIX
941941
}
942942
TARGET_ENV_PREFIX = ENV_VAR_PREFIXES.get(config.target_sdk_name, "")
943+
944+
if not config.target_run and 'remote_run_host' in lit_config.params:
945+
if 'remote_run_tmpdir' not in lit_config.params:
946+
lit_config.fatal("'remote_run_host' provided, but no "
947+
"'remote_run_tmpdir'")
948+
949+
remote_run_host = lit_config.params['remote_run_host']
950+
remote_tmp_dir = lit_config.params['remote_run_tmpdir']
951+
remote_lib_dir = os.path.join(remote_tmp_dir, 'stdlib')
952+
if 'remote_run_identity' in lit_config.params:
953+
identity_args = ['-i', lit_config.params['remote_run_identity']]
954+
else:
955+
identity_args = []
956+
957+
if 'remote_run_skip_upload_stdlib' not in lit_config.params:
958+
lit_config.note(
959+
"Uploading dylibs to {0} on {1}".format(remote_lib_dir,
960+
remote_run_host))
961+
sdk_lib_dir = os.path.join(test_resource_dir, config.target_sdk_name)
962+
glob_pattern = os.path.join(sdk_lib_dir,
963+
'*.' + config.target_dylib_extension)
964+
libs = glob.glob(glob_pattern)
965+
subprocess.check_call(
966+
[
967+
os.path.join(config.swift_utils, 'remote-run'),
968+
'--remote-dir', remote_tmp_dir,
969+
'--input-prefix', sdk_lib_dir,
970+
'--remote-input-prefix', 'stdlib/'
971+
] + identity_args + [
972+
remote_run_host,
973+
'--',
974+
'true' # A dummy command that ignores its arguments.
975+
] + libs)
976+
977+
config.target_run = (
978+
"/usr/bin/env "
979+
"REMOTE_RUN_CHILD_DYLD_FALLBACK_LIBRARY_PATH='{0}' " # Apple option
980+
"REMOTE_RUN_CHILD_LD_LIBRARY_PATH='{0}' " # Linux option
981+
"%utils/remote-run --input-prefix %S --output-prefix %t "
982+
"--remote-dir '{1}'%t {2} {3}".format(remote_lib_dir, remote_tmp_dir,
983+
' '.join(identity_args),
984+
remote_run_host))
985+
TARGET_ENV_PREFIX = 'REMOTE_RUN_CHILD_'
986+
943987
config.substitutions.append(('%env-', TARGET_ENV_PREFIX))
944988
config.substitutions.append(("%target-sdk-name", config.target_sdk_name))
945989

test/remote-run/Inputs/upload/1.txt

Whitespace-only changes.

test/remote-run/Inputs/upload/2.txt

Whitespace-only changes.

test/remote-run/Inputs/upload/BAD.txt

Whitespace-only changes.

test/remote-run/download.test-sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
RUN: %empty-directory(%t)
2+
RUN: %empty-directory(%t-REMOTE)
3+
RUN: %debug-remote-run --output-prefix %t touch %t/output
4+
RUN: ls %t/ | %FileCheck %s
5+
RUN: ls %t-REMOTE/output/ | %FileCheck %s
6+
7+
RUN: %empty-directory(%t)
8+
RUN: %empty-directory(%t/nested)
9+
RUN: %empty-directory(%t-REMOTE)
10+
RUN: %debug-remote-run --output-prefix %t touch %t/nested/output
11+
RUN: ls %t/nested/ | %FileCheck %s
12+
RUN: ls %t-REMOTE/output/nested/ | %FileCheck %s
13+
14+
CHECK: {{^output$}}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE --input-prefix %S/Inputs/ some_user@some_host ls %S/Inputs/upload/1.txt %S/Inputs/upload/2.txt 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-INPUT %s
2+
3+
CHECK-INPUT: /usr/bin/ssh -n some_user@some_host -- '/usr/bin/env' '/bin/mkdir' '-p' '{{.+}}-REMOTE/input/upload'
4+
CHECK-INPUT-NEXT: /usr/bin/sftp
5+
CHECK-INPUT-SAME: some_user@some_host
6+
CHECK-INPUT-DAG: -put '{{.+}}/Inputs/upload/1.txt' '/xyz-REMOTE/input/upload/1.txt'
7+
CHECK-INPUT-DAG: -put '{{.+}}/Inputs/upload/2.txt' '/xyz-REMOTE/input/upload/2.txt'
8+
CHECK-INPUT: /usr/bin/ssh -n some_user@some_host -- '/usr/bin/env' 'ls'
9+
10+
RUN: %empty-directory(%t)
11+
RUN: %empty-directory(%t/nested)
12+
RUN: touch %t/nested/input %t/nested/BAD
13+
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE --output-prefix %t some_user@some_host cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-OUTPUT %s
14+
15+
CHECK-OUTPUT: /usr/bin/ssh -n some_user@some_host -- '/usr/bin/env' '/bin/mkdir' '-p' '{{.+}}-REMOTE/output/nested'
16+
CHECK-OUTPUT-NEXT: /usr/bin/sftp
17+
CHECK-OUTPUT-SAME: some_user@some_host
18+
CHECK-OUTPUT-DAG: -put '{{.+}}/nested/output' '/xyz-REMOTE/output/nested/output'
19+
CHECK-OUTPUT-DAG: -put '{{.+}}/nested/input' '/xyz-REMOTE/output/nested/input'
20+
CHECK-OUTPUT: /usr/bin/ssh -n some_user@some_host -- '/usr/bin/env' 'cp'
21+
CHECK-OUTPUT-NEXT: {{^}}/bin/mkdir -p {{.+}}/nested
22+
CHECK-OUTPUT-NEXT: /usr/bin/sftp
23+
CHECK-OUTPUT-SAME: some_user@some_host
24+
CHECK-OUTPUT-DAG: -get '/xyz-REMOTE/output/nested/output' '{{.+}}/nested/output'
25+
CHECK-OUTPUT-DAG: -get '/xyz-REMOTE/output/nested/input' '{{.+}}/nested/input'

test/remote-run/dry-run.test-sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
RUN: %empty-directory(%t)
2+
RUN: %debug-remote-run -n --input-prefix %S/Inputs/ ls %S/Inputs/upload/1.txt %S/Inputs/upload/2.txt 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-INPUT %s
3+
RUN: test -z "`ls %t`"
4+
RUN: test ! -e %t-REMOTE
5+
6+
CHECK-INPUT: /usr/bin/env /bin/mkdir -p {{.+}}-REMOTE/input/upload
7+
CHECK-INPUT-NEXT: /usr/bin/sftp
8+
CHECK-INPUT-DAG: -put '{{.+}}/Inputs/upload/1.txt' '{{.+}}-REMOTE/input/upload/1.txt'
9+
CHECK-INPUT-DAG: -put '{{.+}}/Inputs/upload/2.txt' '{{.+}}-REMOTE/input/upload/2.txt'
10+
CHECK-INPUT: /usr/bin/env ls
11+
12+
RUN: %empty-directory(%t)
13+
RUN: %empty-directory(%t/nested)
14+
RUN: touch %t/nested/input %t/nested/BAD
15+
RUN: %debug-remote-run -n --output-prefix %t cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-OUTPUT %s
16+
RUN: test ! -e %t-REMOTE
17+
18+
CHECK-OUTPUT: /usr/bin/env /bin/mkdir -p {{.+}}-REMOTE/output/nested
19+
CHECK-OUTPUT-NEXT: /usr/bin/sftp
20+
CHECK-OUTPUT-DAG: -put '{{.+}}/nested/output' '{{.+}}-REMOTE/output/nested/output'
21+
CHECK-OUTPUT-DAG: -put '{{.+}}/nested/input' '{{.+}}-REMOTE/output/nested/input'
22+
CHECK-OUTPUT: /usr/bin/env cp
23+
CHECK-OUTPUT-NEXT: {{^}}/bin/mkdir -p {{.+}}/nested
24+
CHECK-OUTPUT-NEXT: /usr/bin/sftp
25+
CHECK-OUTPUT-DAG: -get '{{.+}}-REMOTE/output/nested/output' '{{.+}}/nested/output'
26+
CHECK-OUTPUT-DAG: -get '{{.+}}-REMOTE/output/nested/input' '{{.+}}/nested/input'

test/remote-run/env.test-sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
RUN: env REMOTE_RUN_CHILD_FOO=foo REMOTE_RUN_CHILD_BAR=bar %debug-remote-run sh -c 'echo ":${FOO}:" ":${BAR}:"' | %FileCheck %s
2+
RUN: env REMOTE_RUN_CHILD_FOO=foo REMOTE_RUN_CHILD_BAR=bar %debug-remote-run -v sh -c 'echo ":${FOO}:" ":${BAR}:"' 2>&1 >/dev/null | %FileCheck -check-prefix VERBOSE %s
3+
4+
CHECK: {{^:foo: :bar:$}}
5+
6+
VERBOSE: /usr/bin/env FOO=foo BAR=bar sh -c echo ":${FOO}:" ":${BAR}:"

test/remote-run/exit-code.test-sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
RUN: not %debug-remote-run false >%t.txt 2>%t.errs.txt
2+
RUN: test -f %t.txt -a ! -s %t.txt
3+
RUN: test -f %t.errs.txt -a ! -s %t.errs.txt

test/remote-run/identity.test-sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE -i spiderman --output-prefix %t some_user@some_host:12345 cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck %s
2+
3+
CHECK: /usr/bin/ssh -n
4+
CHECK-DAG: -p 12345
5+
CHECK-DAG: -i spiderman
6+
CHECK-SAME: some_user@some_host -- '/usr/bin/env' '/bin/mkdir' '-p' '{{.+}}-REMOTE/output/nested'
7+
8+
CHECK-NEXT: /usr/bin/sftp
9+
CHECK-DAG: -P 12345
10+
CHECK-DAG: -i spiderman
11+
CHECK-SAME: some_user@some_host
12+
CHECK-DAG: -put '{{.+}}/nested/output' '/xyz-REMOTE/output/nested/output'
13+
CHECK-DAG: -put '{{.+}}/nested/input' '/xyz-REMOTE/output/nested/input'
14+
15+
CHECK: /usr/bin/ssh -n
16+
CHECK-DAG: -p 12345
17+
CHECK-DAG: -i spiderman
18+
CHECK-SAME: some_user@some_host -- '/usr/bin/env' 'cp'
19+
20+
CHECK-NEXT: {{^}}/bin/mkdir -p {{.+}}/nested
21+
22+
CHECK-NEXT: /usr/bin/sftp
23+
CHECK-DAG: -P 12345
24+
CHECK-DAG: -i spiderman
25+
CHECK-SAME: some_user@some_host
26+
CHECK-DAG: -get '/xyz-REMOTE/output/nested/output' '{{.+}}/nested/output'
27+
CHECK-DAG: -get '/xyz-REMOTE/output/nested/input' '{{.+}}/nested/input'
28+
29+
# Make sure things work without a port.
30+
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE -i spiderman --output-prefix %t some_user@some_host cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-PORTLESS %s
31+
32+
CHECK-PORTLESS: /usr/bin/sftp
33+
CHECK-PORTLESS-SAME: -i spiderman
34+
CHECK-PORTLESS-SAME: some_user@some_host
35+
36+
CHECK-PORTLESS: /usr/bin/ssh -n
37+
CHECK-PORTLESS-SAME: -i spiderman
38+
CHECK-PORTLESS-SAME: some_user@some_host -- '/usr/bin/env' 'cp'

test/remote-run/lit.local.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Make a local copy of the substitutions.
2+
config.substitutions = list(config.substitutions)
3+
4+
config.substitutions.insert(0, ('%debug-remote-run',
5+
'%utils/remote-run --debug-as-local --remote-dir %t-REMOTE') )

test/remote-run/port.test-sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE --output-prefix %t some_user@some_host:12345 cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck %s
2+
3+
CHECK: /usr/bin/ssh -n -p 12345 some_user@some_host -- '/usr/bin/env' '/bin/mkdir' '-p' '{{.+}}-REMOTE/output/nested'
4+
CHECK-NEXT: /usr/bin/sftp
5+
CHECK-SAME: -P 12345
6+
CHECK-SAME: some_user@some_host
7+
CHECK-DAG: -put '{{.+}}/nested/output' '/xyz-REMOTE/output/nested/output'
8+
CHECK-DAG: -put '{{.+}}/nested/input' '/xyz-REMOTE/output/nested/input'
9+
CHECK: /usr/bin/ssh -n -p 12345 some_user@some_host -- '/usr/bin/env' 'cp'
10+
CHECK-NEXT: {{^}}/bin/mkdir -p {{.+}}/nested
11+
CHECK-NEXT: /usr/bin/sftp
12+
CHECK-SAME: -P 12345
13+
CHECK-SAME: some_user@some_host
14+
CHECK-DAG: -get '/xyz-REMOTE/output/nested/output' '{{.+}}/nested/output'
15+
CHECK-DAG: -get '/xyz-REMOTE/output/nested/input' '{{.+}}/nested/input'

test/remote-run/run-only.test-sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
RUN: %debug-remote-run echo hello | %FileCheck %s
2+
RUN: %debug-remote-run -v echo hello 2>&1 >/dev/null | %FileCheck -check-prefix VERBOSE %s
3+
4+
CHECK: {{^hello$}}
5+
6+
VERBOSE: /usr/bin/env echo hello

test/remote-run/stderr.test-sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
RUN: %debug-remote-run sh -c "echo hello; echo goodbye >&2" > %t.stdout.txt 2> %t.stderr.txt
2+
RUN: %FileCheck -check-prefix CHECK-STDOUT %s < %t.stdout.txt
3+
RUN: %FileCheck -check-prefix CHECK-STDERR %s < %t.stderr.txt
4+
5+
RUN: not %debug-remote-run sh -c "echo hello; echo goodbye >&2; false" > %t.stdout.txt 2> %t.stderr.txt
6+
RUN: %FileCheck -check-prefix CHECK-STDOUT %s < %t.stdout.txt
7+
RUN: %FileCheck -check-prefix CHECK-STDERR %s < %t.stderr.txt
8+
9+
CHECK-STDOUT-NOT: goodbye
10+
CHECK-STDOUT: {{^hello$}}
11+
CHECK-STDOUT-NOT: goodbye
12+
13+
CHECK-STDERR-NOT: hello
14+
CHECK-STDERR: {{^goodbye$}}
15+
CHECK-STDERR-NOT: hello
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
RUN: %empty-directory(%t)
2+
RUN: %empty-directory(%t-REMOTE)
3+
RUN: touch %t/input %t/BAD
4+
RUN: %debug-remote-run --output-prefix %t cp %t/input %t/output
5+
RUN: ls %t/ | %FileCheck %s
6+
RUN: ls %t-REMOTE/output/ | %FileCheck -check-prefix CHECK-REMOTE %s
7+
8+
CHECK: BAD
9+
CHECK-NEXT: {{^input$}}
10+
CHECK-NEXT: {{^output$}}
11+
12+
CHECK-REMOTE-NOT: BAD
13+
CHECK-REMOTE: {{^input$}}
14+
CHECK-REMOTE-NEXT: {{^output$}}
15+
CHECK-REMOTE-NOT: BAD
16+
17+
RUN: %empty-directory(%t)
18+
RUN: %empty-directory(%t/nested)
19+
RUN: %empty-directory(%t-REMOTE)
20+
RUN: touch %t/nested/input %t/nested/BAD
21+
RUN: %debug-remote-run --output-prefix %t cp %t/nested/input %t/nested/output
22+
RUN: ls %t/nested/ | %FileCheck %s
23+
RUN: ls %t-REMOTE/output/nested/ | %FileCheck -check-prefix CHECK-REMOTE %s
24+
25+
RUN: %debug-remote-run -v --output-prefix %t cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck -check-prefix VERBOSE %s
26+
27+
VERBOSE: /usr/bin/env /bin/mkdir -p {{.+}}-REMOTE/output/nested
28+
VERBOSE-NEXT: /usr/bin/sftp
29+
VERBOSE-DAG: -put '{{.+}}/nested/output' '{{.+}}-REMOTE/output/nested/output'
30+
VERBOSE-DAG: -put '{{.+}}/nested/input' '{{.+}}-REMOTE/output/nested/input'
31+
VERBOSE: /usr/bin/env cp
32+
VERBOSE-NEXT: {{^}}/bin/mkdir -p {{.+}}/nested
33+
VERBOSE-NEXT: /usr/bin/sftp
34+
VERBOSE-DAG: -get '{{.+}}-REMOTE/output/nested/output' '{{.+}}/nested/output'
35+
VERBOSE-DAG: -get '{{.+}}-REMOTE/output/nested/input' '{{.+}}/nested/input'
36+
37+
RUN: %empty-directory(%t)
38+
RUN: touch %t/xyz-1before
39+
RUN: %debug-remote-run --output-prefix %t/xyz cp %t/xyz-1before %t/xyz-2after
40+
RUN: ls %t | %FileCheck -check-prefix CHECK-PREFIXED %s
41+
RUN: ls %t-REMOTE/ | %FileCheck -check-prefix CHECK-PREFIXED-REMOTE %s
42+
43+
CHECK-PREFIXED: {{^xyz-1before$}}
44+
CHECK-PREFIXED: {{^xyz-2after$}}
45+
46+
CHECK-PREFIXED-REMOTE: {{^output-1before$}}
47+
CHECK-PREFIXED-REMOTE: {{^output-2after$}}
48+
49+
RUN: %empty-directory(%t)
50+
RUN: %empty-directory(%t-REMOTE)
51+
RUN: touch %t/input %t/BAD
52+
RUN: %debug-remote-run --output-prefix %t --remote-output-prefix custom-output cp %t/input %t/output
53+
RUN: ls %t/ | %FileCheck %s
54+
RUN: ls %t-REMOTE/custom-output/ | %FileCheck -check-prefix CHECK-REMOTE %s

test/remote-run/upload-stderr.test-sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
RUN: %empty-directory(%t)
2+
RUN: %empty-directory(%t/REMOTE/input)
3+
RUN: chmod a-w %t/REMOTE/input
4+
RUN: %debug-remote-run --remote-dir %t/REMOTE --input-prefix %S/Inputs/upload/ true -- %S/Inputs/upload/1.txt 2>&1 | %FileCheck %s
5+
6+
CHECK: Permission denied

test/remote-run/upload.test-sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
RUN: %debug-remote-run --input-prefix %S/Inputs/upload/ ls %S/Inputs/upload/1.txt %S/Inputs/upload/2.txt | %FileCheck -check-prefix CHECK-REMOTE %s
2+
RUN: ls %t-REMOTE/input/ | %FileCheck %s
3+
4+
RUN: %empty-directory(%t-REMOTE)
5+
RUN: %debug-remote-run --input-prefix %S/Inputs/ ls %S/Inputs/upload/1.txt %S/Inputs/upload/2.txt | %FileCheck -check-prefix CHECK-REMOTE-NESTED %s
6+
RUN: ls %t-REMOTE/input/upload/ | %FileCheck %s
7+
RUN: %debug-remote-run -v --input-prefix %S/Inputs/ ls %S/Inputs/upload/1.txt %S/Inputs/upload/2.txt 2>&1 >/dev/null | %FileCheck -check-prefix VERBOSE-NESTED %s
8+
9+
RUN: %empty-directory(%t-REMOTE)
10+
RUN: %debug-remote-run --input-prefix %S/Inputs/upload/1 ls %S/Inputs/upload/1.txt | %FileCheck -check-prefix CHECK-REMOTE-SINGLE-FILE %s
11+
RUN: test -f %t-REMOTE/input.txt
12+
13+
RUN: %empty-directory(%t-REMOTE)
14+
RUN: %debug-remote-run --input-prefix %S/Inputs/upload/ --remote-input-prefix custom-input ls %S/Inputs/upload/1.txt %S/Inputs/upload/2.txt | %FileCheck -check-prefix CHECK-REMOTE-CUSTOM %s
15+
RUN: ls %t-REMOTE/custom-input/ | %FileCheck %s
16+
17+
CHECK-REMOTE: {{-REMOTE/input/1.txt$}}
18+
CHECK-REMOTE-NEXT: {{-REMOTE/input/2.txt$}}
19+
20+
CHECK-REMOTE-NESTED: {{-REMOTE/input/upload/1.txt$}}
21+
CHECK-REMOTE-NESTED-NEXT: {{-REMOTE/input/upload/2.txt$}}
22+
23+
CHECK-REMOTE-SINGLE-FILE: {{-REMOTE/input.txt$}}
24+
25+
CHECK-REMOTE-CUSTOM: {{-REMOTE/custom-input/1.txt$}}
26+
CHECK-REMOTE-CUSTOM-NEXT: {{-REMOTE/custom-input/2.txt$}}
27+
28+
CHECK-NOT: BAD
29+
CHECK: {{^1.txt$}}
30+
CHECK-NEXT: {{^2.txt$}}
31+
CHECK-NOT: BAD
32+
33+
VERBOSE-NESTED: /usr/bin/env /bin/mkdir -p {{.+}}-REMOTE/input/upload
34+
VERBOSE-NESTED-NEXT: /usr/bin/sftp
35+
VERBOSE-NESTED-DAG: -put '{{.+}}/Inputs/upload/1.txt' '{{.+}}-REMOTE/input/upload/1.txt'
36+
VERBOSE-NESTED-DAG: -put '{{.+}}/Inputs/upload/2.txt' '{{.+}}-REMOTE/input/upload/2.txt'
37+
VERBOSE-NESTED: /usr/bin/env ls

0 commit comments

Comments
 (0)