Re: [ovs-dev] [PATCH] tests: Skip tests that need "normal" diff if not available.
On Tue, Apr 03, 2018 at 03:12:40PM +0300, aserd...@ovn.org wrote: > > -Mesaj original- > > De la: ovs-dev-boun...@openvswitch.org > boun...@openvswitch.org> În numele Ben Pfaff > > Trimis: Monday, April 2, 2018 8:15 PM > > Către: d...@openvswitch.org > > Cc: Ben Pfaff ; Stuart Cardall > > Subiect: [ovs-dev] [PATCH] tests: Skip tests that need "normal" diff if > not > > available. > > > > busybox diff does not support "normal" diff format, only the unified > format. > > A few OVS tests rely on "normal" format, so those would fail. > > This commit avoids the problem by skipping tests that require "normal" > > format if it is not available. > > > > Reported-by: Stuart Cardall > > Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018- > > March/046460.html > > Signed-off-by: Ben Pfaff > > --- > > tests/atlocal.in | 10 ++ > > tests/ovsdb-server.at | 5 + > > 2 files changed, 15 insertions(+) > > > > diff --git a/tests/atlocal.in b/tests/atlocal.in index > > 55f9333eee08..2721a588cb90 100644 > > --- a/tests/atlocal.in > > +++ b/tests/atlocal.in > > @@ -170,6 +170,16 @@ find_command tcpdump > > > > CURL_OPT="-g -v --max-time 1 --retry 2 --retry-delay 1 --connect-timeout > 1" > > > > +# Determine whether "diff" supports "normal" diffs. (busybox diff does > > +not.) diff () { > > +busybox diff "$@" > > +} > > +if echo xyzzy | diff /dev/null - | grep '^>' >/dev/null; then > > +DIFF_SUPPORTS_NORMAL_FORMAT=yes > > +else > > +DIFF_SUPPORTS_NORMAL_FORMAT=no > > +fi > > + > > # Turn off proxies. > > unset http_proxy > > unset https_proxy > > diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index > > 2781a14004eb..cbbccab5e5db 100644 > > --- a/tests/ovsdb-server.at > > +++ b/tests/ovsdb-server.at > > @@ -1455,6 +1455,7 @@ AT_BANNER([OVSDB -- ovsdb-server replication > > table-exclusion]) m4_define([OVSDB_CHECK_REPLICATION], > > [AT_SETUP([$1]) > > AT_KEYWORDS([ovsdb server tcp replication table-exclusion]) > > + AT_SKIP_IF([test $DIFF_SUPPORTS_NORMAL_FORMAT = no]) > > $2 > schema > > AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore]) > > AT_CHECK([ovsdb-tool create db2 schema], [0], [stdout], [ignore]) @@ - > > 1532,6 +1533,8 @@ AT_CLEANUP #ovsdb-server/set-sync-exclude-tables > > command > > AT_SETUP([ovsdb-server/set-sync-exclude-tables]) > > AT_KEYWORDS([ovsdb server replication set-exclude-tables]) > > +AT_SKIP_IF([test $DIFF_SUPPORTS_NORMAL_FORMAT = no]) > > + > > replication_schema > schema > > AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore]) > > AT_CHECK([ovsdb-tool create db2 schema], [0], [stdout], [ignore]) @@ - > > 1619,6 +1622,8 @@ AT_CLEANUP #ovsdb-server/disconnect-active-server > > command > > AT_SETUP([ovsdb-server/disconnect-active-server]) > > AT_KEYWORDS([ovsdb server replication disconnect-active-server]) > > +AT_SKIP_IF([test $DIFF_SUPPORTS_NORMAL_FORMAT = no]) > > + > > replication_schema > schema > > AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore]) > > AT_CHECK([ovsdb-tool create db2 schema], [0], [stdout], [ignore]) > > -- > > 2.16.1 > > > Acked-by: Alin Gabriel Serdean Thanks, applied. (I removed the testing code that forced busybox diff, which I forgot to remove before posting. Oops.) ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] tests: Skip tests that need "normal" diff if not available.
> -Mesaj original- > De la: ovs-dev-boun...@openvswitch.org boun...@openvswitch.org> În numele Ben Pfaff > Trimis: Monday, April 2, 2018 8:15 PM > Către: d...@openvswitch.org > Cc: Ben Pfaff ; Stuart Cardall > Subiect: [ovs-dev] [PATCH] tests: Skip tests that need "normal" diff if not > available. > > busybox diff does not support "normal" diff format, only the unified format. > A few OVS tests rely on "normal" format, so those would fail. > This commit avoids the problem by skipping tests that require "normal" > format if it is not available. > > Reported-by: Stuart Cardall > Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018- > March/046460.html > Signed-off-by: Ben Pfaff > --- > tests/atlocal.in | 10 ++ > tests/ovsdb-server.at | 5 + > 2 files changed, 15 insertions(+) > > diff --git a/tests/atlocal.in b/tests/atlocal.in index > 55f9333eee08..2721a588cb90 100644 > --- a/tests/atlocal.in > +++ b/tests/atlocal.in > @@ -170,6 +170,16 @@ find_command tcpdump > > CURL_OPT="-g -v --max-time 1 --retry 2 --retry-delay 1 --connect-timeout 1" > > +# Determine whether "diff" supports "normal" diffs. (busybox diff does > +not.) diff () { > +busybox diff "$@" > +} > +if echo xyzzy | diff /dev/null - | grep '^>' >/dev/null; then > +DIFF_SUPPORTS_NORMAL_FORMAT=yes > +else > +DIFF_SUPPORTS_NORMAL_FORMAT=no > +fi > + > # Turn off proxies. > unset http_proxy > unset https_proxy > diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index > 2781a14004eb..cbbccab5e5db 100644 > --- a/tests/ovsdb-server.at > +++ b/tests/ovsdb-server.at > @@ -1455,6 +1455,7 @@ AT_BANNER([OVSDB -- ovsdb-server replication > table-exclusion]) m4_define([OVSDB_CHECK_REPLICATION], > [AT_SETUP([$1]) > AT_KEYWORDS([ovsdb server tcp replication table-exclusion]) > + AT_SKIP_IF([test $DIFF_SUPPORTS_NORMAL_FORMAT = no]) > $2 > schema > AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore]) > AT_CHECK([ovsdb-tool create db2 schema], [0], [stdout], [ignore]) @@ - > 1532,6 +1533,8 @@ AT_CLEANUP #ovsdb-server/set-sync-exclude-tables > command > AT_SETUP([ovsdb-server/set-sync-exclude-tables]) > AT_KEYWORDS([ovsdb server replication set-exclude-tables]) > +AT_SKIP_IF([test $DIFF_SUPPORTS_NORMAL_FORMAT = no]) > + > replication_schema > schema > AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore]) > AT_CHECK([ovsdb-tool create db2 schema], [0], [stdout], [ignore]) @@ - > 1619,6 +1622,8 @@ AT_CLEANUP #ovsdb-server/disconnect-active-server > command > AT_SETUP([ovsdb-server/disconnect-active-server]) > AT_KEYWORDS([ovsdb server replication disconnect-active-server]) > +AT_SKIP_IF([test $DIFF_SUPPORTS_NORMAL_FORMAT = no]) > + > replication_schema > schema > AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore]) > AT_CHECK([ovsdb-tool create db2 schema], [0], [stdout], [ignore]) > -- > 2.16.1 > Acked-by: Alin Gabriel Serdean ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH] tests: Skip tests that need "normal" diff if not available.
busybox diff does not support "normal" diff format, only the unified format. A few OVS tests rely on "normal" format, so those would fail. This commit avoids the problem by skipping tests that require "normal" format if it is not available. Reported-by: Stuart Cardall Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-March/046460.html Signed-off-by: Ben Pfaff --- tests/atlocal.in | 10 ++ tests/ovsdb-server.at | 5 + 2 files changed, 15 insertions(+) diff --git a/tests/atlocal.in b/tests/atlocal.in index 55f9333eee08..2721a588cb90 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -170,6 +170,16 @@ find_command tcpdump CURL_OPT="-g -v --max-time 1 --retry 2 --retry-delay 1 --connect-timeout 1" +# Determine whether "diff" supports "normal" diffs. (busybox diff does not.) +diff () { +busybox diff "$@" +} +if echo xyzzy | diff /dev/null - | grep '^>' >/dev/null; then +DIFF_SUPPORTS_NORMAL_FORMAT=yes +else +DIFF_SUPPORTS_NORMAL_FORMAT=no +fi + # Turn off proxies. unset http_proxy unset https_proxy diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index 2781a14004eb..cbbccab5e5db 100644 --- a/tests/ovsdb-server.at +++ b/tests/ovsdb-server.at @@ -1455,6 +1455,7 @@ AT_BANNER([OVSDB -- ovsdb-server replication table-exclusion]) m4_define([OVSDB_CHECK_REPLICATION], [AT_SETUP([$1]) AT_KEYWORDS([ovsdb server tcp replication table-exclusion]) + AT_SKIP_IF([test $DIFF_SUPPORTS_NORMAL_FORMAT = no]) $2 > schema AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore]) AT_CHECK([ovsdb-tool create db2 schema], [0], [stdout], [ignore]) @@ -1532,6 +1533,8 @@ AT_CLEANUP #ovsdb-server/set-sync-exclude-tables command AT_SETUP([ovsdb-server/set-sync-exclude-tables]) AT_KEYWORDS([ovsdb server replication set-exclude-tables]) +AT_SKIP_IF([test $DIFF_SUPPORTS_NORMAL_FORMAT = no]) + replication_schema > schema AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore]) AT_CHECK([ovsdb-tool create db2 schema], [0], [stdout], [ignore]) @@ -1619,6 +1622,8 @@ AT_CLEANUP #ovsdb-server/disconnect-active-server command AT_SETUP([ovsdb-server/disconnect-active-server]) AT_KEYWORDS([ovsdb server replication disconnect-active-server]) +AT_SKIP_IF([test $DIFF_SUPPORTS_NORMAL_FORMAT = no]) + replication_schema > schema AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore]) AT_CHECK([ovsdb-tool create db2 schema], [0], [stdout], [ignore]) -- 2.16.1 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev