mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fixing checkSentryExec to account for symlinks as the test runs locally.
Updates #4805 PiperOrigin-RevId: 487374028
This commit is contained in:
committed by
gVisor bot
parent
e038ca2a1c
commit
68c47a2f88
@@ -324,13 +324,15 @@ func checkSentryExec(msg test.Message) error {
|
||||
if err := checkContextData(p.ContextData); err != nil {
|
||||
return err
|
||||
}
|
||||
if want := "/bin/true"; want != p.BinaryPath {
|
||||
// As test runs locally the binary path may resolve to a symlink so would not be exactly same
|
||||
// as the pathname passed.
|
||||
if want := "/bin/true"; !strings.Contains(p.BinaryPath, want) {
|
||||
return fmt.Errorf("wrong BinaryPath, want: %q, got: %q", want, p.BinaryPath)
|
||||
}
|
||||
if len(p.Argv) == 0 {
|
||||
return fmt.Errorf("empty Argv")
|
||||
}
|
||||
if p.Argv[0] != p.BinaryPath {
|
||||
if !strings.Contains(p.BinaryPath, p.Argv[0]) {
|
||||
return fmt.Errorf("wrong Argv[0], want: %q, got: %q", p.BinaryPath, p.Argv[0])
|
||||
}
|
||||
if len(p.Env) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user