[v6,3/3] app/test: fix return value of test_kni_link_change

Message ID 20210830142731.32524-3-iryzhov@nfware.com (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers
Series [v6,1/3] kni: rework rte_kni_update_link using ioctl |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Performance fail Performance Testing issues
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-unit-testing fail Testing issues
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Igor Ryzhov Aug. 30, 2021, 2:27 p.m. UTC
  If the child process returns -1, WEXITSTATUS converts to 255 because it
takes only 8 least significant bits. As a result, the test is not
considered failed when it should.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
---
 app/test/test_kni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index 0df028696f36..70c81f4af0f4 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -214,7 +214,7 @@  test_kni_link_change(void)
 			p_ret = waitpid(pid, &status, WNOHANG);
 			if (p_ret != 0) {
 				if (WIFEXITED(status))
-					return WEXITSTATUS(status);
+					return WEXITSTATUS(status) ? -1 : 0;
 				return -1;
 			}
 			rte_delay_ms(10);