Files
mgmt/lang/interpret_test/TestAstFunc3/send-recv-0.txtar
James Shubin 8ea7d4cf84 engine: graph, util: Restore send/recv behaviour
A regression in 4b0cdf9123 caused the
basic send/recv functionality to break for simple scenarios. This was
due to inadequate testing, and a partial misunderstanding of the
situation.

New testing should hopefully catch more cases, but send/recv and
compile-time checks are still not as complete as is probably possible.
2024-01-31 22:59:58 -05:00

32 lines
1.4 KiB
Plaintext

-- main.mcl --
exec "exec0" {
cmd => "echo this is stdout && echo this is stderr 1>&2", # to stdout && stderr
shell => "/bin/bash",
}
file ["/tmp/command-output", "/tmp/command-stdout", "/tmp/command-stderr",] {
state => $const.res.file.state.exists,
}
Exec["exec0"].stdout -> File["/tmp/command-stdout"].content
Exec["exec0"].stderr -> File["/tmp/command-stderr"].content
# XXX: The Content line can be swapped randomly, create test to allow either.
# XXX: In the meantime, we skip including it.
#Exec["exec0"].output -> File["/tmp/command-output"].content
# Field: file[/tmp/command-output].Content = "this is stdout\nthis is stderr\n"
# Field: file[/tmp/command-output].Content = "this is stderr\nthis is stdout\n"
-- OUTPUT --
Edge: exec[exec0] -> file[/tmp/command-stderr] # exec[exec0] -> file[/tmp/command-stderr]
Edge: exec[exec0] -> file[/tmp/command-stdout] # exec[exec0] -> file[/tmp/command-stdout]
Field: exec[exec0].Cmd = "echo this is stdout && echo this is stderr 1>&2"
Field: exec[exec0].Shell = "/bin/bash"
Field: file[/tmp/command-output].State = "exists"
Field: file[/tmp/command-stderr].Content = "this is stderr\n"
Field: file[/tmp/command-stderr].State = "exists"
Field: file[/tmp/command-stdout].Content = "this is stdout\n"
Field: file[/tmp/command-stdout].State = "exists"
Vertex: exec[exec0]
Vertex: file[/tmp/command-output]
Vertex: file[/tmp/command-stderr]
Vertex: file[/tmp/command-stdout]