diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-11-27 17:23:09 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-12-11 15:22:17 +0000 |
| commit | 299ee674e6c124a35f1cf258df4f0f3c6e1db1f3 (patch) | |
| tree | 416b515e959a1d0a64a9516b1524a062ae63ba7d /pkg/runtest | |
| parent | ff949d2512c5ac33d0407d26d80f1df77b2de0e7 (diff) | |
executor: query globs in the test program context
We query globs for 2 reasons:
1. Expand glob types in syscall descriptions.
2. Dynamic file probing for automatic descriptions generation.
In both of these contexts are are interested in files
that will be present during test program execution
(rather than normal unsandboxed execution).
For example, some files may not be accessible to test programs
after pivot root. On the other hand, we create and link
some additional files for the test program that don't
normally exist.
Add a new request type for querying of globs that are
executed in the test program context.
Diffstat (limited to 'pkg/runtest')
| -rw-r--r-- | pkg/runtest/run.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go index ca3ed3b4b..d9f0aa25a 100644 --- a/pkg/runtest/run.go +++ b/pkg/runtest/run.go @@ -113,7 +113,7 @@ func (ctx *Context) Run(waitCtx context.Context) error { if !verbose || ctx.Verbose { ctx.log("%-38v: %v", req.name, result) } - if req.Request != nil && req.Request.BinaryFile != "" { + if req.Request != nil && req.Type == flatrpc.RequestTypeBinary && req.BinaryFile != "" { os.Remove(req.BinaryFile) } } @@ -400,6 +400,7 @@ func (ctx *Context) createTest(req *runRequest) { req.Request.Done(&queue.Result{}) return } + req.Type = flatrpc.RequestTypeBinary req.BinaryFile = bin ctx.submit(req) }() @@ -493,7 +494,7 @@ func checkResult(req *runRequest) error { return fmt.Errorf("non-successful result status (%v)", req.result.Status) } infos := []*flatrpc.ProgInfo{req.result.Info} - isC := req.BinaryFile != "" + isC := req.Type == flatrpc.RequestTypeBinary if isC { var err error if infos, err = parseBinOutput(req); err != nil { |
