> On Fri, Apr 17, 2015 at 12:38:08PM +0900, YAMAMOTO Takashi wrote: >> Unfortunately ENODEV has different string representations >> among platforms. >> >> References: >> >> >> http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/errno.h?rev=1.40&content-type=text/x-cvsweb-markup&only_with_tag=MAIN >> >> https://svnweb.freebsd.org/base/head/lib/libc/gen/errlst.c?revision=275004&view=markup#l59 >> https://msdn.microsoft.com/en-us/library/5814770t.aspx >> >> Signed-off-by: YAMAMOTO Takashi <[email protected]> > > It seems likely that new platforms could have their own > representations too. I think it's safe enough here to just ignore the > error strings entirely. What do you think of this, then?
it seems better and matches existing practices. thank you. Acked-by: YAMAMOTO Takashi <[email protected]> YAMAMOTO Takashi > > --8<--------------------------cut here-------------------------->8-- > > From: Ben Pfaff <[email protected]> > Date: Mon, 20 Apr 2015 12:11:23 -0700 > Subject: [PATCH] dpctl.at: Ignore string representation of error messages in > output. > > Different C libraries represent the same error code (particularly ENODEV) > differently. This caused spurious test failures on BSD. This commit > avoids the problem by ignoring the error string representations entirely. > > Reported-by: YAMAMOTO Takashi <[email protected]> > Signed-off-by: Ben Pfaff <[email protected]> > --- > tests/dpctl.at | 23 ++++++++++++++--------- > 1 file changed, 14 insertions(+), 9 deletions(-) > > diff --git a/tests/dpctl.at b/tests/dpctl.at > index 7921d03..417682a 100644 > --- a/tests/dpctl.at > +++ b/tests/dpctl.at > @@ -8,8 +8,9 @@ AT_CHECK([ovs-appctl dpctl/add-dp dummy@br0], [2], [], > ovs-appctl: ovs-vswitchd: server returned an error > ]) > AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0]) > -AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0], [2], [], > - [ovs-vswitchd: opening datapath (No such device) > +AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0], [2], [], [stderr]) > +AT_CHECK([sed 's/(.*)/(...)/' stderr], [0], [dnl > +ovs-vswitchd: opening datapath (...) > ovs-appctl: ovs-vswitchd: server returned an error > ]) > OVS_VSWITCHD_STOP > @@ -33,7 +34,9 @@ dummy@br0: > port 5: vif1.0 (tap) > ]) > AT_CHECK([ovs-appctl dpctl/add-if dummy@br0 vif1.0,type=tap], [2], [], > - [ovs-vswitchd: adding vif1.0 to dummy@br0 failed (File exists) > + [stderr]) > +AT_CHECK([sed 's/(.*)/(...)/' stderr], [0], > + [ovs-vswitchd: adding vif1.0 to dummy@br0 failed (...) > ovs-appctl: ovs-vswitchd: server returned an error > ]) > AT_CHECK([ovs-appctl dpctl/set-if dummy@br0 vif1.0,port_no=5]) > @@ -66,15 +69,17 @@ AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 nonexistent], > [2], [], > [ovs-vswitchd: no port named nonexistent > ovs-appctl: ovs-vswitchd: server returned an error > ]) > -AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 br0], [2], [], > - [ovs-vswitchd: deleting port br0 from dummy@br0 failed (Invalid argument) > +AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 br0], [2], [], [stderr]) > +AT_CHECK([sed 's/(.*)/(...)/' stderr], [0], > + [ovs-vswitchd: deleting port br0 from dummy@br0 failed (...) > ovs-appctl: ovs-vswitchd: server returned an error > ]) > AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0]) > -AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 br0], [2], [], > - [ovs-vswitchd: opening datapath (No such device) > +AT_CHECK([ovs-appctl dpctl/del-if dummy@br0 br0], [2], [], [stderr]) > +AT_CHECK([sed 's/(.*)/(...)/' stderr], [0], > + [ovs-vswitchd: opening datapath (...) > ovs-appctl: ovs-vswitchd: server returned an error > ]) > -OVS_VSWITCHD_STOP(["/dummy@br0: port_del failed (Invalid argument)/d > -/dummy@br0: failed to add vif1.0 as port: File exists/d"]) > +OVS_VSWITCHD_STOP(["/dummy@br0: port_del failed/d > +/dummy@br0: failed to add vif1.0 as port/d"]) > AT_CLEANUP > -- > 1.7.10.4 > _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
