test: fix terminal settings on exit
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 14 Jan 2021 16:45:37 +0000 (08:45 -0800)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 17 Jan 2021 17:51:13 +0000 (18:51 +0100)
commitacdabc450ea087815f8d93cf139ac265c638f99f
treeab0e075f2763e71dea5b1350d2a947780b6123c7
parent14df4f2987fd9de51a026f2bbc94fbb7a7a1379a
test: fix terminal settings on exit

When running one test (via DPDK_TEST) the test program
would leave the terminal in raw mode.  This was because
it was setting up cmdline to do interactive input.

The fix is to use cmdline_new() for the interactive case.

This also fixes a memory leak because the test
runner was never calling cmdline_free().

Fixes: 9b848774a5dc ("test: use env variable to run tests")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
app/test/test.c