Pierrick Bouvier <pierrick.bouv...@linaro.org> writes:

> On 8/29/24 02:03, Alex Bennée wrote:
>> Pierrick Bouvier <pierrick.bouv...@linaro.org> writes:
>> 
<snip>
>>> diff --git a/tests/tcg/multiarch/check-plugin-mem-access.sh 
>>> b/tests/tcg/multiarch/check-plugin-mem-access.sh
>>> new file mode 100755
>>> index 00000000000..909606943bb
>>> --- /dev/null
>>> +++ b/tests/tcg/multiarch/check-plugin-mem-access.sh
>>> @@ -0,0 +1,30 @@
>>> +#!/usr/bin/env bash
>>> +
>>> +set -euo pipefail
>>> +
>>> +die()
>>> +{
>>> +    echo "$@" 1>&2
>>> +    exit 1
>>> +}
>>> +
>>> +check()
>>> +{
>>> +    file=$1
>>> +    pattern=$2
>>> +    grep "$pattern" "$file" > /dev/null || die "\"$pattern\" not found in 
>>> $file"
>>> +}
>>> +
>>> +[ $# -eq 1 ] || die "usage: plugin_out_file"
>>> +
>>> +plugin_out=$1
>>> +
>>> +expected()
>>> +{
>>> +    ./test-plugin-mem-access ||
>>> +        die "running test-plugin-mem-access executable failed"
>> I'm confused by this. We seem to be running the test again and this
>> is
>> going to fail if binfmt_misc isn't setup (which we don't assume for
>> running the TCG tests).
>> 
>
> The test stdout is the expected output to grep. This is to avoid avoid
> an "expected file" and a "source file" somewhere else.

Is this really such an issue. For the system mode test I just did:

  run-plugin-memory-with-libmem.so:             \
          
CHECK_PLUGIN_OUTPUT_COMMAND=$(MULTIARCH_SYSTEM_SRC)/validate-memory-counts.py 
$@.out

> Could we use compiled qemu-user to run it instead?

Yes - although that would be inefficient (and you need to pass that path
in somehow anyway)

> I'm trying to find a solution where "expected" is not duplicated
> between several files.

Move it all into python?

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro

Reply via email to