@@ -6,6 +6,15 @@
# SPDX-License-Identifier: BSD-3-Clause
#
+# Proceed the pktio tests. This script expects at least one argument:
+# setup) setup the pktio test environment
+# cleanup) cleanup the pktio test environment
+# run) run the pktio tests (setup, run, cleanup)
+# extra arguments are passed unchanged to the test itself (pktio_main)
+# Without arguments, "run" is assumed and no extra argument is passed to the
+# test (legacy mode).
+#
+
# directories where pktio_main binary can be found:
# -in the validation dir when running make check (intree or out of tree)
# -in the script directory, when running after 'make install', or
@@ -59,7 +68,7 @@ run_test()
if [ "$disabletype" != "SKIP" ]; then
export ODP_PKTIO_DISABLE_SOCKET_${distype}=y
fi
- pktio_main${EXEEXT}
+ pktio_main${EXEEXT} $*
if [ $? -ne 0 ]; then
ret=1
fi
@@ -75,7 +84,7 @@ run_test()
run()
{
echo "pktio: using 'loop' device"
- pktio_main${EXEEXT}
+ pktio_main${EXEEXT} $*
loop_ret=$?
# need to be root to run tests with real interfaces
@@ -103,8 +112,14 @@ run()
exit $ret
}
-case "$1" in
+if [ $# != 0 ]; then
+ action=$1
+ shift
+fi
+
+case "$action" in
setup) setup_pktio_env ;;
cleanup) cleanup_pktio_env ;;
+ run) run ;;
*) run ;;
esac
@@ -6,6 +6,15 @@
# SPDX-License-Identifier: BSD-3-Clause
#
+# Proceed the pktio tests. This script expects at least one argument:
+# setup) setup the pktio test environment
+# cleanup) cleanup the pktio test environment
+# run) run the pktio tests (setup, run, cleanup)
+# extra arguments are passed unchanged to the test itself (pktio_main)
+# Without arguments, "run" is assumed and no extra argument is passed to the
+# test (legacy mode).
+#
+
# directories where pktio_main binary can be found:
# -in the validation dir when running make check (intree or out of tree)
# -in the script directory, when running after 'make install', or
@@ -46,7 +55,7 @@ run_test()
{
local ret=0
- pktio_main${EXEEXT}
+ pktio_main${EXEEXT} $*
ret=$?
if [ $ret -ne 0 ]; then
echo "!!! FAILED !!!"
@@ -73,8 +82,14 @@ run()
run_test
}
+if [ $# != 0 ]; then
+ action=$1
+ shift
+fi
+
case "$1" in
setup) setup_pktio_env ;;
cleanup) cleanup_pktio_env ;;
+ run) run ;;
*) run ;;
esac
@@ -6,6 +6,9 @@
# SPDX-License-Identifier: BSD-3-Clause
#
+# any parameter passed as arguments to this script is passed unchanged to
+# the test itself (pktio_main)
+
# directories where pktio_main binary can be found:
# -in the validation dir when running make check (intree or out of tree)
# -in the script directory, when running after 'make install', or
@@ -45,7 +48,7 @@ run_test()
{
local ret=0
- pktio_main${EXEEXT}
+ pktio_main${EXEEXT} $*
ret=$?
if [ $ret -ne 0 ]; then
@@ -6,6 +6,9 @@
# SPDX-License-Identifier: BSD-3-Clause
#
+# any parameter passed as arguments to this script is passed unchanged to
+# the test itself (pktio_main)
+
# directories where pktio_main binary can be found:
# -in the validation dir when running make check (intree or out of tree)
# -in the script directory, when running after 'make install', or
@@ -27,7 +30,7 @@ fi
PCAP_FNAME=vald.pcap
export ODP_PKTIO_IF0="pcap:out=${PCAP_FNAME}"
export ODP_PKTIO_IF1="pcap:in=${PCAP_FNAME}"
-pktio_main${EXEEXT}
+pktio_main${EXEEXT} $*
ret=$?
rm -f ${PCAP_FNAME}
exit $ret
@@ -6,6 +6,10 @@
# SPDX-License-Identifier: BSD-3-Clause
#
+
+# any parameter passed as arguments to this script is passed unchanged to
+# the test itself (pktio_main)
+
# directories where pktio_main binary can be found:
# -in the validation dir when running make check (intree or out of tree)
# -in the script directory, when running after 'make install', or
@@ -109,7 +113,7 @@ if [ $ret -ne 0 ]; then
fi
# Using ODP_WAIT_FOR_NETWORK to prevent fail if tap still not enabled in bridge
-ODP_WAIT_FOR_NETWORK=yes pktio_main${EXEEXT}
+ODP_WAIT_FOR_NETWORK=yes pktio_main${EXEEXT} $*
ret=$?
exit $ret
@@ -2140,9 +2140,15 @@ odp_suiteinfo_t pktio_suites[] = {
ODP_SUITE_INFO_NULL
};
-int pktio_main(void)
+int pktio_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(pktio_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(pktio_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -59,6 +59,6 @@ int pktio_suite_init_unsegmented(void);
extern odp_suiteinfo_t pktio_suites[];
/* main test program: */
-int pktio_main(void);
+int pktio_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "pktio.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return pktio_main();
+ return pktio_main(argc, argv);
}
As the test itself does not have specific args, it just calls the cunit_common parsing function to pick up cunit_common and helpers arguments. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- platform/linux-generic/test/pktio/pktio_run.sh | 21 ++++++++++++++++++--- platform/linux-generic/test/pktio/pktio_run_dpdk.sh | 17 ++++++++++++++++- .../linux-generic/test/pktio/pktio_run_netmap.sh | 5 ++++- platform/linux-generic/test/pktio/pktio_run_pcap.sh | 5 ++++- platform/linux-generic/test/pktio/pktio_run_tap.sh | 6 +++++- test/validation/pktio/pktio.c | 10 ++++++++-- test/validation/pktio/pktio.h | 2 +- test/validation/pktio/pktio_main.c | 4 ++-- 8 files changed, 58 insertions(+), 12 deletions(-)