[Fuego] [PATCH] cryptsetup: Add check for 'expect' in test_pre_check().

Tim.Bird at sony.com Tim.Bird at sony.com
Fri Oct 12 04:01:52 UTC 2018


> -----Original Message-----
> From: Wang Mingyu
> 
> Signed-off-by: Wang Mingyu <wangmy at cn.fujitsu.com>
> ---
>  engine/tests/Functional.cryptsetup/fuego_test.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/engine/tests/Functional.cryptsetup/fuego_test.sh
> b/engine/tests/Functional.cryptsetup/fuego_test.sh
> index 7354b01..fc916c4 100644
> --- a/engine/tests/Functional.cryptsetup/fuego_test.sh
> +++ b/engine/tests/Functional.cryptsetup/fuego_test.sh
> @@ -1,6 +1,8 @@
>  function test_pre_check {
>      is_on_target_path cryptsetup PROGRAM_CRYPTSETUP
>      assert_define PROGRAM_CRYPTSETUP "Missing 'cryptsetup' program on
> target board"
> +    is_on_target_path expect PROGRAM_EXPECT
> +    assert_define PROGRAM_EXPECT "Missing 'expect' program on target board"

We do this combination often enough, that I'm starting to think we
should add a core function: assert_has_program()  that would just
combine these two lines into a single function call:

Called like so:
assert_has_program expect

Would you be willing to write a patch for this, and put the new function
in fuego-core/engine/scripts/functions.sh?

This will make a lot of these test_pre_check functions more readable, I think.

Thanks,
 -- Tim

If you really want to finish up the feature, you could also add documentation
for the function on the fuegotest.org wiki.  You can copy one of the existing
function wiki pages, and put a link to the new page on:
http://fuegotest.org/wiki/Test_Script_APIs


More information about the Fuego mailing list