helper/bwrap: check args only for internal tests

Tests internal to the helper package sets crash-test-dummy as the command whenever a launch is expected to go through, and the hardcoded args are only valid for internal tests, so this characteristic is used here to exclude external tests that pass real program names and custom bwrap configurations.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
Ophestra Umiker 2024-10-09 00:21:31 +09:00
parent 7c7999e9e5
commit c201c30c7f
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ func bwrapStub(argsFD, statFD *int) {
panic("cannot read want: " + err.Error()) panic("cannot read want: " + err.Error())
} }
if got.String() != want.String() { if len(flag.CommandLine.Args()) > 0 && flag.CommandLine.Args()[0] == "crash-test-dummy" && got.String() != want.String() {
panic("bad bwrap args\ngot: " + got.String() + "\nwant: " + want.String()) panic("bad bwrap args\ngot: " + got.String() + "\nwant: " + want.String())
} }
}() }()