[ovs-dev] [PATCH v2] ovn-nbctl test: Add different search string for getopt BSD variant

Alin Gabriel Serdean aserdean at ovn.org
Thu Aug 16 16:31:39 UTC 2018


2714. ovn-nbctl.at:1443: testing ovn-nbctl - commands parser error paths

fails due to:
ovn-nbctl.at:1443: ovn-nbctl --if-exists=foo list Logical_Switch
stderr:
ovn-nbctl: option '--if-exists=foo' requires an argument
./ovn-nbctl.at:1443: grep 'option .* doesn'\''t allow an argument' stderr
stdout:
./ovn-nbctl.at:1443: exit code was 1, expected 0

This is due to the difference between getopt BSD and GNU variant.

Signed-off-by: Alin Gabriel Serdean <aserdean at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>
---
v2: Change grep to egrep and drop the '\|' as suggested by Ben
---
 tests/ovn-nbctl.at | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
index 725665b76..a599b1bf7 100644
--- a/tests/ovn-nbctl.at
+++ b/tests/ovn-nbctl.at
@@ -1484,7 +1484,7 @@ AT_CHECK([grep 'missing argument to .* option' stderr], [0], [ignore])
 
 dnl Unexpected option argument
 AT_CHECK([ovn-nbctl --if-exists=foo list Logical_Switch], [1], [], [stderr])
-AT_CHECK([grep 'option .* doesn'\''t allow an argument' stderr], [0], [ignore])
+AT_CHECK([egrep 'option .* doesn'\''t allow an argument|option .* requires an argument' stderr], [0], [ignore])
 
 AT_CHECK([ovn-nbctl -- --if-exists=foo list Logical_Switch], [1], [], [stderr])
 AT_CHECK([grep 'option on .* does not accept an argument' stderr], [0], [ignore])
-- 
2.16.1.windows.1



More information about the dev mailing list