This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 6582ff6158b7e8380536f83da9b0fc25659e3c36 (commit) via fe280bface8fd28a8d0baa3ca95a71f221187fe8 (commit) via bd5112acbb750723958463cf0328ebb15855f7ab (commit) from 06b3650b581bf05ea2f015a02635382fb7c38fda (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 6582ff6158b7e8380536f83da9b0fc25659e3c36 Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Thu May 31 19:01:26 2018 +0300
test: remove bash wrapper around tm validation test
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org
diff --git a/test/validation/api/Makefile.am b/test/validation/api/Makefile.am index c92d123c..92ae85f8 100644 --- a/test/validation/api/Makefile.am +++ b/test/validation/api/Makefile.am @@ -58,7 +58,7 @@ TESTS = \ thread/thread_main$(EXEEXT) \ time/time_main$(EXEEXT) \ timer/timer_main$(EXEEXT) \ - traffic_mngr/traffic_mngr.sh \ + traffic_mngr/traffic_mngr_main$(EXEEXT) \ shmem/shmem_main$(EXEEXT) \ system/system_main$(EXEEXT)
diff --git a/test/validation/api/traffic_mngr/Makefile.am b/test/validation/api/traffic_mngr/Makefile.am index a9b8550d..53a00f5e 100644 --- a/test/validation/api/traffic_mngr/Makefile.am +++ b/test/validation/api/traffic_mngr/Makefile.am @@ -1,10 +1,5 @@ include ../Makefile.inc
-TESTS_ENVIRONMENT += TEST_DIR=${builddir} - test_PROGRAMS = traffic_mngr_main traffic_mngr_main_SOURCES = traffic_mngr.c LDADD += -lm - -dist_check_SCRIPTS = traffic_mngr.sh -test_SCRIPTS = $(dist_check_SCRIPTS) diff --git a/test/validation/api/traffic_mngr/traffic_mngr.sh b/test/validation/api/traffic_mngr/traffic_mngr.sh deleted file mode 100755 index c8f8d95a..00000000 --- a/test/validation/api/traffic_mngr/traffic_mngr.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017-2018, Linaro Limited -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -# directories where traffic_mngr_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 -# -in the validation when running standalone (./traffic_mngr) intree. -# -in the current directory. -# running stand alone out of tree requires setting PATH -PATH=${TEST_DIR}/api/traffic_mngr:$PATH -PATH=$(dirname $0)/../../../../validation/api/traffic_mngr:$PATH -PATH=$(dirname $0):$PATH -PATH=`pwd`:$PATH - -traffic_mngr_main_path=$(which traffic_mngr_main${EXEEXT}) -if [ -x "$traffic_mngr_main_path" ] ; then - echo "running with traffic_mngr_main: $traffic_mngr_run_path" -else - echo "cannot find traffic_mngr_main: please set you PATH for it." - exit 1 -fi - -# exit codes expected by automake for skipped tests -TEST_SKIPPED=77 - -traffic_mngr_main${EXEEXT} -ret=$? - -if [ "${CI}" = "true" ] && [ $ret -eq 255 ]; then - echo "SKIP: skip due to not isolated environment" - exit ${TEST_SKIPPED} -fi - -exit $ret
commit fe280bface8fd28a8d0baa3ca95a71f221187fe8 Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Wed May 30 00:04:04 2018 +0300
test: tm: allow some tests to be skipped under CI
that is temporary patch until we fix CUNIT to be able to skip tests.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org
diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c index e16c3400..4d78c31c 100644 --- a/test/validation/api/traffic_mngr/traffic_mngr.c +++ b/test/validation/api/traffic_mngr/traffic_mngr.c @@ -3896,6 +3896,14 @@ static void traffic_mngr_test_byte_wred(void) static void traffic_mngr_test_pkt_wred(void) { int rc; + const char *env = getenv("CI"); + int allow_skip_result = 0; + + if (env && !strcmp(env, "true")) { + allow_skip_result = 1; + LOG_DBG("\nWARNING: test result can be used for code coverage only.\n" + "CI=true env variable is set!\n"); + }
if (!tm_capabilities.tm_queue_wred_supported) { LOG_DBG("\ntest_pkt_wred was not run because tm_capabilities " @@ -3903,9 +3911,11 @@ static void traffic_mngr_test_pkt_wred(void) return; }
- CU_ASSERT(test_pkt_wred("pkt_wred_40G", "pkt_bw_40G", - "pkt_thresh_40G", "node_1_3_2", 1, - ODP_PACKET_GREEN, TM_PERCENT(30), false) == 0); + rc = test_pkt_wred("pkt_wred_40G", "pkt_bw_40G", + "pkt_thresh_40G", "node_1_3_2", 1, + ODP_PACKET_GREEN, TM_PERCENT(30), false); + if (rc != 0 && !allow_skip_result) + CU_FAIL("40G test failed\n");
if (!tm_capabilities.tm_queue_dual_slope_supported) { LOG_DBG("since tm_capabilities indicates no dual slope " @@ -3916,14 +3926,21 @@ static void traffic_mngr_test_pkt_wred(void) rc = test_pkt_wred("pkt_wred_30G", "pkt_bw_30G", "pkt_thresh_30G", "node_1_3_2", 1, ODP_PACKET_GREEN, TM_PERCENT(30), true); - CU_ASSERT(rc == 0); + if (rc != 0 && !allow_skip_result) + CU_FAIL("30G test failed\n"); + + rc = test_pkt_wred("pkt_wred_50Y", "pkt_bw_50Y", + "pkt_thresh_50Y", "node_1_3_2", 2, + ODP_PACKET_YELLOW, TM_PERCENT(50), true); + if (rc != 0 && !allow_skip_result) + CU_FAIL("50Y test failed\n"); +
- CU_ASSERT(test_pkt_wred("pkt_wred_50Y", "pkt_bw_50Y", - "pkt_thresh_50Y", "node_1_3_2", 2, - ODP_PACKET_YELLOW, TM_PERCENT(50), true) == 0); - CU_ASSERT(test_pkt_wred("pkt_wred_70R", "pkt_bw_70R", - "pkt_thresh_70R", "node_1_3_2", 3, - ODP_PACKET_RED, TM_PERCENT(70), true) == 0); + rc = test_pkt_wred("pkt_wred_70R", "pkt_bw_70R", + "pkt_thresh_70R", "node_1_3_2", 3, + ODP_PACKET_RED, TM_PERCENT(70), true); + if (rc != 0 && !allow_skip_result) + CU_FAIL("70Y test failed\n"); }
static void traffic_mngr_test_query(void)
commit bd5112acbb750723958463cf0328ebb15855f7ab Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Tue May 29 23:39:18 2018 +0300
linux-gen: test: tm: respect return codes
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org
diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index bf12a836..abd9cffc 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -626,8 +626,8 @@ static void tm_sched_config_set(tm_shaper_obj_t *shaper_obj, }
/* Any locking required and validity checks must be done by the caller! */ -static void tm_threshold_config_set(tm_wred_node_t *wred_node, - odp_tm_threshold_t thresholds_profile) +static int tm_threshold_config_set(tm_wred_node_t *wred_node, + odp_tm_threshold_t thresholds_profile) { tm_queue_thresholds_t *threshold_params;
@@ -637,15 +637,18 @@ static void tm_threshold_config_set(tm_wred_node_t *wred_node, }
if (thresholds_profile == ODP_TM_INVALID) - return; + return 0;
threshold_params = tm_get_profile_params(thresholds_profile, TM_THRESHOLD_PROFILE); - if (threshold_params == NULL) - return; + if (threshold_params == NULL) { + ODP_DBG("threshold_params is NULL\n"); + return -1; + }
threshold_params->ref_cnt++; wred_node->threshold_params = threshold_params; + return 0; }
/* Any locking required and validity checks must be done by the caller! */ @@ -4091,15 +4094,17 @@ int odp_tm_queue_threshold_config(odp_tm_queue_t tm_queue, odp_tm_threshold_t thresholds_profile) { tm_queue_obj_t *tm_queue_obj; + int ret;
tm_queue_obj = GET_TM_QUEUE_OBJ(tm_queue); if (!tm_queue_obj) return -1;
odp_ticketlock_lock(&tm_profile_lock); - tm_threshold_config_set(tm_queue_obj->tm_wred_node, thresholds_profile); + ret = tm_threshold_config_set(tm_queue_obj->tm_wred_node, + thresholds_profile); odp_ticketlock_unlock(&tm_profile_lock); - return 0; + return ret; }
int odp_tm_queue_wred_config(odp_tm_queue_t tm_queue, diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c index 700b14fd..e16c3400 100644 --- a/test/validation/api/traffic_mngr/traffic_mngr.c +++ b/test/validation/api/traffic_mngr/traffic_mngr.c @@ -2891,16 +2891,21 @@ static int set_queue_thresholds(odp_tm_queue_t tm_queue, odp_tm_threshold_params_t *threshold_params) { odp_tm_threshold_t threshold_profile; + int ret;
/* First see if a threshold profile already exists with this name, in * which case we use that profile, else create a new one. */ threshold_profile = odp_tm_thresholds_lookup(threshold_name); if (threshold_profile != ODP_TM_INVALID) { - odp_tm_thresholds_params_update(threshold_profile, - threshold_params); + ret = odp_tm_thresholds_params_update(threshold_profile, + threshold_params); + if (ret) + return ret; } else { threshold_profile = odp_tm_threshold_create(threshold_name, threshold_params); + if (threshold_profile == ODP_TM_INVALID) + return -1; threshold_profiles[num_threshold_profiles] = threshold_profile; num_threshold_profiles++; } @@ -3138,6 +3143,7 @@ static int test_pkt_wred(const char *wred_name, odp_tm_queue_t tm_queue; pkt_info_t pkt_info; uint32_t num_fill_pkts, num_test_pkts, pkts_sent; + int ret;
/* Pick the tm_queue and set the tm_queue's wred profile to drop the * given percentage of traffic, then send 100 pkts and see how many @@ -3154,8 +3160,10 @@ static int test_pkt_wred(const char *wred_name, odp_tm_threshold_params_init(&threshold_params); threshold_params.max_pkts = 1000; threshold_params.enable_max_pkts = true; - if (set_queue_thresholds(tm_queue, threshold_name, - &threshold_params) != 0) { + + ret = set_queue_thresholds(tm_queue, threshold_name, + &threshold_params); + if (ret) { LOG_ERR("set_queue_thresholds failed\n"); return -1; } @@ -3185,8 +3193,12 @@ static int test_pkt_wred(const char *wred_name,
/* Disable the shaper, so as to get the pkts out quicker. */ set_shaper(node_name, shaper_name, 0, 0); - num_rcv_pkts = receive_pkts(odp_tm_systems[0], rcv_pktin, - num_fill_pkts + pkts_sent, 64 * 1000); + ret = receive_pkts(odp_tm_systems[0], rcv_pktin, + num_fill_pkts + pkts_sent, 64 * 1000); + if (ret < 0) + return -1; + + num_rcv_pkts = ret;
/* Search the EXPECTED_PKT_RCVD table to find a matching entry */ wred_pkt_cnts = search_expected_pkt_rcv_tbl(TM_PERCENT(99.9), @@ -3197,12 +3209,15 @@ static int test_pkt_wred(const char *wred_name, flush_leftover_pkts(odp_tm_systems[0], rcv_pktin); CU_ASSERT(odp_tm_is_idle(odp_tm_systems[0]));
- if ((wred_pkt_cnts->min_cnt <= pkts_sent) && - (pkts_sent <= wred_pkt_cnts->max_cnt)) - return 0; + if ((pkts_sent < wred_pkt_cnts->min_cnt) || + (pkts_sent > wred_pkt_cnts->max_cnt)) { + LOG_ERR("min_cnt %d <= pkts_sent %d <= max_cnt %d\n", + wred_pkt_cnts->min_cnt, + pkts_sent, + wred_pkt_cnts->max_cnt); + return -1; + }
- CU_ASSERT((wred_pkt_cnts->min_cnt <= pkts_sent) && - (pkts_sent <= wred_pkt_cnts->max_cnt)); return 0; }
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/odp_traffic_mngr.c | 19 +++--- test/validation/api/Makefile.am | 2 +- test/validation/api/traffic_mngr/Makefile.am | 5 -- test/validation/api/traffic_mngr/traffic_mngr.c | 74 +++++++++++++++++------- test/validation/api/traffic_mngr/traffic_mngr.sh | 39 ------------- 5 files changed, 66 insertions(+), 73 deletions(-) delete mode 100755 test/validation/api/traffic_mngr/traffic_mngr.sh
hooks/post-receive