[ovs-dev] [PATCH] tests: Skip OVN test if truncate command not found

Mark Michelson mmichels at redhat.com
Mon Sep 11 19:59:24 UTC 2017


On Mon, Sep 11, 2017 at 2:37 PM Alin Gabriel Serdean <aserdean at ovn.org>
wrote:

> Test: "testing ovn -- ensure one gw controller restart in HA doesn't
> bounce the master" uses the command `truncate`.
>
> Skip the test if the command is not found.
>
>
The use of the truncate command here is to make the file 0 bytes. Rather
than skipping the test if the truncate command is not present, the test
could be altered to make the file 0 bytes in some other way.

# dd if=/dev/null of=gw1/ovn-controller.log
# > gw1-controller.log
# rm gw1-controller.log && touch gw1/ovn-controller.log

Are potential ways of expressing the same thing without needing to use
truncate.


> Signed-off-by: Alin Gabriel Serdean <aserdean at ovn.org>
> ---
>  tests/ovn.at | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/ovn.at b/tests/ovn.at
> index f203529..4563964 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -8432,6 +8432,7 @@ AT_CLEANUP
>
>  AT_SETUP([ovn -- ensure one gw controller restart in HA doesn't bounce
> the master])
>  AT_SKIP_IF([test $HAVE_PYTHON = no])
> +AT_SKIP_IF([!(test -x "$(command -v truncate)")])
>  ovn_start
>
>  net_add n1
> --
> 2.10.2.windows.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>


More information about the dev mailing list