get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1204/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1204,
    "url": "https://patches.dpdk.org/api/patches/1204/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415362978-6306-9-git-send-email-declan.doherty@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1415362978-6306-9-git-send-email-declan.doherty@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415362978-6306-9-git-send-email-declan.doherty@intel.com",
    "date": "2014-11-07T12:22:58",
    "name": "[dpdk-dev,v6,8/8] bond: unit test test macro refactor",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "915abf66f8ad5379780f7606658be574f7397037",
    "submitter": {
        "id": 11,
        "url": "https://patches.dpdk.org/api/people/11/?format=api",
        "name": "Doherty, Declan",
        "email": "declan.doherty@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415362978-6306-9-git-send-email-declan.doherty@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1204/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1204/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 9FA457FA8;\n\tFri,  7 Nov 2014 13:14:11 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 2600A7F51\n\tfor <dev@dpdk.org>; Fri,  7 Nov 2014 13:13:49 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP; 07 Nov 2014 04:23:19 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby FMSMGA003.fm.intel.com with ESMTP; 07 Nov 2014 04:14:39 -0800",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tsA7CNGej002858; Fri, 7 Nov 2014 12:23:16 GMT",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id sA7CNFNq007670;\n\tFri, 7 Nov 2014 12:23:15 GMT",
            "(from dwdohert@localhost)\n\tby sivswdev02.ir.intel.com with  id sA7CNFB9007666;\n\tFri, 7 Nov 2014 12:23:15 GMT"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"4.97,862,1389772800\"; d=\"scan'208\";a=\"412976565\"",
        "From": "Declan Doherty <declan.doherty@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri,  7 Nov 2014 12:22:58 +0000",
        "Message-Id": "<1415362978-6306-9-git-send-email-declan.doherty@intel.com>",
        "X-Mailer": "git-send-email 1.7.12.2",
        "In-Reply-To": "<1415362978-6306-1-git-send-email-declan.doherty@intel.com>",
        "References": "<1413291597-27326-1-git-send-email-declan.doherty@intel.com>\n\t<1415362978-6306-1-git-send-email-declan.doherty@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6 8/8] bond: unit test test macro refactor",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Signed-off-by: Declan Doherty <declan.doherty@intel.com>\n---\n app/test/test_link_bonding.c | 2574 +++++++++++++++++-------------------------\n 1 file changed, 1036 insertions(+), 1538 deletions(-)",
    "diff": "diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c\nindex 4aa57a7..aa6a52f 100644\n--- a/app/test/test_link_bonding.c\n+++ b/app/test/test_link_bonding.c\n@@ -31,6 +31,7 @@\n  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n  */\n \n+#include \"unistd.h\"\n #include <string.h>\n #include <stdarg.h>\n #include <stdio.h>\n@@ -265,7 +266,7 @@ static pthread_cond_t cvar = PTHREAD_COND_INITIALIZER;\n static int\n test_setup(void)\n {\n-\tint i, retval, nb_mbuf_per_pool;\n+\tint i, nb_mbuf_per_pool;\n \tstruct ether_addr *mac_addr = (struct ether_addr *)slave_mac;\n \n \t/* Allocate ethernet packet header with space for VLAN header */\n@@ -273,10 +274,8 @@ test_setup(void)\n \t\ttest_params->pkt_eth_hdr = malloc(sizeof(struct ether_hdr) +\n \t\t\t\tsizeof(struct vlan_hdr));\n \n-\t\tif (test_params->pkt_eth_hdr == NULL) {\n-\t\t\tprintf(\"ethernet header struct allocation failed!\\n\");\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_NOT_NULL(test_params->pkt_eth_hdr,\n+\t\t\t\t\"Ethernet header struct allocation failed!\");\n \t}\n \n \tnb_mbuf_per_pool = RTE_TEST_RX_DESC_MAX + DEF_PKT_BURST +\n@@ -286,10 +285,8 @@ test_setup(void)\n \t\t\t\tMBUF_SIZE, MBUF_CACHE_SIZE, sizeof(struct rte_pktmbuf_pool_private),\n \t\t\t\trte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,\n \t\t\t\trte_socket_id(), 0);\n-\t\tif (test_params->mbuf_pool == NULL) {\n-\t\t\tprintf(\"rte_mempool_create failed\\n\");\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_NOT_NULL(test_params->mbuf_pool,\n+\t\t\t\t\"rte_mempool_create failed\");\n \t}\n \n \t/* Create / Initialize virtual eth devs */\n@@ -303,20 +300,12 @@ test_setup(void)\n \n \t\t\ttest_params->slave_port_ids[i] = virtual_ethdev_create(pmd_name,\n \t\t\t\t\tmac_addr, rte_socket_id(), 1);\n-\t\t\tif (test_params->slave_port_ids[i] < 0) {\n-\t\t\t\tprintf(\"Failed to create virtual virtual ethdev %s\\n\", pmd_name);\n-\t\t\t\treturn -1;\n-\t\t\t}\n+\t\t\tTEST_ASSERT(test_params->slave_port_ids[i] >= 0,\n+\t\t\t\t\t\"Failed to create virtual virtual ethdev %s\", pmd_name);\n \n-\t\t\tprintf(\"Created virtual ethdev %s\\n\", pmd_name);\n-\n-\t\t\tretval = configure_ethdev(test_params->slave_port_ids[i], 1, 0);\n-\t\t\tif (retval != 0) {\n-\t\t\t\tprintf(\"Failed to configure virtual ethdev %s\\n\", pmd_name);\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\n-\t\t\tprintf(\"Configured virtual ethdev %s\\n\", pmd_name);\n+\t\t\tTEST_ASSERT_SUCCESS(configure_ethdev(\n+\t\t\t\t\ttest_params->slave_port_ids[i], 1, 0),\n+\t\t\t\t\t\"Failed to configure virtual ethdev %s\", pmd_name);\n \t\t}\n \t\tslaves_initialized = 1;\n \t}\n@@ -350,14 +339,14 @@ test_create_bonded_device(void)\n \tcurrent_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,\n \t\t\tslaves, RTE_MAX_ETHPORTS);\n \n-\tTEST_ASSERT(current_slave_count == 0,\n+\tTEST_ASSERT_EQUAL(current_slave_count, 0,\n \t\t\t\"Number of slaves %d is great than expected %d.\",\n \t\t\tcurrent_slave_count, 0);\n \n \tcurrent_slave_count = rte_eth_bond_active_slaves_get(\n \t\t\ttest_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS);\n \n-\tTEST_ASSERT(current_slave_count == 0,\n+\tTEST_ASSERT_EQUAL(current_slave_count, 0,\n \t\t\t\"Number of active slaves %d is great than expected %d.\",\n \t\t\tcurrent_slave_count, 0);\n \n@@ -375,30 +364,21 @@ test_create_bonded_device_with_invalid_params(void)\n \t/* Invalid name */\n \tport_id = rte_eth_bond_create(NULL, test_params->bonding_mode,\n \t\t\trte_socket_id());\n-\tif (port_id >= 0) {\n-\t\tprintf(\"Created bonded device unexpectedly.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(port_id < 0, \"Created bonded device unexpectedly\");\n \n \ttest_params->bonding_mode = INVALID_BONDING_MODE;\n \n \t/* Invalid bonding mode */\n \tport_id = rte_eth_bond_create(BONDED_DEV_NAME, test_params->bonding_mode,\n \t\t\trte_socket_id());\n-\tif (port_id >= 0) {\n-\t\tprintf(\"Created bonded device unexpectedly.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(port_id < 0, \"Created bonded device unexpectedly.\");\n \n \ttest_params->bonding_mode = BONDING_MODE_ROUND_ROBIN;\n \n \t/* Invalid socket id */\n \tport_id = rte_eth_bond_create(BONDED_DEV_NAME, test_params->bonding_mode,\n \t\t\tINVALID_SOCKET_ID);\n-\tif (port_id >= 0) {\n-\t\tprintf(\"Created bonded device unexpectedly.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(port_id < 0, \"Created bonded device unexpectedly.\");\n \n \treturn 0;\n }\n@@ -436,23 +416,15 @@ test_add_slave_to_bonded_device(void)\n static int\n test_add_slave_to_invalid_bonded_device(void)\n {\n-\tint retval;\n-\n \t/* Invalid port ID */\n-\tretval = rte_eth_bond_slave_add(test_params->bonded_port_id + 5,\n-\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count]);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as invalid port specified.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_slave_add(test_params->bonded_port_id + 5,\n+\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count]),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n \t/* Non bonded device */\n-\tretval = rte_eth_bond_slave_add(test_params->slave_port_ids[0],\n-\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count]);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as invalid port specified.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_slave_add(test_params->slave_port_ids[0],\n+\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count]),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n \treturn 0;\n }\n@@ -504,23 +476,17 @@ test_remove_slave_from_bonded_device(void)\n static int\n test_remove_slave_from_invalid_bonded_device(void)\n {\n-\tint retval;\n-\n \t/* Invalid port ID */\n-\tretval = rte_eth_bond_slave_remove(test_params->bonded_port_id + 5,\n-\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count - 1]);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as invalid port specified.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_slave_remove(\n+\t\t\ttest_params->bonded_port_id + 5,\n+\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count - 1]),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n \t/* Non bonded device */\n-\tretval = rte_eth_bond_slave_remove(test_params->slave_port_ids[0],\n-\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count - 1]);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as invalid port specified.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_slave_remove(\n+\t\t\ttest_params->slave_port_ids[0],\n+\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count - 1]),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n \treturn 0;\n }\n@@ -530,7 +496,7 @@ static int bonded_id = 2;\n static int\n test_add_already_bonded_slave_to_bonded_device(void)\n {\n-\tint retval, port_id, current_slave_count;\n+\tint port_id, current_slave_count;\n \tuint8_t slaves[RTE_MAX_ETHPORTS];\n \tchar pmd_name[RTE_ETH_NAME_MAX_LEN];\n \n@@ -538,29 +504,22 @@ test_add_already_bonded_slave_to_bonded_device(void)\n \n \tcurrent_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,\n \t\t\tslaves, RTE_MAX_ETHPORTS);\n-\tif (current_slave_count != 1) {\n-\t\tprintf(\"Number of slaves (%d) is not that expected (%d).\\n\",\n-\t\t\t\tcurrent_slave_count, 1);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(current_slave_count, 1,\n+\t\t\t\"Number of slaves (%d) is not that expected (%d).\",\n+\t\t\tcurrent_slave_count, 1);\n \n \tsnprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, \"%s_%d\", BONDED_DEV_NAME, ++bonded_id);\n \n \tport_id = rte_eth_bond_create(pmd_name, test_params->bonding_mode,\n \t\t\trte_socket_id());\n-\tif (port_id < 0) {\n-\t\tprintf(\"Failed to create bonded device.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(port_id >= 0, \"Failed to create bonded device.\");\n \n-\tretval = rte_eth_bond_slave_add(port_id,\n-\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count - 1]);\n-\tif (retval == 0) {\n-\t\tprintf(\"Added slave (%d) to bonded port (%d) unexpectedly.\\n\",\n-\t\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count-1],\n-\t\t\t\tport_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(rte_eth_bond_slave_add(port_id,\n+\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count - 1])\n+\t\t\t< 0,\n+\t\t\t\"Added slave (%d) to bonded port (%d) unexpectedly.\",\n+\t\t\ttest_params->slave_port_ids[test_params->bonded_slave_count-1],\n+\t\t\tport_id);\n \n \treturn test_remove_slave_from_bonded_device();\n }\n@@ -569,50 +528,47 @@ test_add_already_bonded_slave_to_bonded_device(void)\n static int\n test_get_slaves_from_bonded_device(void)\n {\n-\tint retval, current_slave_count;\n-\n+\tint current_slave_count;\n \tuint8_t slaves[RTE_MAX_ETHPORTS];\n \n-\tretval = test_add_slave_to_bonded_device();\n-\tif (retval != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),\n+\t\t\t\"Failed to add slave to bonded device\");\n \n \t/* Invalid port id */\n \tcurrent_slave_count = rte_eth_bond_slaves_get(INVALID_PORT_ID, slaves,\n \t\t\tRTE_MAX_ETHPORTS);\n-\tif (current_slave_count >= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT(current_slave_count < 0,\n+\t\t\t\"Invalid port id unexpectedly succeeded\");\n \n \tcurrent_slave_count = rte_eth_bond_active_slaves_get(INVALID_PORT_ID,\n \t\t\tslaves, RTE_MAX_ETHPORTS);\n-\tif (current_slave_count >= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT(current_slave_count < 0,\n+\t\t\t\"Invalid port id unexpectedly succeeded\");\n \n \t/* Invalid slaves pointer */\n \tcurrent_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,\n \t\t\tNULL, RTE_MAX_ETHPORTS);\n-\tif (current_slave_count >= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT(current_slave_count < 0,\n+\t\t\t\"Invalid slave array unexpectedly succeeded\");\n \n \tcurrent_slave_count = rte_eth_bond_active_slaves_get(\n \t\t\ttest_params->bonded_port_id, NULL, RTE_MAX_ETHPORTS);\n-\tif (current_slave_count >= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT(current_slave_count < 0,\n+\t\t\t\"Invalid slave array unexpectedly succeeded\");\n \n \t/* non bonded device*/\n \tcurrent_slave_count = rte_eth_bond_slaves_get(\n \t\t\ttest_params->slave_port_ids[0], NULL, RTE_MAX_ETHPORTS);\n-\tif (current_slave_count >= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT(current_slave_count < 0,\n+\t\t\t\"Invalid port id unexpectedly succeeded\");\n \n \tcurrent_slave_count = rte_eth_bond_active_slaves_get(\n \t\t\ttest_params->slave_port_ids[0],\tNULL, RTE_MAX_ETHPORTS);\n-\tif (current_slave_count >= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT(current_slave_count < 0,\n+\t\t\t\"Invalid port id unexpectedly succeeded\");\n \n-\tretval = test_remove_slave_from_bonded_device();\n-\tif (retval != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(test_remove_slave_from_bonded_device(),\n+\t\t\t\"Failed to remove slaves from bonded device\");\n \n \treturn 0;\n }\n@@ -623,15 +579,13 @@ test_add_remove_multiple_slaves_to_from_bonded_device(void)\n {\n \tint i;\n \n-\tfor (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++) {\n-\t\tif (test_add_slave_to_bonded_device() != 0)\n-\t\t\treturn -1;\n-\t}\n+\tfor (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++)\n+\t\tTEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),\n+\t\t\t\t\"Failed to add slave to bonded device\");\n \n-\tfor (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++) {\n-\t\tif (test_remove_slave_from_bonded_device() != 0)\n-\t\t\treturn -1;\n-\t}\n+\tfor (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++)\n+\t\tTEST_ASSERT_SUCCESS(test_remove_slave_from_bonded_device(),\n+\t\t\t\t\"Failed to remove slaves from bonded device\");\n \n \treturn 0;\n }\n@@ -659,8 +613,8 @@ test_start_bonded_device(void)\n \tuint8_t slaves[RTE_MAX_ETHPORTS];\n \n \t/* Add slave to bonded device*/\n-\tif (test_add_slave_to_bonded_device() != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),\n+\t\t\t\"Failed to add slave to bonded device\");\n \n \tTEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),\n \t\t\"Failed to start bonded pmd eth device %d.\",\n@@ -673,43 +627,30 @@ test_start_bonded_device(void)\n \n \tcurrent_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,\n \t\t\tslaves, RTE_MAX_ETHPORTS);\n-\tif (current_slave_count != test_params->bonded_slave_count) {\n-\t\tprintf(\"Number of slaves (%d) is not expected value (%d).\\n\",\n-\t\t\t\tcurrent_slave_count, test_params->bonded_slave_count);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count,\n+\t\t\t\"Number of slaves (%d) is not expected value (%d).\",\n+\t\t\tcurrent_slave_count, test_params->bonded_slave_count);\n \n \tcurrent_slave_count = rte_eth_bond_active_slaves_get(\n \t\t\ttest_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS);\n-\tif (current_slave_count != test_params->bonded_slave_count) {\n-\t\tprintf(\"Number of active slaves (%d) is not expected value (%d).\\n\",\n-\t\t\t\tcurrent_slave_count, test_params->bonded_slave_count);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count,\n+\t\t\t\"Number of active slaves (%d) is not expected value (%d).\",\n+\t\t\tcurrent_slave_count, test_params->bonded_slave_count);\n \n \tcurrent_bonding_mode = rte_eth_bond_mode_get(test_params->bonded_port_id);\n-\tif (current_bonding_mode != test_params->bonding_mode) {\n-\t\tprintf(\"Bonded device mode (%d) is not expected value (%d).\\n\",\n-\t\t\t\tcurrent_bonding_mode, test_params->bonding_mode);\n-\t\treturn -1;\n-\n-\t}\n+\tTEST_ASSERT_EQUAL(current_bonding_mode, test_params->bonding_mode,\n+\t\t\t\"Bonded device mode (%d) is not expected value (%d).\\n\",\n+\t\t\tcurrent_bonding_mode, test_params->bonding_mode);\n \n \tprimary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);\n-\tif (primary_port != test_params->slave_port_ids[0]) {\n-\t\tprintf(\"Primary port (%d) is not expected value (%d).\\n\",\n-\t\t\t\tprimary_port, test_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\n-\t}\n+\tTEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[0],\n+\t\t\t\"Primary port (%d) is not expected value (%d).\",\n+\t\t\tprimary_port, test_params->slave_port_ids[0]);\n \n \trte_eth_link_get(test_params->bonded_port_id, &link_status);\n-\tif (!link_status.link_status) {\n-\t\tprintf(\"Bonded port (%d) status (%d) is not expected value (%d).\\n\",\n-\t\t\t\ttest_params->bonded_port_id, link_status.link_status, 1);\n-\t\treturn -1;\n-\n-\t}\n+\tTEST_ASSERT_EQUAL(link_status.link_status, 1,\n+\t\t\t\"Bonded port (%d) status (%d) is not expected value (%d).\\n\",\n+\t\t\ttest_params->bonded_port_id, link_status.link_status, 1);\n \n \treturn 0;\n }\n@@ -725,40 +666,32 @@ test_stop_bonded_device(void)\n \trte_eth_dev_stop(test_params->bonded_port_id);\n \n \trte_eth_link_get(test_params->bonded_port_id, &link_status);\n-\tif (link_status.link_status) {\n-\t\tprintf(\"Bonded port (%d) status (%d) is not expected value (%d).\\n\",\n-\t\t\t\ttest_params->bonded_port_id, link_status.link_status, 0);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(link_status.link_status, 0,\n+\t\t\t\"Bonded port (%d) status (%d) is not expected value (%d).\",\n+\t\t\ttest_params->bonded_port_id, link_status.link_status, 0);\n \n \tcurrent_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,\n \t\t\tslaves, RTE_MAX_ETHPORTS);\n-\tif (current_slave_count != test_params->bonded_slave_count) {\n-\t\tprintf(\"Number of slaves (%d) is not expected value (%d).\\n\",\n-\t\t\t\tcurrent_slave_count, test_params->bonded_slave_count);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count,\n+\t\t\t\"Number of slaves (%d) is not expected value (%d).\",\n+\t\t\tcurrent_slave_count, test_params->bonded_slave_count);\n \n \tcurrent_slave_count = rte_eth_bond_active_slaves_get(\n \t\t\ttest_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS);\n-\tif (current_slave_count != 0) {\n-\t\tprintf(\"Number of active slaves (%d) is not expected value (%d).\\n\",\n-\t\t\t\tcurrent_slave_count, 0);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(current_slave_count, 0,\n+\t\t\t\"Number of active slaves (%d) is not expected value (%d).\",\n+\t\t\tcurrent_slave_count, 0);\n \n \treturn 0;\n }\n \n-static int remove_slaves_and_stop_bonded_device(void)\n+static int\n+remove_slaves_and_stop_bonded_device(void)\n {\n \t/* Clean up and remove slaves from bonded device */\n-\twhile (test_params->bonded_slave_count > 0) {\n-\t\tif (test_remove_slave_from_bonded_device() != 0) {\n-\t\t\tprintf(\"test_remove_slave_from_bonded_device failed\\n\");\n-\t\t\treturn -1;\n-\t\t}\n-\t}\n+\twhile (test_params->bonded_slave_count > 0)\n+\t\tTEST_ASSERT_SUCCESS(test_remove_slave_from_bonded_device(),\n+\t\t\t\t\"test_remove_slave_from_bonded_device failed\");\n \n \trte_eth_dev_stop(test_params->bonded_port_id);\n \trte_eth_stats_reset(test_params->bonded_port_id);\n@@ -770,8 +703,7 @@ static int remove_slaves_and_stop_bonded_device(void)\n static int\n test_set_bonding_mode(void)\n {\n-\tint i;\n-\tint retval, bonding_mode;\n+\tint i, bonding_mode;\n \n \tint bonding_modes[] = { BONDING_MODE_ROUND_ROBIN,\n \t\t\t\t\t\t\tBONDING_MODE_ACTIVE_BACKUP,\n@@ -784,56 +716,39 @@ test_set_bonding_mode(void)\n \t/* Test supported link bonding modes */\n \tfor (i = 0; i < (int)RTE_DIM(bonding_modes);\ti++) {\n \t\t/* Invalid port ID */\n-\t\tretval = rte_eth_bond_mode_set(INVALID_PORT_ID, bonding_modes[i]);\n-\t\tif (retval == 0) {\n-\t\t\tprintf(\"Expected call to failed as invalid port (%d) specified.\\n\",\n-\t\t\t\t\tINVALID_PORT_ID);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_FAIL(rte_eth_bond_mode_set(INVALID_PORT_ID,\n+\t\t\t\tbonding_modes[i]),\n+\t\t\t\t\"Expected call to failed as invalid port (%d) specified.\",\n+\t\t\t\tINVALID_PORT_ID);\n \n \t\t/* Non bonded device */\n-\t\tretval = rte_eth_bond_mode_set(test_params->slave_port_ids[0],\n-\t\t\t\tbonding_modes[i]);\n-\t\tif (retval == 0) {\n-\t\t\tprintf(\"Expected call to failed as invalid port (%d) specified.\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_FAIL(rte_eth_bond_mode_set(test_params->slave_port_ids[0],\n+\t\t\t\tbonding_modes[i]),\n+\t\t\t\t\"Expected call to failed as invalid port (%d) specified.\",\n+\t\t\t\ttest_params->slave_port_ids[0]);\n \n-\t\tretval = rte_eth_bond_mode_set(test_params->bonded_port_id,\n-\t\t\t\tbonding_modes[i]);\n-\t\tif (retval != 0) {\n-\t\t\tprintf(\"Failed to set link bonding mode on port (%d) to (%d).\\n\",\n-\t\t\t\t\ttest_params->bonded_port_id, bonding_modes[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id,\n+\t\t\t\tbonding_modes[i]),\n+\t\t\t\t\"Failed to set link bonding mode on port (%d) to (%d).\",\n+\t\t\t\ttest_params->bonded_port_id, bonding_modes[i]);\n \n \t\tbonding_mode = rte_eth_bond_mode_get(test_params->bonded_port_id);\n-\t\tif (bonding_mode != bonding_modes[i]) {\n-\t\t\tprintf(\"Link bonding mode (%d) of port (%d) is not expected value (%d).\\n\",\n-\t\t\t\t\tbonding_mode, test_params->bonded_port_id,\n-\t\t\t\t\tbonding_modes[i]);\n-\t\t\treturn -1;\n-\t\t}\n-\n+\t\tTEST_ASSERT_EQUAL(bonding_mode, bonding_modes[i],\n+\t\t\t\t\"Link bonding mode (%d) of port (%d) is not expected value (%d).\",\n+\t\t\t\tbonding_mode, test_params->bonded_port_id,\n+\t\t\t\tbonding_modes[i]);\n \n \t\t/* Invalid port ID */\n \t\tbonding_mode = rte_eth_bond_mode_get(INVALID_PORT_ID);\n-\t\tif (bonding_mode >= 0) {\n-\t\t\tprintf(\"Expected call to failed as invalid port (%d) specified.\\n\",\n-\t\t\t\t\tINVALID_PORT_ID);\n-\t\t\treturn -1;\n-\t\t}\n-\n+\t\tTEST_ASSERT(bonding_mode < 0,\n+\t\t\t\t\"Expected call to failed as invalid port (%d) specified.\",\n+\t\t\t\tINVALID_PORT_ID);\n \n \t\t/* Non bonded device */\n \t\tbonding_mode = rte_eth_bond_mode_get(test_params->slave_port_ids[0]);\n-\t\tif (bonding_mode >= 0) {\n-\t\t\tprintf(\"Expected call to failed as invalid port (%d) specified.\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\t\treturn -1;\n-\t\t}\n-\n+\t\tTEST_ASSERT(bonding_mode < 0,\n+\t\t\t\t\"Expected call to failed as invalid port (%d) specified.\",\n+\t\t\t\ttest_params->slave_port_ids[0]);\n \t}\n \n \treturn remove_slaves_and_stop_bonded_device();\n@@ -847,36 +762,24 @@ test_set_primary_slave(void)\n \tstruct ether_addr *expected_mac_addr;\n \n \t/* Add 4 slaves to bonded device */\n-\tfor (i = test_params->bonded_slave_count; i < 4; i++) {\n-\t\tretval = test_add_slave_to_bonded_device();\n-\t\tif (retval != 0) {\n-\t\t\tprintf(\"Failed to add slave to bonded device.\\n\");\n-\t\t\treturn -1;\n-\t\t}\n-\t}\n-\tretval = rte_eth_bond_mode_set(test_params->bonded_port_id,\n-\t\t\tBONDING_MODE_ROUND_ROBIN);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to set link bonding mode on port (%d) to (%d).\\n\",\n-\t\t\t\ttest_params->bonded_port_id, BONDING_MODE_ROUND_ROBIN);\n-\t\treturn -1;\n-\t}\n+\tfor (i = test_params->bonded_slave_count; i < 4; i++)\n+\t\tTEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),\n+\t\t\t\t\"Failed to add slave to bonded device.\");\n+\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id,\n+\t\t\tBONDING_MODE_ROUND_ROBIN),\n+\t\t\t\"Failed to set link bonding mode on port (%d) to (%d).\",\n+\t\t\ttest_params->bonded_port_id, BONDING_MODE_ROUND_ROBIN);\n \n \t/* Invalid port ID */\n-\tretval = rte_eth_bond_primary_set(INVALID_PORT_ID,\n-\t\t\ttest_params->slave_port_ids[i]);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as invalid port specified.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_primary_set(INVALID_PORT_ID,\n+\t\t\ttest_params->slave_port_ids[i]),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n \t/* Non bonded device */\n-\tretval = rte_eth_bond_primary_set(test_params->slave_port_ids[i],\n-\t\t\ttest_params->slave_port_ids[i]);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as invalid port specified.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_primary_set(test_params->slave_port_ids[i],\n+\t\t\ttest_params->slave_port_ids[i]),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n \t/* Set slave as primary\n \t * Verify slave it is now primary slave\n@@ -884,32 +787,27 @@ test_set_primary_slave(void)\n \t * Verify that MAC address of all bonded slaves are that of primary slave\n \t */\n \tfor (i = 0; i < 4; i++) {\n-\t\tretval = rte_eth_bond_primary_set(test_params->bonded_port_id,\n-\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\tif (retval != 0) {\n-\t\t\tprintf(\"Failed to set bonded port (%d) primary port to (%d)\\n\",\n-\t\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id,\n+\t\t\t\ttest_params->slave_port_ids[i]),\n+\t\t\t\t\"Failed to set bonded port (%d) primary port to (%d)\",\n+\t\t\t\ttest_params->bonded_port_id, test_params->slave_port_ids[i]);\n \n \t\tretval = rte_eth_bond_primary_get(test_params->bonded_port_id);\n-\t\tif (retval < 0) {\n-\t\t\tprintf(\"Failed to read primary port from bonded port (%d)\\n\",\n+\t\tTEST_ASSERT(retval >= 0,\n+\t\t\t\t\"Failed to read primary port from bonded port (%d)\\n\",\n \t\t\t\t\ttest_params->bonded_port_id);\n-\t\t\treturn -1;\n-\t\t} else if (retval != test_params->slave_port_ids[i]) {\n-\t\t\tprintf(\"Bonded port (%d) primary port (%d) not expected value (%d)\\n\",\n-\t\t\t\t\ttest_params->bonded_port_id, retval,\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\n+\t\tTEST_ASSERT_EQUAL(retval, test_params->slave_port_ids[i],\n+\t\t\t\t\"Bonded port (%d) primary port (%d) not expected value (%d)\\n\",\n+\t\t\t\ttest_params->bonded_port_id, retval,\n+\t\t\t\ttest_params->slave_port_ids[i]);\n \n \t\t/* stop/start bonded eth dev to apply new MAC */\n \t\trte_eth_dev_stop(test_params->bonded_port_id);\n \n-\t\tif (rte_eth_dev_start(test_params->bonded_port_id) != 0)\n-\t\t\treturn -1;\n+\t\tTEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),\n+\t\t\t\t\"Failed to start bonded port %d\",\n+\t\t\t\ttest_params->bonded_port_id);\n \n \t\texpected_mac_addr = (struct ether_addr *)&slave_mac;\n \t\texpected_mac_addr->addr_bytes[ETHER_ADDR_LEN-1] =\n@@ -917,56 +815,44 @@ test_set_primary_slave(void)\n \n \t\t/* Check primary slave MAC */\n \t\trte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);\n-\t\tif (memcmp(expected_mac_addr, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\t\tprintf(\"bonded port mac address not set to that of primary port\\n\");\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\"bonded port mac address not set to that of primary port\\n\");\n \n \t\t/* Check bonded MAC */\n \t\trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\t\tif (memcmp(&read_mac_addr, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\t\tprintf(\"bonded port mac address not set to that of primary port\\n\");\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(&read_mac_addr, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\"bonded port mac address not set to that of primary port\\n\");\n \n \t\t/* Check other slaves MACs */\n \t\tfor (j = 0; j < 4; j++) {\n \t\t\tif (j != i) {\n \t\t\t\trte_eth_macaddr_get(test_params->slave_port_ids[j],\n \t\t\t\t\t\t&read_mac_addr);\n-\t\t\t\tif (memcmp(expected_mac_addr, &read_mac_addr,\n-\t\t\t\t\t\tsizeof(read_mac_addr))) {\n-\t\t\t\t\tprintf(\"slave port mac address not set to that of primary port\\n\");\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n+\t\t\t\tTEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr,\n+\t\t\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\t\t\"slave port mac address not set to that of primary \"\n+\t\t\t\t\t\t\"port\");\n \t\t\t}\n \t\t}\n \t}\n \n \n \t/* Test with none existent port */\n-\tretval = rte_eth_bond_primary_get(test_params->bonded_port_id + 10);\n-\tif (retval >= 0) {\n-\t\tprintf(\"read primary port from expectedly\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->bonded_port_id + 10),\n+\t\t\t\"read primary port from expectedly\");\n \n \t/* Test with slave port */\n-\tretval = rte_eth_bond_primary_get(test_params->slave_port_ids[0]);\n-\tif (retval >= 0) {\n-\t\tprintf(\"read primary port from expectedly\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->slave_port_ids[0]),\n+\t\t\t\"read primary port from expectedly\\n\");\n \n-\tif (remove_slaves_and_stop_bonded_device() != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(remove_slaves_and_stop_bonded_device(),\n+\t\t\t\"Failed to stop and remove slaves from bonded device\");\n \n \t/* No slaves  */\n-\tretval = rte_eth_bond_primary_get(test_params->bonded_port_id);\n-\tif (retval >= 0) {\n-\t\tprintf(\"read primary port from expectedly\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(rte_eth_bond_primary_get(test_params->bonded_port_id)  < 0,\n+\t\t\t\"read primary port from expectedly\\n\");\n \n \treturn 0;\n }\n@@ -974,7 +860,7 @@ test_set_primary_slave(void)\n static int\n test_set_explicit_bonded_mac(void)\n {\n-\tint i, retval;\n+\tint i;\n \tstruct ether_addr read_mac_addr;\n \tstruct ether_addr *mac_addr;\n \n@@ -983,87 +869,62 @@ test_set_explicit_bonded_mac(void)\n \tmac_addr = (struct ether_addr *)explicit_bonded_mac;\n \n \t/* Invalid port ID */\n-\tretval = rte_eth_bond_mac_address_set(INVALID_PORT_ID, mac_addr);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as invalid port specified.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_mac_address_set(INVALID_PORT_ID, mac_addr),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n \t/* Non bonded device */\n-\tretval = rte_eth_bond_mac_address_set(test_params->slave_port_ids[0],\n-\t\t\tmac_addr);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as invalid port specified.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_mac_address_set(\n+\t\t\ttest_params->slave_port_ids[0],\tmac_addr),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n \t/* NULL MAC address */\n-\tretval = rte_eth_bond_mac_address_set(test_params->bonded_port_id, NULL);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as NULL MAC specified\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_mac_address_set(\n+\t\t\ttest_params->bonded_port_id, NULL),\n+\t\t\t\"Expected call to failed as NULL MAC specified\");\n \n-\tretval = rte_eth_bond_mac_address_set(test_params->bonded_port_id,\n-\t\t\tmac_addr);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to set MAC address on bonded port (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set(\n+\t\t\ttest_params->bonded_port_id, mac_addr),\n+\t\t\t\"Failed to set MAC address on bonded port (%d)\",\n+\t\t\ttest_params->bonded_port_id);\n \n \t/* Add 4 slaves to bonded device */\n \tfor (i = test_params->bonded_slave_count; i < 4; i++) {\n-\t\tretval = test_add_slave_to_bonded_device();\n-\t\tif (retval != 0) {\n-\t\t\tprintf(\"Failed to add slave to bonded device.\\n\");\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),\n+\t\t\t\t\"Failed to add slave to bonded device.\\n\");\n \t}\n \n \t/* Check bonded MAC */\n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port mac address not set to that of primary port\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)),\n+\t\t\t\"bonded port mac address not set to that of primary port\");\n \n \t/* Check other slaves MACs */\n \tfor (i = 0; i < 4; i++) {\n \t\trte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);\n-\t\tif (memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\t\tprintf(\"slave port mac address not set to that of primary port\\n\");\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\"slave port mac address not set to that of primary port\");\n \t}\n \n \t/* test resetting mac address on bonded device */\n-\tif (rte_eth_bond_mac_address_reset(test_params->bonded_port_id) != 0) {\n-\t\tprintf(\"Failed to reset MAC address on bonded port (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\n-\t\treturn -1;\n-\t}\n-\n-\tif (rte_eth_bond_mac_address_reset(test_params->slave_port_ids[0]) == 0) {\n-\t\tprintf(\"Reset MAC address on bonded port (%d) unexpectedly\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n+\tTEST_ASSERT_SUCCESS(\n+\t\t\trte_eth_bond_mac_address_reset(test_params->bonded_port_id),\n+\t\t\t\"Failed to reset MAC address on bonded port (%d)\",\n+\t\t\ttest_params->bonded_port_id);\n \n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(\n+\t\t\trte_eth_bond_mac_address_reset(test_params->slave_port_ids[0]),\n+\t\t\t\"Reset MAC address on bonded port (%d) unexpectedly\",\n+\t\t\ttest_params->slave_port_ids[1]);\n \n \t/* test resetting mac address on bonded device with no slaves */\n+\tTEST_ASSERT_SUCCESS(remove_slaves_and_stop_bonded_device(),\n+\t\t\t\"Failed to remove slaves and stop bonded device\");\n \n-\tif (remove_slaves_and_stop_bonded_device() != 0)\n-\t\treturn -1;\n-\n-\tif (rte_eth_bond_mac_address_reset(test_params->bonded_port_id) != 0) {\n-\t\tprintf(\"Failed to reset MAC address on bonded port (%d)\\n\",\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_reset(test_params->bonded_port_id),\n+\t\t\t\"Failed to reset MAC address on bonded port (%d)\",\n \t\t\t\ttest_params->bonded_port_id);\n \n-\t\treturn -1;\n-\t}\n-\n \treturn 0;\n }\n \n@@ -1179,9 +1040,10 @@ test_status_interrupt(void)\n \tuint8_t slaves[RTE_MAX_ETHPORTS];\n \n \t/* initialized bonding device with T slaves */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 1,\n-\t\t\tTEST_STATUS_INTERRUPT_SLAVE_COUNT, 1) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ROUND_ROBIN, 1,\n+\t\t\tTEST_STATUS_INTERRUPT_SLAVE_COUNT, 1),\n+\t\t\t\"Failed to initialise bonded device\");\n \n \ttest_lsc_interupt_count = 0;\n \n@@ -1313,10 +1175,8 @@ generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size,\n \t\t\tpkts_burst,\ttest_params->pkt_eth_hdr, vlan, ip_hdr, ipv4,\n \t\t\ttest_params->pkt_udp_hdr, burst_size, PACKET_BURST_GEN_PKT_LEN_128,\n \t\t\t1);\n-\tif (generated_burst_size != burst_size) {\n-\t\tprintf(\"Failed to generate packet burst\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(generated_burst_size, burst_size,\n+\t\t\t\"Failed to generate packet burst\");\n \n \treturn generated_burst_size;\n }\n@@ -1326,51 +1186,43 @@ generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size,\n static int\n test_roundrobin_tx_burst(void)\n {\n-\tint i, burst_size, nb_tx;\n+\tint i, burst_size;\n \tstruct rte_mbuf *pkt_burst[MAX_PKT_BURST];\n \tstruct rte_eth_stats port_stats;\n \n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0, 2, 1)\n-\t\t\t!= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ROUND_ROBIN, 0, 2, 1),\n+\t\t\t\"Failed to intialise bonded device\");\n \n \tburst_size = 20 * test_params->bonded_slave_count;\n \n-\tif (burst_size > MAX_PKT_BURST) {\n-\t\tprintf(\"Burst size specified is greater than supported.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(burst_size <= MAX_PKT_BURST,\n+\t\t\t\"Burst size specified is greater than supported.\");\n \n \t/* Generate test bursts of packets to transmit */\n-\tif (generate_test_burst(pkt_burst, burst_size, 0, 1, 0, 0, 0) != burst_size)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(generate_test_burst(pkt_burst, burst_size, 0, 1, 0, 0, 0),\n+\t\t\tburst_size, \"failed to generate test burst\");\n \n \t/* Send burst on bonded port */\n-\tnb_tx = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkt_burst,\n-\t\t\tburst_size);\n-\tif (nb_tx != burst_size)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, pkt_burst, burst_size), burst_size,\n+\t\t\t\"tx burst failed\");\n \n \t/* Verify bonded port tx stats */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size) {\n-\t\tprintf(\"Bonded Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.opackets,\n-\t\t\t\tburst_size);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n+\t\t\t\"Bonded Port (%d) opackets value (%u) not as expected (%d)\\n\",\n+\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.opackets,\n+\t\t\tburst_size);\n \n \t/* Verify slave ports tx stats */\n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_stats_get(test_params->slave_port_ids[i], &port_stats);\n-\t\tif (port_stats.opackets !=\n-\t\t\t\t(uint64_t)burst_size / test_params->bonded_slave_count) {\n-\t\t\tprintf(\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\t\t(unsigned int)port_stats.opackets,\n-\t\t\t\t\tburst_size / test_params->bonded_slave_count);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_EQUAL(port_stats.opackets,\n+\t\t\t\t(uint64_t)burst_size / test_params->bonded_slave_count,\n+\t\t\t\t\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n+\t\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.opackets,\n+\t\t\t\tburst_size / test_params->bonded_slave_count);\n \t}\n \n \t/* Put all slaves down and try and transmit */\n@@ -1380,10 +1232,9 @@ test_roundrobin_tx_burst(void)\n \t}\n \n \t/* Send burst on bonded port */\n-\tnb_tx = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkt_burst,\n-\t\t\tburst_size);\n-\tif (nb_tx != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0,\n+\t\t\tpkt_burst, burst_size), 0,\n+\t\t\t\"tx burst return unexpected value\");\n \n \t/* Clean up and remove slaves from bonded device */\n \treturn remove_slaves_and_stop_bonded_device();\n@@ -1529,17 +1380,17 @@ test_roundrobin_rx_burst_on_single_slave(void)\n \n \tstruct rte_eth_stats port_stats;\n \n-\tint i, j, nb_rx, burst_size = 25;\n+\tint i, j, burst_size = 25;\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0, 4, 1) !=\n-\t\t\t0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ROUND_ROBIN, 0, 4, 1),\n+\t\t\t\"Failed to initialize bonded device with slaves\");\n \n \t/* Generate test bursts of packets to transmit */\n-\tif (generate_test_burst(gen_pkt_burst, burst_size, 0, 1, 0, 0, 0) !=\n-\t\t\tburst_size)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\tgen_pkt_burst, burst_size, 0, 1, 0, 0, 0), burst_size,\n+\t\t\t\"burst generation failed\");\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\t/* Add rx data to slave */\n@@ -1548,21 +1399,17 @@ test_roundrobin_rx_burst_on_single_slave(void)\n \n \t\t/* Call rx burst on bonded device */\n \t\t/* Send burst on bonded port */\n-\t\tnb_rx = rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst,\n-\t\t\t\tMAX_PKT_BURST);\n-\t\tif (nb_rx != burst_size) {\n-\t\t\tprintf(\"round-robin rx burst failed\");\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_EQUAL(rte_eth_rx_burst(\n+\t\t\t\ttest_params->bonded_port_id, 0, rx_pkt_burst,MAX_PKT_BURST),\n+\t\t\t\tburst_size, \"round-robin rx burst failed\");\n \n \t\t/* Verify bonded device rx count */\n \t\trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\t\tif (port_stats.ipackets != (uint64_t)burst_size) {\n-\t\t\tprintf(\"Bonded Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\t\t(unsigned int)port_stats.ipackets, burst_size);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,\n+\t\t\t\t\"Bonded Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\t\ttest_params->bonded_port_id,\n+\t\t\t\t(unsigned int)port_stats.ipackets, burst_size);\n+\n \n \n \t\t/* Verify bonded slave devices rx count */\n@@ -1571,19 +1418,15 @@ test_roundrobin_rx_burst_on_single_slave(void)\n \t\t\trte_eth_stats_get(test_params->slave_port_ids[j], &port_stats);\n \n \t\t\tif (i == j) {\n-\t\t\t\tif (port_stats.ipackets != (uint64_t)burst_size) {\n-\t\t\t\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\t\t\ttest_params->slave_port_ids[i],\n-\t\t\t\t\t\t\t(unsigned int)port_stats.ipackets, burst_size);\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n+\t\t\t\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,\n+\t\t\t\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected\"\n+\t\t\t\t\t\t\" (%d)\", test_params->slave_port_ids[i],\n+\t\t\t\t\t\t(unsigned int)port_stats.ipackets, burst_size);\n \t\t\t} else {\n-\t\t\t\tif (port_stats.ipackets != 0) {\n-\t\t\t\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\t\t\ttest_params->slave_port_ids[i],\n-\t\t\t\t\t\t\t(unsigned int)port_stats.ipackets, 0);\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n+\t\t\t\tTEST_ASSERT_EQUAL(port_stats.ipackets, 0,\n+\t\t\t\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected\"\n+\t\t\t\t\t\t\" (%d)\", test_params->slave_port_ids[i],\n+\t\t\t\t\t\t(unsigned int)port_stats.ipackets, 0);\n \t\t\t}\n \n \t\t\t/* Reset bonded slaves stats */\n@@ -1620,17 +1463,16 @@ test_roundrobin_rx_burst_on_multiple_slaves(void)\n \tint burst_size[TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT] = { 15, 13, 36 };\n \tint i, nb_rx;\n \n-\n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0, 4, 1) !=\n-\t\t\t0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ROUND_ROBIN, 0, 4, 1),\n+\t\t\t\"Failed to initialize bonded device with slaves\");\n \n \t/* Generate test bursts of packets to transmit */\n \tfor (i = 0; i < TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT; i++) {\n-\t\tif (generate_test_burst(&gen_pkt_burst[i][0], burst_size[i], 0, 1, 0, 0,\n-\t\t\t\t0) != burst_size[i])\n-\t\t\treturn -1;\n+\t\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t\t&gen_pkt_burst[i][0], burst_size[i], 0, 1, 0, 0, 0),\n+\t\t\t\tburst_size[i], \"burst generation failed\");\n \t}\n \n \t/* Add rx data to slaves */\n@@ -1641,57 +1483,44 @@ test_roundrobin_rx_burst_on_multiple_slaves(void)\n \n \t/* Call rx burst on bonded device */\n \t/* Send burst on bonded port */\n-\tnb_rx = rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst,\n+\tnb_rx = rte_eth_rx_burst( test_params->bonded_port_id, 0, rx_pkt_burst,\n \t\t\tMAX_PKT_BURST);\n-\tif (nb_rx != burst_size[0] + burst_size[1] + burst_size[2]) {\n-\t\tprintf(\"round-robin rx burst failed (%d != %d)\\n\", nb_rx,\n-\t\t\t\tburst_size[0] + burst_size[1] + burst_size[2]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(nb_rx , burst_size[0] + burst_size[1] + burst_size[2],\n+\t\t\t\"round-robin rx burst failed (%d != %d)\\n\", nb_rx,\n+\t\t\tburst_size[0] + burst_size[1] + burst_size[2]);\n \n \t/* Verify bonded device rx count */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)(burst_size[0] + burst_size[1] +\n-\t\t\tburst_size[2])) {\n-\t\tprintf(\"Bonded Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.ipackets,\n-\t\t\t\tburst_size[0] + burst_size[1] + burst_size[2]);\n-\t\treturn -1;\n-\t}\n-\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets,\n+\t\t\t(uint64_t)(burst_size[0] + burst_size[1] + burst_size[2]),\n+\t\t\t\"Bonded Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.ipackets,\n+\t\t\tburst_size[0] + burst_size[1] + burst_size[2]);\n \n \t/* Verify bonded slave devices rx counts */\n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)burst_size[0]) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0],\n-\t\t\t\t(unsigned int)port_stats.ipackets, burst_size[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0],\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[0],\n+\t\t\t(unsigned int)port_stats.ipackets, burst_size[0]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)burst_size[1]) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1],\n-\t\t\t\t(unsigned int)port_stats.ipackets, burst_size[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[1],\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[1], (unsigned int)port_stats.ipackets,\n+\t\t\tburst_size[1]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)burst_size[2]) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[2],\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n \t\t\t\ttest_params->slave_port_ids[2],\n \t\t\t\t(unsigned int)port_stats.ipackets, burst_size[2]);\n-\t\treturn -1;\n-\t}\n \n \trte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);\n-\tif (port_stats.ipackets != 0) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[3],\n-\t\t\t\t(unsigned int)port_stats.ipackets, 0);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, 0,\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[3],\n+\t\t\t(unsigned int)port_stats.ipackets, 0);\n \n \t/* free mbufs */\n \tfor (i = 0; i < MAX_PKT_BURST; i++) {\n@@ -1708,91 +1537,77 @@ test_roundrobin_verify_mac_assignment(void)\n {\n \tstruct ether_addr read_mac_addr, expected_mac_addr_0, expected_mac_addr_2;\n \n-\tint i, retval;\n+\tint i;\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0);\n \trte_eth_macaddr_get(test_params->slave_port_ids[2], &expected_mac_addr_2);\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0, 4, 1)\n-\t\t\t!= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\t\tBONDING_MODE_ROUND_ROBIN, 0, 4, 1),\n+\t\t\t\t\"Failed to initialize bonded device with slaves\");\n \n \t/* Verify that all MACs are the same as first slave added to bonded dev */\n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);\n-\t\tif (memcmp(&expected_mac_addr_0, &read_mac_addr,\n-\t\t\t\tsizeof(read_mac_addr))) {\n-\t\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\t\ttest_params->slave_port_ids[i]);\n \t}\n \n \t/* change primary and verify that MAC addresses haven't changed */\n-\tretval = rte_eth_bond_primary_set(test_params->bonded_port_id,\n-\t\t\ttest_params->slave_port_ids[2]);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to set bonded port (%d) primary port to (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, test_params->slave_port_ids[i]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id,\n+\t\t\ttest_params->slave_port_ids[2]),\n+\t\t\t\"Failed to set bonded port (%d) primary port to (%d)\",\n+\t\t\ttest_params->bonded_port_id, test_params->slave_port_ids[i]);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);\n-\t\tif (memcmp(&expected_mac_addr_0, &read_mac_addr,\n-\t\t\t\tsizeof(read_mac_addr))) {\n-\t\t\tprintf(\"slave port (%d) mac address has changed to that of primary port without stop/start toggle of bonded device\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\"slave port (%d) mac address has changed to that of primary\"\n+\t\t\t\t\" port without stop/start toggle of bonded device\",\n+\t\t\t\ttest_params->slave_port_ids[i]);\n \t}\n \n \t/* stop / start bonded device and verify that primary MAC address is\n \t * propagate to bonded device and slaves */\n-\n \trte_eth_dev_stop(test_params->bonded_port_id);\n \n-\tif (rte_eth_dev_start(test_params->bonded_port_id) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),\n+\t\t\t\"Failed to start bonded device\");\n \n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_2, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of new primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(\n+\t\t\tmemcmp(&expected_mac_addr_2, &read_mac_addr, sizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of new primary port\",\n+\t\t\ttest_params->slave_port_ids[i]);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);\n-\t\tif (memcmp(&expected_mac_addr_2, &read_mac_addr,\n-\t\t\t\tsizeof(read_mac_addr))) {\n-\t\t\tprintf(\"slave port (%d) mac address not set to that of new primary port\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_2, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\"slave port (%d) mac address not set to that of new primary\"\n+\t\t\t\t\" port\", test_params->slave_port_ids[i]);\n \t}\n \n \t/* Set explicit MAC address */\n-\tif (rte_eth_bond_mac_address_set(test_params->bonded_port_id,\n-\t\t\t(struct ether_addr *)bonded_mac) != 0) {\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set(\n+\t\t\ttest_params->bonded_port_id, (struct ether_addr *)bonded_mac),\n+\t\t\t\"Failed to set MAC\");\n \n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(bonded_mac, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of new primary port\\n\",\n+\tTEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of new primary port\",\n \t\t\t\ttest_params->slave_port_ids[i]);\n-\t\treturn -1;\n-\t}\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);\n-\t\tif (memcmp(bonded_mac, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\t\tprintf(\"slave port (%d) mac address not set to that of new primary port\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)), \"slave port (%d) mac address not set to\"\n+\t\t\t\t\"that of new primary port\\n\", test_params->slave_port_ids[i]);\n \t}\n \n \t/* Clean up and remove slaves from bonded device */\n@@ -1805,44 +1620,38 @@ test_roundrobin_verify_promiscuous_enable_disable(void)\n \tint i, promiscuous_en;\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0, 4, 1) !=\n-\t\t\t0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ROUND_ROBIN, 0, 4, 1),\n+\t\t\t\"Failed to initialize bonded device with slaves\");\n \n \trte_eth_promiscuous_enable(test_params->bonded_port_id);\n \n \tpromiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);\n-\tif (promiscuous_en != 1) {\n-\t\tprintf(\"Port (%d) promiscuous mode not enabled\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(promiscuous_en, 1,\n+\t\t\t\"Port (%d) promiscuous mode not enabled\",\n+\t\t\ttest_params->bonded_port_id);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n-\t\tpromiscuous_en = rte_eth_promiscuous_get(test_params->slave_port_ids[i]);\n-\t\tif (promiscuous_en != 1) {\n-\t\t\tprintf(\"slave port (%d) promiscuous mode not enabled\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tpromiscuous_en = rte_eth_promiscuous_get(\n+\t\t\t\ttest_params->slave_port_ids[i]);\n+\t\tTEST_ASSERT_EQUAL(promiscuous_en, 1,\n+\t\t\t\t\"slave port (%d) promiscuous mode not enabled\",\n+\t\t\t\ttest_params->slave_port_ids[i]);\n \t}\n \n \trte_eth_promiscuous_disable(test_params->bonded_port_id);\n \n \tpromiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);\n-\tif (promiscuous_en != 0) {\n-\t\tprintf(\"Port (%d) promiscuous mode not disabled\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(promiscuous_en, 0,\n+\t\t\t\"Port (%d) promiscuous mode not disabled\\n\",\n+\t\t\ttest_params->bonded_port_id);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n-\t\tpromiscuous_en = rte_eth_promiscuous_get(test_params->slave_port_ids[i]);\n-\t\tif (promiscuous_en != 0) {\n-\t\t\tprintf(\"slave port (%d) promiscuous mode not disabled\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tpromiscuous_en = rte_eth_promiscuous_get(\n+\t\t\t\ttest_params->slave_port_ids[i]);\n+\t\tTEST_ASSERT_EQUAL(promiscuous_en, 0,\n+\t\t\t\t\"Port (%d) promiscuous mode not disabled\\n\",\n+\t\t\t\ttest_params->slave_port_ids[i]);\n \t}\n \n \t/* Clean up and remove slaves from bonded device */\n@@ -1869,26 +1678,22 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void)\n \n \t/* Initialize bonded device with TEST_RR_LINK_STATUS_SLAVE_COUNT slaves\n \t * in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0,\n-\t\t\tTEST_RR_LINK_STATUS_SLAVE_COUNT, 1) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ROUND_ROBIN, 0, TEST_RR_LINK_STATUS_SLAVE_COUNT, 1),\n+\t\t\t\"Failed to initialize bonded device with slaves\");\n \n \t/* Verify Current Slaves Count /Active Slave Count is */\n \tslave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves,\n \t\t\tRTE_MAX_ETHPORTS);\n-\tif (slave_count != TEST_RR_LINK_STATUS_SLAVE_COUNT) {\n-\t\tprintf(\"Number of slaves (%d) is not as expected (%d).\\n\", slave_count,\n-\t\t\t\tTEST_RR_LINK_STATUS_SLAVE_COUNT);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(slave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT,\n+\t\t\t\"Number of slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT);\n \n \tslave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,\n \t\t\tslaves, RTE_MAX_ETHPORTS);\n-\tif (slave_count != TEST_RR_LINK_STATUS_SLAVE_COUNT) {\n-\t\tprintf(\"Number of active slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(slave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT,\n+\t\t\t\"Number of active slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT);\n \n \t/* Set 2 slaves eth_devs link status to down */\n \tvirtual_ethdev_simulate_link_status_interrupt(\n@@ -1896,13 +1701,12 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void)\n \tvirtual_ethdev_simulate_link_status_interrupt(\n \t\t\ttest_params->slave_port_ids[3], 0);\n \n-\tif (rte_eth_bond_active_slaves_get(test_params->bonded_port_id,\n-\t\t\tslaves, RTE_MAX_ETHPORTS) !=\n-\t\t\t\t\tTEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT) {\n-\t\tprintf(\"Number of active slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT);\n-\t\treturn -1;\n-\t}\n+\tslave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,\n+\t\t\tslaves, RTE_MAX_ETHPORTS);\n+\tTEST_ASSERT_EQUAL(slave_count,\n+\t\t\tTEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT,\n+\t\t\t\"Number of active slaves (%d) is not as expected (%d).\\n\",\n+\t\t\tslave_count, TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT);\n \n \tburst_size = 20;\n \n@@ -1913,19 +1717,16 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void)\n \t * 3. Verify stats for bonded eth_dev (opackets = burst_size)\n \t * 4. Verify stats for slave eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0)\n \t */\n-\tif (generate_test_burst(tx_pkt_burst, burst_size, 0, 1, 0, 0, 0) !=\n-\t\t\tburst_size) {\n-\t\tprintf(\"generate_test_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(\n+\t\t\tgenerate_test_burst(tx_pkt_burst, burst_size, 0, 1, 0, 0, 0),\n+\t\t\tburst_size, \"generate_test_burst failed\");\n \n \trte_eth_stats_reset(test_params->bonded_port_id);\n \n-\tif (rte_eth_tx_burst(test_params->bonded_port_id, 0, tx_pkt_burst,\n-\t\t\tburst_size) != burst_size) {\n-\t\tprintf(\"rte_eth_tx_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\n+\tTEST_ASSERT_EQUAL(\n+\t\t\trte_eth_tx_burst(test_params->bonded_port_id, 0, tx_pkt_burst,\n+\t\t\tburst_size), burst_size, \"rte_eth_tx_burst failed\");\n \n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n \tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n@@ -1963,27 +1764,24 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void)\n \t * 6. Verify stats for slave eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0)\n \t */\n \tfor (i = 0; i < TEST_RR_LINK_STATUS_SLAVE_COUNT; i++) {\n-\t\tif (generate_test_burst(&gen_pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0)\n-\t\t\t\t!= burst_size) {\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t\t&gen_pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0),\n+\t\t\t\tburst_size, \"failed to generate packet burst\");\n+\n \t\tvirtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],\n \t\t\t\t&gen_pkt_burst[i][0], burst_size);\n \t}\n \n-\tif (rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst,\n-\t\t\tMAX_PKT_BURST) != burst_size + burst_size) {\n-\t\tprintf(\"rte_eth_rx_burst\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_rx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST),\n+\t\t\tburst_size + burst_size,\n+\t\t\t\"rte_eth_rx_burst failed\");\n \n \t/* Verify bonded device rx count */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)(burst_size + burst_size)) {\n-\t\tprintf(\"(%d) port_stats.ipackets not as expected\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets , (uint64_t)(burst_size + burst_size),\n+\t\t\t\"(%d) port_stats.ipackets not as expected\\n\",\n+\t\t\ttest_params->bonded_port_id);\n \n \t/* free mbufs */\n \tfor (i = 0; i < MAX_PKT_BURST; i++) {\n@@ -2005,7 +1803,6 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void)\n \n uint8_t polling_slave_mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00 };\n \n-#include \"unistd.h\"\n \n int polling_test_slaves[TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT] = { -1, -1 } ;\n \n@@ -2039,7 +1836,8 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void)\n \t\tTEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id,\n \t\t\t\tpolling_test_slaves[i]),\n \t\t\t\t\"Failed to add slave %s(%d) to bonded device %d\",\n-\t\t\t\tslave_name, polling_test_slaves[i], test_params->bonded_port_id);\n+\t\t\t\tslave_name, polling_test_slaves[i],\n+\t\t\t\ttest_params->bonded_port_id);\n \t}\n \n \t/* Initialize bonded device */\n@@ -2101,15 +1899,13 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void)\n static int\n test_activebackup_tx_burst(void)\n {\n-\tint i, retval, pktlen, primary_port, burst_size, generated_burst_size, nb_tx;\n+\tint i, pktlen, primary_port, burst_size;\n \tstruct rte_mbuf *pkts_burst[MAX_PKT_BURST];\n \tstruct rte_eth_stats port_stats;\n \n-\tretval = initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0, 2, 1);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ACTIVE_BACKUP, 0, 1, 1),\n+\t\t\t\"Failed to initialize bonded device with slaves\");\n \n \tinitialize_eth_header(test_params->pkt_eth_hdr,\n \t\t\t(struct ether_addr *)src_mac, (struct ether_addr *)dst_mac_0, 0, 0);\n@@ -2120,32 +1916,25 @@ test_activebackup_tx_burst(void)\n \n \tburst_size = 20 * test_params->bonded_slave_count;\n \n-\tif (burst_size > MAX_PKT_BURST) {\n-\t\tprintf(\"Burst size specified is greater than supported.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(burst_size < MAX_PKT_BURST,\n+\t\t\t\"Burst size specified is greater than supported.\");\n \n \t/* Generate a burst of packets to transmit */\n-\tgenerated_burst_size = generate_packet_burst(test_params->mbuf_pool,\n-\t\t\tpkts_burst,\ttest_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr,\n-\t\t\t1, test_params->pkt_udp_hdr, burst_size, PACKET_BURST_GEN_PKT_LEN, 1);\n-\tif (generated_burst_size != burst_size)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(generate_packet_burst(test_params->mbuf_pool, pkts_burst,\n+\t\t\ttest_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr, 1,\n+\t\t\ttest_params->pkt_udp_hdr, burst_size, PACKET_BURST_GEN_PKT_LEN, 1),\n+\t\t\tburst_size,\t\"failed to generate burst correctly\");\n \n \t/* Send burst on bonded port */\n-\tnb_tx = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst,\n-\t\t\tburst_size);\n-\tif (nb_tx != burst_size)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst,\n+\t\t\tburst_size),  burst_size, \"tx burst failed\");\n \n \t/* Verify bonded port tx stats */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size) {\n-\t\tprintf(\"Bonded Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.opackets,\n-\t\t\t\tburst_size);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n+\t\t\t\"Bonded Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.opackets,\n+\t\t\tburst_size);\n \n \tprimary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);\n \n@@ -2153,35 +1942,28 @@ test_activebackup_tx_burst(void)\n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_stats_get(test_params->slave_port_ids[i], &port_stats);\n \t\tif (test_params->slave_port_ids[i] == primary_port) {\n-\t\t\tif (port_stats.opackets != (uint64_t)burst_size) {\n-\t\t\t\tprintf(\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\t\t\t(unsigned int)port_stats.opackets,\n-\t\t\t\t\t\tburst_size / test_params->bonded_slave_count);\n-\t\t\t\treturn -1;\n-\t\t\t}\n+\t\t\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n+\t\t\t\t\t\"Slave Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\t\t\ttest_params->bonded_port_id,\n+\t\t\t\t\t(unsigned int)port_stats.opackets,\n+\t\t\t\t\tburst_size / test_params->bonded_slave_count);\n \t\t} else {\n-\t\t\tif (port_stats.opackets != 0) {\n-\t\t\t\tprintf(\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\t\t\t(unsigned int)port_stats.opackets, 0);\n-\t\t\t\treturn -1;\n-\t\t\t}\n+\t\t\tTEST_ASSERT_EQUAL(port_stats.opackets, 0,\n+\t\t\t\t\t\"Slave Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\t\t\ttest_params->bonded_port_id,\n+\t\t\t\t\t(unsigned int)port_stats.opackets, 0);\n \t\t}\n \t}\n \n \t/* Put all slaves down and try and transmit */\n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n-\n \t\tvirtual_ethdev_simulate_link_status_interrupt(\n \t\t\t\ttest_params->slave_port_ids[i], 0);\n \t}\n \n \t/* Send burst on bonded port */\n-\tnb_tx = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst,\n-\t\t\tburst_size);\n-\tif (nb_tx != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0,\n+\t\t\tpkts_burst, burst_size), 0, \"Sending empty burst failed\");\n \n \t/* Clean up and remove slaves from bonded device */\n \treturn remove_slaves_and_stop_bonded_device();\n@@ -2199,78 +1981,63 @@ test_activebackup_rx_burst(void)\n \n \tint primary_port;\n \n-\tint i, j, nb_rx, burst_size = 17;\n-\n-\t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0,\n-\t\t\tTEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT, 1)\n-\t\t\t!= 0)\n-\t\treturn -1;\n+\tint i, j, burst_size = 17;\n \n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ACTIVE_BACKUP, 0,\n+\t\t\tTEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT, 1),\n+\t\t\t\"Failed to initialize bonded device with slaves\");\n \n \tprimary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);\n-\tif (primary_port < 0) {\n-\t\tprintf(\"failed to get primary slave for bonded port (%d)\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t}\n+\tTEST_ASSERT(primary_port >= 0,\n+\t\t\t\"failed to get primary slave for bonded port (%d)\",\n+\t\t\ttest_params->bonded_port_id);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\t/* Generate test bursts of packets to transmit */\n-\t\tif (generate_test_burst(&gen_pkt_burst[0], burst_size, 0, 1, 0, 0, 0)\n-\t\t\t\t!= burst_size) {\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t\t&gen_pkt_burst[0], burst_size, 0, 1, 0, 0, 0),\n+\t\t\t\tburst_size, \"burst generation failed\");\n \n \t\t/* Add rx data to slave */\n \t\tvirtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],\n \t\t\t\t&gen_pkt_burst[0], burst_size);\n \n \t\t/* Call rx burst on bonded device */\n-\t\tnb_rx = rte_eth_rx_burst(test_params->bonded_port_id, 0,\n-\t\t\t\t&rx_pkt_burst[0], MAX_PKT_BURST);\n-\t\tif (nb_rx < 0) {\n-\t\t\tprintf(\"rte_eth_rx_burst failed\\n\");\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_EQUAL(rte_eth_rx_burst(test_params->bonded_port_id, 0,\n+\t\t\t\t&rx_pkt_burst[0], MAX_PKT_BURST), burst_size,\n+\t\t\t\t\"rte_eth_rx_burst failed\");\n \n \t\tif (test_params->slave_port_ids[i] == primary_port) {\n \t\t\t/* Verify bonded device rx count */\n \t\t\trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\t\t\tif (port_stats.ipackets != (uint64_t)burst_size) {\n-\t\t\t\tprintf(\"Bonded Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\t\t\t(unsigned int)port_stats.ipackets, burst_size);\n-\t\t\t\treturn -1;\n-\t\t\t}\n+\t\t\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,\n+\t\t\t\t\t\"Bonded Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\t\t\ttest_params->bonded_port_id,\n+\t\t\t\t\t(unsigned int)port_stats.ipackets, burst_size);\n \n \t\t\t/* Verify bonded slave devices rx count */\n \t\t\tfor (j = 0; j < test_params->bonded_slave_count; j++) {\n \t\t\t\trte_eth_stats_get(test_params->slave_port_ids[j], &port_stats);\n \t\t\t\tif (i == j) {\n-\t\t\t\t\tif (port_stats.ipackets != (uint64_t)burst_size) {\n-\t\t\t\t\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\t\t\t\ttest_params->slave_port_ids[i],\n-\t\t\t\t\t\t\t\t(unsigned int)port_stats.ipackets, burst_size);\n-\t\t\t\t\t\treturn -1;\n-\t\t\t\t\t}\n+\t\t\t\t\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,\n+\t\t\t\t\t\t\t\"Slave Port (%d) ipackets value (%u) not as \"\n+\t\t\t\t\t\t\t\"expected (%d)\", test_params->slave_port_ids[i],\n+\t\t\t\t\t\t\t(unsigned int)port_stats.ipackets, burst_size);\n \t\t\t\t} else {\n-\t\t\t\t\tif (port_stats.ipackets != 0) {\n-\t\t\t\t\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\t\t\t\ttest_params->slave_port_ids[i],\n-\t\t\t\t\t\t\t\t(unsigned int)port_stats.ipackets, 0);\n-\t\t\t\t\t\treturn -1;\n-\t\t\t\t\t}\n+\t\t\t\t\tTEST_ASSERT_EQUAL(port_stats.ipackets, 0,\n+\t\t\t\t\t\t\t\"Slave Port (%d) ipackets value (%u) not as \"\n+\t\t\t\t\t\t\t\"expected (%d)\\n\", test_params->slave_port_ids[i],\n+\t\t\t\t\t\t\t(unsigned int)port_stats.ipackets, 0);\n \t\t\t\t}\n \t\t\t}\n \t\t} else {\n \t\t\tfor (j = 0; j < test_params->bonded_slave_count; j++) {\n \t\t\t\trte_eth_stats_get(test_params->slave_port_ids[j], &port_stats);\n-\t\t\t\tif (port_stats.ipackets != 0) {\n-\t\t\t\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\t\t\ttest_params->slave_port_ids[i],\n-\t\t\t\t\t\t\t(unsigned int)port_stats.ipackets, 0);\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n+\t\t\t\tTEST_ASSERT_EQUAL(port_stats.ipackets, 0,\n+\t\t\t\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected \"\n+\t\t\t\t\t\t\"(%d)\", test_params->slave_port_ids[i],\n+\t\t\t\t\t\t(unsigned int)port_stats.ipackets, 0);\n \t\t\t}\n \t\t}\n \n@@ -2296,61 +2063,48 @@ test_activebackup_verify_promiscuous_enable_disable(void)\n \tint i, primary_port, promiscuous_en;\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0, 4, 1)\n-\t\t\t!= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ACTIVE_BACKUP, 0, 4, 1),\n+\t\t\t\"Failed to initialize bonded device with slaves\");\n \n \tprimary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);\n-\tif (primary_port < 0) {\n-\t\tprintf(\"failed to get primary slave for bonded port (%d)\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t}\n+\tTEST_ASSERT(primary_port >= 0,\n+\t\t\t\"failed to get primary slave for bonded port (%d)\",\n+\t\t\ttest_params->bonded_port_id);\n \n \trte_eth_promiscuous_enable(test_params->bonded_port_id);\n \n-\tpromiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);\n-\tif (promiscuous_en != 1) {\n-\t\tprintf(\"Port (%d) promiscuous mode not enabled\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1,\n+\t\t\t\"Port (%d) promiscuous mode not enabled\",\n+\t\t\ttest_params->bonded_port_id);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\tpromiscuous_en = rte_eth_promiscuous_get(\n \t\t\t\ttest_params->slave_port_ids[i]);\n \t\tif (primary_port == test_params->slave_port_ids[i]) {\n-\t\t\tif (promiscuous_en != 1) {\n-\t\t\t\tprintf(\"slave port (%d) promiscuous mode not enabled\\n\",\n-\t\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\t\treturn -1;\n-\t\t\t}\n+\t\t\tTEST_ASSERT_EQUAL(promiscuous_en, 1,\n+\t\t\t\t\t\"slave port (%d) promiscuous mode not enabled\",\n+\t\t\t\t\ttest_params->slave_port_ids[i]);\n \t\t} else {\n-\t\t\tif (promiscuous_en != 0) {\n-\t\t\t\tprintf(\"slave port (%d) promiscuous mode enabled\\n\",\n-\t\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\t\treturn -1;\n-\t\t\t}\n+\t\t\tTEST_ASSERT_EQUAL(promiscuous_en, 0,\n+\t\t\t\t\t\"slave port (%d) promiscuous mode enabled\",\n+\t\t\t\t\ttest_params->slave_port_ids[i]);\n \t\t}\n \n \t}\n \n \trte_eth_promiscuous_disable(test_params->bonded_port_id);\n \n-\tpromiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);\n-\tif (promiscuous_en != 0) {\n-\t\tprintf(\"Port (%d) promiscuous mode not disabled\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0,\n+\t\t\t\"Port (%d) promiscuous mode not disabled\\n\",\n+\t\t\ttest_params->bonded_port_id);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\tpromiscuous_en = rte_eth_promiscuous_get(\n \t\t\t\ttest_params->slave_port_ids[i]);\n-\t\tif (promiscuous_en != 0) {\n-\t\t\tprintf(\"slave port (%d) promiscuous mode not disabled\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_EQUAL(promiscuous_en, 0,\n+\t\t\t\t\"slave port (%d) promiscuous mode not disabled\\n\",\n+\t\t\t\ttest_params->slave_port_ids[i]);\n \t}\n \n \t/* Clean up and remove slaves from bonded device */\n@@ -2366,117 +2120,102 @@ test_activebackup_verify_mac_assignment(void)\n \trte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1);\n \n \t/* Initialize bonded device with 2 slaves in active backup mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0, 2, 1)\n-\t\t\t!= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ACTIVE_BACKUP, 0, 2, 1),\n+\t\t\t\"Failed to initialize bonded device with slaves\");\n \n \t/* Verify that bonded MACs is that of first slave and that the other slave\n \t * MAC hasn't been changed */\n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->bonded_port_id);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->slave_port_ids[0]);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not as expected\",\n+\t\t\ttest_params->slave_port_ids[1]);\n \n \t/* change primary and verify that MAC addresses haven't changed */\n-\tif (rte_eth_bond_primary_set(test_params->bonded_port_id,\n-\t\t\ttest_params->slave_port_ids[1]) != 0) {\n-\t\tprintf(\"Failed to set bonded port (%d) primary port to (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, test_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_bond_primary_set(test_params->bonded_port_id,\n+\t\t\ttest_params->slave_port_ids[1]), 0,\n+\t\t\t\"Failed to set bonded port (%d) primary port to (%d)\",\n+\t\t\ttest_params->bonded_port_id, test_params->slave_port_ids[1]);\n \n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->bonded_port_id);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->slave_port_ids[0]);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not as expected\",\n+\t\t\ttest_params->slave_port_ids[1]);\n \n \t/* stop / start bonded device and verify that primary MAC address is\n \t * propagated to bonded device and slaves */\n \n \trte_eth_dev_stop(test_params->bonded_port_id);\n \n-\tif (rte_eth_dev_start(test_params->bonded_port_id) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),\n+\t\t\t\"Failed to start device\");\n \n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->bonded_port_id);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not as expected\",\n+\t\t\ttest_params->slave_port_ids[0]);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->slave_port_ids[1]);\n \n \t/* Set explicit MAC address */\n-\tif (rte_eth_bond_mac_address_set(test_params->bonded_port_id,\n-\t\t\t(struct ether_addr *)bonded_mac) != 0) {\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set(\n+\t\t\ttest_params->bonded_port_id, (struct ether_addr *)bonded_mac),\n+\t\t\t\"failed to set MAC addres\");\n \n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(&bonded_mac, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of bonded port\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of bonded port\",\n+\t\t\ttest_params->bonded_port_id);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not as expected\",\n+\t\t\ttest_params->slave_port_ids[0]);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);\n-\tif (memcmp(&bonded_mac, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of bonded port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of bonded port\",\n+\t\t\ttest_params->slave_port_ids[1]);\n \n \t/* Clean up and remove slaves from bonded device */\n \treturn remove_slaves_and_stop_bonded_device();\n@@ -2498,38 +2237,32 @@ test_activebackup_verify_slave_link_status_change_failover(void)\n \tmemset(pkt_burst, 0, sizeof(pkt_burst));\n \n \t/* Generate packet burst for testing */\n-\tif (generate_test_burst(&pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0) !=\n-\t\t\tburst_size) {\n-\t\tprintf(\"generate_test_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t&pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0), burst_size,\n+\t\t\t\"generate_test_burst failed\");\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0,\n-\t\t\tTEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT, 1)\n-\t\t\t!= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ACTIVE_BACKUP, 0,\n+\t\t\tTEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT, 1),\n+\t\t\t\"Failed to initialize bonded device with slaves\");\n \n \t/* Verify Current Slaves Count /Active Slave Count is */\n \tslave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves,\n \t\t\tRTE_MAX_ETHPORTS);\n-\tif (slave_count != 4) {\n-\t\tprintf(\"Number of slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, 4);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(slave_count, 4,\n+\t\t\t\"Number of slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, 4);\n \n \tslave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,\n \t\t\tslaves, RTE_MAX_ETHPORTS);\n-\tif (slave_count != 4) {\n-\t\tprintf(\"Number of active slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, 4);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(slave_count, 4,\n+\t\t\t\"Number of active slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, 4);\n \n \tprimary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);\n-\tif (primary_port != test_params->slave_port_ids[0])\n-\t\tprintf(\"Primary port not as expected\");\n+\tTEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[0],\n+\t\t\t\"Primary port not as expected\");\n \n \t/* Bring 2 slaves down and verify active slave count */\n \tvirtual_ethdev_simulate_link_status_interrupt(\n@@ -2537,12 +2270,10 @@ test_activebackup_verify_slave_link_status_change_failover(void)\n \tvirtual_ethdev_simulate_link_status_interrupt(\n \t\t\ttest_params->slave_port_ids[3], 0);\n \n-\tif (rte_eth_bond_active_slaves_get(test_params->bonded_port_id, slaves,\n-\t\t\tRTE_MAX_ETHPORTS) != 2) {\n-\t\tprintf(\"Number of active slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, 2);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get(\n+\t\t\ttest_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 2,\n+\t\t\t\"Number of active slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, 2);\n \n \tvirtual_ethdev_simulate_link_status_interrupt(\n \t\t\ttest_params->slave_port_ids[1], 1);\n@@ -2555,103 +2286,81 @@ test_activebackup_verify_slave_link_status_change_failover(void)\n \tvirtual_ethdev_simulate_link_status_interrupt(\n \t\t\ttest_params->slave_port_ids[0], 0);\n \n-\tif (rte_eth_bond_active_slaves_get(test_params->bonded_port_id, slaves,\n-\t\t\tRTE_MAX_ETHPORTS) != 3) {\n-\t\tprintf(\"Number of active slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, 3);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get(\n+\t\t\ttest_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 3,\n+\t\t\t\"Number of active slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, 3);\n \n \tprimary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);\n-\tif (primary_port != test_params->slave_port_ids[2])\n-\t\tprintf(\"Primary port not as expected\");\n+\tTEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[2],\n+\t\t\t\"Primary port not as expected\");\n \n \t/* Verify that pkts are sent on new primary slave */\n \n-\tif (rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt_burst[0][0], burst_size)\n-\t\t\t!= burst_size) {\n-\t\tprintf(\"rte_eth_tx_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, &pkt_burst[0][0], burst_size),\n+\t\t\tburst_size,\"rte_eth_tx_burst failed\");\n \n \trte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[2]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n+\t\t\t\"(%d) port_stats.opackets not as expected\",\n+\t\t\ttest_params->slave_port_ids[2]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.opackets != 0) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, 0,\n+\t\t\t\"(%d) port_stats.opackets not as expected\\n\",\n+\t\t\ttest_params->slave_port_ids[0]);\n+\n \trte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);\n-\tif (port_stats.opackets != 0) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, 0,\n+\t\t\t\"(%d) port_stats.opackets not as expected\\n\",\n+\t\t\ttest_params->slave_port_ids[1]);\n+\n \trte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);\n-\tif (port_stats.opackets != 0) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[3]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, 0,\n+\t\t\t\"(%d) port_stats.opackets not as expected\\n\",\n+\t\t\ttest_params->slave_port_ids[3]);\n \n \t/* Generate packet burst for testing */\n \n \tfor (i = 0; i < TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT; i++) {\n-\t\tif (generate_test_burst(&pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0) !=\n-\t\t\t\tburst_size)\n-\t\t\treturn -1;\n+\t\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t\t&pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0), burst_size,\n+\t\t\t\t\"generate_test_burst failed\");\n \n \t\tvirtual_ethdev_add_mbufs_to_rx_queue(\n \t\t\ttest_params->slave_port_ids[i], &pkt_burst[i][0], burst_size);\n \t}\n \n-\tif (rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst,\n-\t\t\tMAX_PKT_BURST) != burst_size) {\n-\t\tprintf(\"rte_eth_rx_burst\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_rx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST),\n+\t\t\tburst_size, \"rte_eth_rx_burst\\n\");\n \n \t/* Verify bonded device rx count */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)burst_size) {\n-\t\tprintf(\"(%d) port_stats.ipackets not as expected\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,\n+\t\t\t\"(%d) port_stats.ipackets not as expected\",\n+\t\t\ttest_params->bonded_port_id);\n \n \trte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[2]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n+\t\t\t\"(%d) port_stats.opackets not as expected\",\n+\t\t\ttest_params->slave_port_ids[2]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.opackets != 0) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL (port_stats.opackets, 0,\n+\t\t\t\"(%d) port_stats.opackets not as expected\",\n+\t\t\ttest_params->slave_port_ids[0]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);\n-\tif (port_stats.opackets != 0) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL (port_stats.opackets, 0,\n+\t\t\t\"(%d) port_stats.opackets not as expected\",\n+\t\t\ttest_params->slave_port_ids[1]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);\n-\tif (port_stats.opackets != 0) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[3]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL (port_stats.opackets, 0,\n+\t\t\t\"(%d) port_stats.opackets not as expected\",\n+\t\t\ttest_params->slave_port_ids[3]);\n \n \t/* free mbufs */\n \n@@ -2664,7 +2373,6 @@ test_activebackup_verify_slave_link_status_change_failover(void)\n \t\t}\n \t}\n \n-\n \t/* Clean up and remove slaves from bonded device */\n \treturn remove_slaves_and_stop_bonded_device();\n }\n@@ -2674,70 +2382,49 @@ test_activebackup_verify_slave_link_status_change_failover(void)\n static int\n test_balance_xmit_policy_configuration(void)\n {\n-\tint retval;\n-\n-\tretval = initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0,\n-\t\t\t2, 1);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_ACTIVE_BACKUP, 0, 2, 1),\n+\t\t\t\"Failed to initialize_bonded_device_with_slaves.\");\n \n \t/* Invalid port id */\n-\tretval = rte_eth_bond_xmit_policy_set(INVALID_PORT_ID,\n-\t\t\tBALANCE_XMIT_POLICY_LAYER2);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as invalid port specified.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_set(\n+\t\t\tINVALID_PORT_ID, BALANCE_XMIT_POLICY_LAYER2),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n \t/* Set xmit policy on non bonded device */\n-\tretval = rte_eth_bond_xmit_policy_set(test_params->slave_port_ids[0],\n-\t\t\tBALANCE_XMIT_POLICY_LAYER2);\n-\tif (retval == 0) {\n-\t\tprintf(\"Expected call to failed as invalid port specified.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_set(\n+\t\t\ttest_params->slave_port_ids[0],\tBALANCE_XMIT_POLICY_LAYER2),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n-\tretval = rte_eth_bond_xmit_policy_set(test_params->bonded_port_id,\n-\t\t\tBALANCE_XMIT_POLICY_LAYER2);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to set balance xmit policy.\\n\");\n-\t\treturn -1;\n-\t}\n-\tif (rte_eth_bond_xmit_policy_get(test_params->bonded_port_id) !=\n-\t\t\tBALANCE_XMIT_POLICY_LAYER2) {\n-\t\tprintf(\"balance xmit policy not as expected.\\n\");\n-\t\treturn -1;\n-\t}\n \n-\tretval = rte_eth_bond_xmit_policy_set(test_params->bonded_port_id,\n-\t\t\tBALANCE_XMIT_POLICY_LAYER23);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to set balance xmit policy.\\n\");\n-\t\treturn -1;\n-\t}\n-\tif (rte_eth_bond_xmit_policy_get(test_params->bonded_port_id) !=\n-\t\t\tBALANCE_XMIT_POLICY_LAYER23) {\n-\t\tprintf(\"balance xmit policy not as expected.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(\n+\t\t\ttest_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER2),\n+\t\t\t\"Failed to set balance xmit policy.\");\n \n-\tretval = rte_eth_bond_xmit_policy_set(test_params->bonded_port_id,\n-\t\t\tBALANCE_XMIT_POLICY_LAYER34);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to set balance xmit policy.\\n\");\n-\t\treturn -1;\n-\t}\n-\tif (rte_eth_bond_xmit_policy_get(test_params->bonded_port_id) !=\n-\t\t\tBALANCE_XMIT_POLICY_LAYER34) {\n-\t\tprintf(\"balance xmit policy not as expected.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_bond_xmit_policy_get(test_params->bonded_port_id),\n+\t\t\tBALANCE_XMIT_POLICY_LAYER2, \"balance xmit policy not as expected.\");\n+\n+\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(\n+\t\t\ttest_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER23),\n+\t\t\t\"Failed to set balance xmit policy.\");\n+\n+\tTEST_ASSERT_EQUAL(rte_eth_bond_xmit_policy_get(test_params->bonded_port_id),\n+\t\t\tBALANCE_XMIT_POLICY_LAYER23,\n+\t\t\t\"balance xmit policy not as expected.\");\n+\n+\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(\n+\t\t\ttest_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER34),\n+\t\t\t\"Failed to set balance xmit policy.\");\n+\n+\tTEST_ASSERT_EQUAL(rte_eth_bond_xmit_policy_get(test_params->bonded_port_id),\n+\t\t\tBALANCE_XMIT_POLICY_LAYER34,\n+\t\t\t\"balance xmit policy not as expected.\");\n \n \t/* Invalid port id */\n-\tif (rte_eth_bond_xmit_policy_get(INVALID_PORT_ID) >= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_get(INVALID_PORT_ID),\n+\t\t\t\"Expected call to failed as invalid port specified.\");\n \n \t/* Clean up and remove slaves from bonded device */\n \treturn remove_slaves_and_stop_bonded_device();\n@@ -2752,24 +2439,16 @@ test_balance_l2_tx_burst(void)\n \tint burst_size[TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT] = { 10, 15 };\n \n \tuint16_t pktlen;\n-\n-\tint retval, i;\n+\tint i;\n \tstruct rte_eth_stats port_stats;\n \n-\tretval = initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0,\n-\t\t\tTEST_BALANCE_L2_TX_BURST_SLAVE_COUNT, 1);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n-\t\treturn -1;\n-\t}\n-\n-\tretval = rte_eth_bond_xmit_policy_set(test_params->bonded_port_id,\n-\t\t\tBALANCE_XMIT_POLICY_LAYER2);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to set balance xmit policy.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BALANCE, 0, TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT, 1),\n+\t\t\t\"Failed to initialize_bonded_device_with_slaves.\");\n \n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(\n+\t\t\ttest_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER2),\n+\t\t\t\"Failed to set balance xmit policy.\");\n \n \tinitialize_eth_header(test_params->pkt_eth_hdr,\n \t\t\t(struct ether_addr *)src_mac, (struct ether_addr *)dst_mac_0, 0, 0);\n@@ -2779,54 +2458,50 @@ test_balance_l2_tx_burst(void)\n \t\t\tdst_addr_0, pktlen);\n \n \t/* Generate a burst 1 of packets to transmit */\n-\tif (generate_packet_burst(test_params->mbuf_pool, &pkts_burst[0][0],\n+\tTEST_ASSERT_EQUAL(generate_packet_burst(test_params->mbuf_pool, &pkts_burst[0][0],\n \t\t\ttest_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr, 1,\n \t\t\ttest_params->pkt_udp_hdr, burst_size[0],\n-\t\t\tPACKET_BURST_GEN_PKT_LEN, 1) != burst_size[0])\n-\t\treturn -1;\n+\t\t\tPACKET_BURST_GEN_PKT_LEN, 1), burst_size[0],\n+\t\t\t\"failed to generate packet burst\");\n \n \tinitialize_eth_header(test_params->pkt_eth_hdr,\n \t\t\t(struct ether_addr *)src_mac, (struct ether_addr *)dst_mac_1, 0, 0);\n \n \t/* Generate a burst 2 of packets to transmit */\n-\tif (generate_packet_burst(test_params->mbuf_pool, &pkts_burst[1][0],\n+\tTEST_ASSERT_EQUAL(generate_packet_burst(test_params->mbuf_pool, &pkts_burst[1][0],\n \t\t\ttest_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr, 1,\n \t\t\ttest_params->pkt_udp_hdr, burst_size[1],\n-\t\t\tPACKET_BURST_GEN_PKT_LEN, 1) != burst_size[1])\n-\t\treturn -1;\n+\t\t\tPACKET_BURST_GEN_PKT_LEN, 1), burst_size[1],\n+\t\t\t\"failed to generate packet burst\");\n \n \t/* Send burst 1 on bonded port */\n \tfor (i = 0; i < TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT; i++) {\n-\t\tif (rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkts_burst[i][0],\n-\t\t\tburst_size[i]) != burst_size[i])\n-\t\t\treturn -1;\n+\t\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0,\n+\t\t\t\t&pkts_burst[i][0], burst_size[i]),\n+\t\t\t\tburst_size[i], \"Failed to transmit packet burst\");\n \t}\n+\n \t/* Verify bonded port tx stats */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.opackets != (uint64_t)(burst_size[0] + burst_size[1])) {\n-\t\tprintf(\"Bonded Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\t(unsigned int)port_stats.opackets, burst_size[0] + burst_size[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets,\n+\t\t\t(uint64_t)(burst_size[0] + burst_size[1]),\n+\t\t\t\"Bonded Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.opackets,\n+\t\t\tburst_size[0] + burst_size[1]);\n \n \n \t/* Verify slave ports tx stats */\n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size[0]) {\n-\t\tprintf(\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0],\n-\t\t\t\t(unsigned int)port_stats.opackets, burst_size[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size[0],\n+\t\t\t\"Slave Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[0], (unsigned int)port_stats.opackets,\n+\t\t\tburst_size[0]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size[1]) {\n-\t\tprintf(\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1], (\n-\t\t\t\t\t\tunsigned int)port_stats.opackets, burst_size[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size[1],\n+\t\t\t\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n+\t\t\ttest_params->slave_port_ids[1], (unsigned int)port_stats.opackets,\n+\t\t\tburst_size[1]);\n \n \t/* Put all slaves down and try and transmit */\n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n@@ -2836,9 +2511,9 @@ test_balance_l2_tx_burst(void)\n \t}\n \n \t/* Send burst on bonded port */\n-\tif (rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkts_burst[0][0],\n-\t\t\tburst_size[0]) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, &pkts_burst[0][0], burst_size[0]),\n+\t\t\t0, \"Expected zero packet\");\n \n \t/* Clean up and remove slaves from bonded device */\n \treturn remove_slaves_and_stop_bonded_device();\n@@ -2848,81 +2523,65 @@ static int\n balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4,\n \t\tuint8_t toggle_mac_addr, uint8_t toggle_ip_addr)\n {\n-\tint retval, i;\n-\tint burst_size_1, burst_size_2, nb_tx_1, nb_tx_2;\n+\tint i, burst_size_1, burst_size_2, nb_tx_1, nb_tx_2;\n \n \tstruct rte_mbuf *pkts_burst_1[MAX_PKT_BURST];\n \tstruct rte_mbuf *pkts_burst_2[MAX_PKT_BURST];\n \n \tstruct rte_eth_stats port_stats;\n \n-\tretval = initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0, 2, 1);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BALANCE, 0, 2, 1),\n+\t\t\t\"Failed to initialize_bonded_device_with_slaves.\");\n \n-\tretval = rte_eth_bond_xmit_policy_set(test_params->bonded_port_id,\n-\t\t\tBALANCE_XMIT_POLICY_LAYER23);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to set balance xmit policy.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(\n+\t\t\ttest_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER23),\n+\t\t\t\"Failed to set balance xmit policy.\");\n \n \tburst_size_1 = 20;\n \tburst_size_2 = 10;\n \n-\tif (burst_size_1 > MAX_PKT_BURST || burst_size_2 > MAX_PKT_BURST) {\n-\t\tprintf(\"Burst size specified is greater than supported.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(burst_size_1 < MAX_PKT_BURST || burst_size_2 < MAX_PKT_BURST,\n+\t\t\t\"Burst size specified is greater than supported.\");\n \n \t/* Generate test bursts of packets to transmit */\n-\tif (generate_test_burst(pkts_burst_1, burst_size_1, vlan_enabled, ipv4,\n-\t\t\t0, 0, 0) != burst_size_1)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\tpkts_burst_1, burst_size_1, vlan_enabled, ipv4, 0, 0, 0),\n+\t\t\tburst_size_1, \"failed to generate packet burst\");\n \n-\tif (generate_test_burst(pkts_burst_2, burst_size_2, vlan_enabled, ipv4,\n-\t\t\ttoggle_mac_addr, toggle_ip_addr, 0) != burst_size_2)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(generate_test_burst(pkts_burst_2, burst_size_2, vlan_enabled, ipv4,\n+\t\t\ttoggle_mac_addr, toggle_ip_addr, 0), burst_size_2,\n+\t\t\t\"failed to generate packet burst\");\n \n \t/* Send burst 1 on bonded port */\n \tnb_tx_1 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_1,\n \t\t\tburst_size_1);\n-\tif (nb_tx_1 != burst_size_1)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(nb_tx_1, burst_size_1, \"tx burst failed\");\n \n \t/* Send burst 2 on bonded port */\n \tnb_tx_2 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_2,\n \t\t\tburst_size_2);\n-\tif (nb_tx_2 != burst_size_2)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(nb_tx_2, burst_size_2, \"tx burst failed\");\n \n \t/* Verify bonded port tx stats */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.opackets != (uint64_t)(nb_tx_1 + nb_tx_2)) {\n-\t\tprintf(\"Bonded Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\t(unsigned int)port_stats.opackets, nb_tx_1 + nb_tx_2);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(nb_tx_1 + nb_tx_2),\n+\t\t\t\"Bonded Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.opackets,\n+\t\t\tnb_tx_1 + nb_tx_2);\n \n \t/* Verify slave ports tx stats */\n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)nb_tx_1) {\n-\t\tprintf(\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0],\n-\t\t\t\t(unsigned int)port_stats.opackets, nb_tx_1);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_1,\n+\t\t\t\"Slave Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[0], (unsigned int)port_stats.opackets,\n+\t\t\tnb_tx_1);\n \n \trte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)nb_tx_2) {\n-\t\tprintf(\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1],\n-\t\t\t\t(unsigned int)port_stats.opackets, nb_tx_2);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets,(uint64_t)nb_tx_2,\n+\t\t\t\"Slave Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[1], (unsigned int)port_stats.opackets,\n+\t\t\tnb_tx_2);\n \n \t/* Put all slaves down and try and transmit */\n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n@@ -2932,10 +2591,10 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4,\n \t}\n \n \t/* Send burst on bonded port */\n-\tnb_tx_1 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_1,\n-\t\t\tburst_size_1);\n-\tif (nb_tx_1 != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, pkts_burst_1,\n+\t\t\tburst_size_1), 0, \"Expected zero packet\");\n+\n \n \t/* Clean up and remove slaves from bonded device */\n \treturn remove_slaves_and_stop_bonded_device();\n@@ -2976,82 +2635,66 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4,\n \t\tuint8_t toggle_mac_addr, uint8_t toggle_ip_addr,\n \t\tuint8_t toggle_udp_port)\n {\n-\tint retval, i;\n-\tint burst_size_1, burst_size_2, nb_tx_1, nb_tx_2;\n+\tint i, burst_size_1, burst_size_2, nb_tx_1, nb_tx_2;\n \n \tstruct rte_mbuf *pkts_burst_1[MAX_PKT_BURST];\n \tstruct rte_mbuf *pkts_burst_2[MAX_PKT_BURST];\n \n \tstruct rte_eth_stats port_stats;\n \n-\tretval = initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0, 2, 1);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BALANCE, 0, 2, 1),\n+\t\t\t\"Failed to initialize_bonded_device_with_slaves.\");\n \n-\tretval = rte_eth_bond_xmit_policy_set(test_params->bonded_port_id,\n-\t\t\tBALANCE_XMIT_POLICY_LAYER34);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to set balance xmit policy.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(\n+\t\t\ttest_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER34),\n+\t\t\t\"Failed to set balance xmit policy.\");\n \n \tburst_size_1 = 20;\n \tburst_size_2 = 10;\n \n-\tif (burst_size_1 > MAX_PKT_BURST || burst_size_2 > MAX_PKT_BURST) {\n-\t\tprintf(\"Burst size specified is greater than supported.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(burst_size_1 < MAX_PKT_BURST || burst_size_2 < MAX_PKT_BURST,\n+\t\t\t\"Burst size specified is greater than supported.\");\n \n \t/* Generate test bursts of packets to transmit */\n-\tif (generate_test_burst(pkts_burst_1, burst_size_1, vlan_enabled, ipv4, 0,\n-\t\t\t0, 0) != burst_size_1)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\tpkts_burst_1, burst_size_1, vlan_enabled, ipv4, 0, 0, 0),\n+\t\t\tburst_size_1, \"failed to generate burst\");\n \n-\tif (generate_test_burst(pkts_burst_2, burst_size_2, vlan_enabled, ipv4,\n-\t\t\ttoggle_mac_addr, toggle_ip_addr, toggle_udp_port) != burst_size_2)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(generate_test_burst(pkts_burst_2, burst_size_2,\n+\t\t\tvlan_enabled, ipv4, toggle_mac_addr, toggle_ip_addr,\n+\t\t\ttoggle_udp_port), burst_size_2, \"failed to generate burst\");\n \n \t/* Send burst 1 on bonded port */\n \tnb_tx_1 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_1,\n \t\t\tburst_size_1);\n-\tif (nb_tx_1 != burst_size_1)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(nb_tx_1, burst_size_1, \"tx burst failed\");\n \n \t/* Send burst 2 on bonded port */\n \tnb_tx_2 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_2,\n \t\t\tburst_size_2);\n-\tif (nb_tx_2 != burst_size_2)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(nb_tx_2, burst_size_2, \"tx burst failed\");\n \n \n \t/* Verify bonded port tx stats */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.opackets != (uint64_t)(nb_tx_1 + nb_tx_2)) {\n-\t\tprintf(\"Bonded Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\t(unsigned int)port_stats.opackets, nb_tx_1 + nb_tx_2);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(nb_tx_1 + nb_tx_2),\n+\t\t\t\"Bonded Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.opackets,\n+\t\t\tnb_tx_1 + nb_tx_2);\n \n \t/* Verify slave ports tx stats */\n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)nb_tx_1) {\n-\t\tprintf(\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0],\n-\t\t\t\t(unsigned int)port_stats.opackets, nb_tx_1);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_1,\n+\t\t\t\"Slave Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[0], (unsigned int)port_stats.opackets,\n+\t\t\tnb_tx_1);\n \n \trte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)nb_tx_2) {\n-\t\tprintf(\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1],\n-\t\t\t\t(unsigned int)port_stats.opackets, nb_tx_2);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_2,\n+\t\t\t\"Slave Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[1], (unsigned int)port_stats.opackets,\n+\t\t\tnb_tx_2);\n \n \t/* Put all slaves down and try and transmit */\n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n@@ -3061,10 +2704,9 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4,\n \t}\n \n \t/* Send burst on bonded port */\n-\tnb_tx_1 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_1,\n-\t\t\tburst_size_1);\n-\tif (nb_tx_1 != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, pkts_burst_1,\n+\t\t\tburst_size_1), 0, \"Expected zero packet\");\n \n \t/* Clean up and remove slaves from bonded device */\n \treturn remove_slaves_and_stop_bonded_device();\n@@ -3254,21 +2896,22 @@ test_balance_rx_burst(void)\n \tstruct rte_eth_stats port_stats;\n \n \tint burst_size[TEST_BALANCE_RX_BURST_SLAVE_COUNT] = { 10, 5, 30 };\n-\tint i, j, nb_rx;\n+\tint i, j;\n \n \tmemset(gen_pkt_burst, 0, sizeof(gen_pkt_burst));\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0, 3, 1)\n-\t\t\t!= 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BALANCE, 0, 3, 1),\n+\t\t\t\"Failed to intialise bonded device\");\n \n \t/* Generate test bursts of packets to transmit */\n \tfor (i = 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) {\n-\t\tif (generate_test_burst(&gen_pkt_burst[i][0], burst_size[i], 0, 0, 1,\n-\t\t\t\t0, 0) != burst_size[i])\n-\t\t\treturn -1;\n+\t\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t\t&gen_pkt_burst[i][0], burst_size[i], 0, 0, 1, 0, 0),\n+\t\t\t\tburst_size[i],\"failed to generate packet burst\");\n \t}\n+\n \t/* Add rx data to slaves */\n \tfor (i = 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) {\n \t\tvirtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],\n@@ -3277,56 +2920,44 @@ test_balance_rx_burst(void)\n \n \t/* Call rx burst on bonded device */\n \t/* Send burst on bonded port */\n-\tnb_rx = rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst,\n-\t\t\tMAX_PKT_BURST);\n-\tif (nb_rx != burst_size[0] + burst_size[1] + burst_size[2]) {\n-\t\tprintf(\"balance rx burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_rx_burst(test_params->bonded_port_id, 0,\n+\t\t\trx_pkt_burst, MAX_PKT_BURST),\n+\t\t\tburst_size[0] + burst_size[1] + burst_size[2],\n+\t\t\t\"balance rx burst failed\\n\");\n \n \t/* Verify bonded device rx count */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)(burst_size[0] + burst_size[1] +\n-\t\t\tburst_size[2])) {\n-\t\tprintf(\"Bonded Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.ipackets,\n-\t\t\t\tburst_size[0] + burst_size[1] + burst_size[2]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets,\n+\t\t\t(uint64_t)(burst_size[0] + burst_size[1] + burst_size[2]),\n+\t\t\t\"Bonded Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.ipackets,\n+\t\t\tburst_size[0] + burst_size[1] + burst_size[2]);\n \n \n \t/* Verify bonded slave devices rx counts */\n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)burst_size[0]) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0],\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n \t\t\t\ttest_params->slave_port_ids[0],\n \t\t\t\t(unsigned int)port_stats.ipackets, burst_size[0]);\n-\t\treturn -1;\n-\t}\n \n \trte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)burst_size[1]) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1],\n-\t\t\t\t(unsigned int)port_stats.ipackets, burst_size[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[1],\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[1], (unsigned int)port_stats.ipackets,\n+\t\t\tburst_size[1]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)burst_size[2]) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[2],\n-\t\t\t\t(unsigned int)port_stats.ipackets, burst_size[2]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[2],\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[2], (unsigned int)port_stats.ipackets,\n+\t\t\tburst_size[2]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);\n-\tif (port_stats.ipackets != 0) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[3],\n-\t\t\t\t(unsigned int)port_stats.ipackets, 0);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, 0,\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[3],\t(unsigned int)port_stats.ipackets,\n+\t\t\t0);\n \n \t/* free mbufs */\n \tfor (i = 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) {\n@@ -3345,48 +2976,37 @@ test_balance_rx_burst(void)\n static int\n test_balance_verify_promiscuous_enable_disable(void)\n {\n-\tint i, promiscuous_en;\n+\tint i;\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0, 4, 1) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BALANCE, 0, 4, 1),\n+\t\t\t\"Failed to intialise bonded device\");\n \n \trte_eth_promiscuous_enable(test_params->bonded_port_id);\n \n-\tpromiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);\n-\tif (promiscuous_en != 1) {\n-\t\tprintf(\"Port (%d) promiscuous mode not enabled\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1,\n+\t\t\t\"Port (%d) promiscuous mode not enabled\",\n+\t\t\ttest_params->bonded_port_id);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n-\t\tpromiscuous_en = rte_eth_promiscuous_get(\n+\t\tTEST_ASSERT_EQUAL(rte_eth_promiscuous_get(\n+\t\t\t\ttest_params->slave_port_ids[i]), 1,\n+\t\t\t\t\"Port (%d) promiscuous mode not enabled\",\n \t\t\t\ttest_params->slave_port_ids[i]);\n-\t\tif (promiscuous_en != 1) {\n-\t\t\tprintf(\"slave port (%d) promiscuous mode not enabled\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n \t}\n \n \trte_eth_promiscuous_disable(test_params->bonded_port_id);\n \n-\tpromiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);\n-\tif (promiscuous_en != 0) {\n-\t\tprintf(\"Port (%d) promiscuous mode not disabled\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0,\n+\t\t\t\"Port (%d) promiscuous mode not disabled\",\n+\t\t\ttest_params->bonded_port_id);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n-\t\tpromiscuous_en = rte_eth_promiscuous_get(\n+\t\tTEST_ASSERT_EQUAL(rte_eth_promiscuous_get(\n+\t\t\t\ttest_params->slave_port_ids[i]), 0,\n+\t\t\t\t\"Port (%d) promiscuous mode not disabled\",\n \t\t\t\ttest_params->slave_port_ids[i]);\n-\t\tif (promiscuous_en != 0) {\n-\t\t\tprintf(\"slave port (%d) promiscuous mode not disabled\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n \t}\n \n \t/* Clean up and remove slaves from bonded device */\n@@ -3402,115 +3022,102 @@ test_balance_verify_mac_assignment(void)\n \trte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1);\n \n \t/* Initialize bonded device with 2 slaves in active backup mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0, 2, 1) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BALANCE, 0, 2, 1),\n+\t\t\t\"Failed to intialise bonded device\");\n \n \t/* Verify that bonded MACs is that of first slave and that the other slave\n \t * MAC hasn't been changed */\n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->bonded_port_id);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->slave_port_ids[0]);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->slave_port_ids[1]);\n \n \t/* change primary and verify that MAC addresses haven't changed */\n-\tif (rte_eth_bond_primary_set(test_params->bonded_port_id,\n-\t\t\ttest_params->slave_port_ids[1]) != 0) {\n-\t\tprintf(\"Failed to set bonded port (%d) primary port to (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, test_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id,\n+\t\t\ttest_params->slave_port_ids[1]),\n+\t\t\t\"Failed to set bonded port (%d) primary port to (%d)\\n\",\n+\t\t\ttest_params->bonded_port_id, test_params->slave_port_ids[1]);\n \n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->bonded_port_id);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->slave_port_ids[0]);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->slave_port_ids[1]);\n \n \t/* stop / start bonded device and verify that primary MAC address is\n \t * propagated to bonded device and slaves */\n \n \trte_eth_dev_stop(test_params->bonded_port_id);\n \n-\tif (rte_eth_dev_start(test_params->bonded_port_id) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),\n+\t\t\t\"Failed to start bonded device\");\n \n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->bonded_port_id);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->slave_port_ids[0]);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\ttest_params->slave_port_ids[1]);\n \n \t/* Set explicit MAC address */\n-\tif (rte_eth_bond_mac_address_set(test_params->bonded_port_id,\n-\t\t\t(struct ether_addr *)bonded_mac) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set(\n+\t\t\ttest_params->bonded_port_id, (struct ether_addr *)bonded_mac),\n+\t\t\t\"failed to set MAC\");\n \n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(&bonded_mac, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of bonded port\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of bonded port\",\n+\t\t\ttest_params->bonded_port_id);\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);\n-\tif (memcmp(&bonded_mac, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not as expected\\n\",\n+\tTEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not as expected\\n\",\n \t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);\n-\tif (memcmp(&bonded_mac, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"slave port (%d) mac address not set to that of bonded port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"slave port (%d) mac address not set to that of bonded port\",\n+\t\t\ttest_params->slave_port_ids[1]);\n \n \t/* Clean up and remove slaves from bonded device */\n \treturn remove_slaves_and_stop_bonded_device();\n@@ -3532,32 +3139,27 @@ test_balance_verify_slave_link_status_change_behaviour(void)\n \tmemset(pkt_burst, 0, sizeof(pkt_burst));\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0,\n-\t\t\tTEST_BALANCE_LINK_STATUS_SLAVE_COUNT, 1) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BALANCE, 0, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT, 1),\n+\t\t\t\"Failed to intialise bonded device\");\n+\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(\n+\t\t\ttest_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER2),\n+\t\t\t\"Failed to set balance xmit policy.\");\n \n-\tif (rte_eth_bond_xmit_policy_set(test_params->bonded_port_id,\n-\t\t\tBALANCE_XMIT_POLICY_LAYER2)) {\n-\t\tprintf(\"Failed to set balance xmit policy.\\n\");\n-\t\treturn -1;\n-\t}\n \n \t/* Verify Current Slaves Count /Active Slave Count is */\n \tslave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves,\n \t\t\tRTE_MAX_ETHPORTS);\n-\tif (slave_count != TEST_BALANCE_LINK_STATUS_SLAVE_COUNT) {\n-\t\tprintf(\"Number of slaves (%d) is not as expected (%d).\\n\", slave_count,\n-\t\t\t\tTEST_BALANCE_LINK_STATUS_SLAVE_COUNT);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(slave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT,\n+\t\t\t\"Number of slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT);\n \n \tslave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,\n \t\t\tslaves, RTE_MAX_ETHPORTS);\n-\tif (slave_count != TEST_BALANCE_LINK_STATUS_SLAVE_COUNT) {\n-\t\tprintf(\"Number of active slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(slave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT,\n+\t\t\t\"Number of active slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT);\n \n \t/* Set 2 slaves link status to down */\n \tvirtual_ethdev_simulate_link_status_interrupt(\n@@ -3565,106 +3167,80 @@ test_balance_verify_slave_link_status_change_behaviour(void)\n \tvirtual_ethdev_simulate_link_status_interrupt(\n \t\t\ttest_params->slave_port_ids[3], 0);\n \n-\tif (rte_eth_bond_active_slaves_get(test_params->bonded_port_id,\n-\t\t\tslaves, RTE_MAX_ETHPORTS) != 2) {\n-\t\tprintf(\"Number of active slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, 2);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get(\n+\t\t\ttest_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 2,\n+\t\t\t\"Number of active slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, 2);\n \n \t/* Send to sets of packet burst and verify that they are balanced across\n \t *  slaves */\n \tburst_size = 21;\n \n-\tif (generate_test_burst(&pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0) !=\n-\t\t\tburst_size) {\n-\t\tprintf(\"generate_test_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t&pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0), burst_size,\n+\t\t\t\"generate_test_burst failed\");\n \n-\tif (generate_test_burst(&pkt_burst[1][0], burst_size, 0, 1, 1, 0, 0) !=\n-\t\t\tburst_size) {\n-\t\tprintf(\"generate_test_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t&pkt_burst[1][0], burst_size, 0, 1, 1, 0, 0), burst_size,\n+\t\t\t\"generate_test_burst failed\");\n \n-\tif (rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt_burst[0][0],\n-\t\t\tburst_size) != burst_size) {\n-\t\tprintf(\"rte_eth_tx_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, &pkt_burst[0][0], burst_size),\n+\t\t\tburst_size, \"rte_eth_tx_burst failed\");\n+\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, &pkt_burst[1][0], burst_size),\n+\t\t\tburst_size, \"rte_eth_tx_burst failed\");\n \n-\tif (rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt_burst[1][0],\n-\t\t\tburst_size) != burst_size) {\n-\t\tprintf(\"rte_eth_tx_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n \n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.opackets != (uint64_t)(burst_size + burst_size)) {\n-\t\tprintf(\"(%d) port_stats.opackets (%d) not as expected (%d).\\n\",\n-\t\t\t\ttest_params->bonded_port_id, (int)port_stats.opackets,\n-\t\t\t\tburst_size + burst_size);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size + burst_size),\n+\t\t\t\"(%d) port_stats.opackets (%d) not as expected (%d).\",\n+\t\t\ttest_params->bonded_port_id, (int)port_stats.opackets,\n+\t\t\tburst_size + burst_size);\n \n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size) {\n-\t\tprintf(\"(%d) port_stats.opackets (%d) not as expected (%d).\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0], (int)port_stats.opackets,\n-\t\t\t\tburst_size);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n+\t\t\t\"(%d) port_stats.opackets (%d) not as expected (%d).\",\n+\t\t\ttest_params->slave_port_ids[0], (int)port_stats.opackets,\n+\t\t\tburst_size);\n \n \trte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size) {\n-\t\tprintf(\"(%d) port_stats.opackets (%d) not as expected (%d).\\n\",\n-\t\t\t\ttest_params->slave_port_ids[2], (int)port_stats.opackets,\n-\t\t\t\tburst_size);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n+\t\t\t\"(%d) port_stats.opackets (%d) not as expected (%d).\",\n+\t\t\ttest_params->slave_port_ids[2], (int)port_stats.opackets,\n+\t\t\tburst_size);\n \n \t/* verify that all packets get send on primary slave when no other slaves\n \t * are available */\n \tvirtual_ethdev_simulate_link_status_interrupt(\n \t\t\ttest_params->slave_port_ids[2], 0);\n \n-\tif (rte_eth_bond_active_slaves_get(test_params->bonded_port_id, slaves,\n-\t\t\tRTE_MAX_ETHPORTS) != 1) {\n-\t\tprintf(\"Number of active slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, 1);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get(\n+\t\t\ttest_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 1,\n+\t\t\t\"Number of active slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, 1);\n \n-\tif (generate_test_burst(&pkt_burst[1][0], burst_size, 0, 1, 1, 0, 0) !=\n-\t\t\tburst_size) {\n-\t\tprintf(\"generate_test_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t&pkt_burst[1][0], burst_size, 0, 1, 1, 0, 0), burst_size,\n+\t\t\t\"generate_test_burst failed\");\n \n-\tif (rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt_burst[1][0],\n-\t\t\tburst_size) != burst_size) {\n-\t\tprintf(\"rte_eth_tx_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, &pkt_burst[1][0], burst_size),\n+\t\t\tburst_size, \"rte_eth_tx_burst failed\");\n \n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.opackets != (uint64_t)(burst_size + burst_size +\n-\t\t\tburst_size)) {\n-\t\tprintf(\"(%d) port_stats.opackets (%d) not as expected (%d).\\n\",\n-\t\t\t\ttest_params->bonded_port_id, (int)port_stats.opackets,\n-\t\t\t\tburst_size + burst_size + burst_size);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets,\n+\t\t\t(uint64_t)(burst_size + burst_size + burst_size),\n+\t\t\t\"(%d) port_stats.opackets (%d) not as expected (%d).\\n\",\n+\t\t\ttest_params->bonded_port_id, (int)port_stats.opackets,\n+\t\t\tburst_size + burst_size + burst_size);\n \n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)(burst_size + burst_size)) {\n-\t\tprintf(\"(%d) port_stats.opackets (%d) not as expected (%d).\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0], (int)port_stats.opackets,\n-\t\t\t\tburst_size + burst_size);\n-\t\treturn -1;\n-\t}\n-\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size + burst_size),\n+\t\t\t\"(%d) port_stats.opackets (%d) not as expected (%d).\",\n+\t\t\ttest_params->slave_port_ids[0], (int)port_stats.opackets,\n+\t\t\tburst_size + burst_size);\n \n \tvirtual_ethdev_simulate_link_status_interrupt(\n \t\t\ttest_params->slave_port_ids[0], 0);\n@@ -3676,16 +3252,14 @@ test_balance_verify_slave_link_status_change_behaviour(void)\n \t\t\ttest_params->slave_port_ids[3], 1);\n \n \tfor (i = 0; i < TEST_BALANCE_LINK_STATUS_SLAVE_COUNT; i++) {\n-\t\tif (generate_test_burst(&pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0) !=\n-\t\t\t\tburst_size)\n-\t\t\treturn -1;\n+\t\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t\t&pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0), burst_size,\n+\t\t\t\t\"Failed to generate packet burst\");\n \n \t\tvirtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],\n \t\t\t\t&pkt_burst[i][0], burst_size);\n \t}\n \n-\n-\n \t/* Verify that pkts are not received on slaves with link status down */\n \n \trte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst,\n@@ -3693,12 +3267,10 @@ test_balance_verify_slave_link_status_change_behaviour(void)\n \n \t/* Verify bonded device rx count */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)(burst_size * 3)) {\n-\t\tprintf(\"(%d) port_stats.ipackets (%d) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, (int)port_stats.ipackets,\n-\t\t\t\tburst_size * 3);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)(burst_size * 3),\n+\t\t\t\"(%d) port_stats.ipackets (%d) not as expected (%d)\\n\",\n+\t\t\ttest_params->bonded_port_id, (int)port_stats.ipackets,\n+\t\t\tburst_size * 3);\n \n \t/* free mbufs allocate for rx testing */\n \tfor (i = 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) {\n@@ -3720,16 +3292,14 @@ test_balance_verify_slave_link_status_change_behaviour(void)\n static int\n test_broadcast_tx_burst(void)\n {\n-\tint i, pktlen, retval, burst_size, generated_burst_size, nb_tx;\n+\tint i, pktlen, burst_size;\n \tstruct rte_mbuf *pkts_burst[MAX_PKT_BURST];\n \n \tstruct rte_eth_stats port_stats;\n \n-\tretval = initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST, 0, 2, 1);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BROADCAST, 0, 2, 1),\n+\t\t\t\"Failed to intialise bonded device\");\n \n \tinitialize_eth_header(test_params->pkt_eth_hdr,\n \t\t\t(struct ether_addr *)src_mac, (struct ether_addr *)dst_mac_0, 0, 0);\n@@ -3741,46 +3311,37 @@ test_broadcast_tx_burst(void)\n \n \tburst_size = 20 * test_params->bonded_slave_count;\n \n-\tif (burst_size > MAX_PKT_BURST) {\n-\t\tprintf(\"Burst size specified is greater than supported.\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT(burst_size < MAX_PKT_BURST,\n+\t\t\t\"Burst size specified is greater than supported.\");\n \n \t/* Generate a burst of packets to transmit */\n-\tgenerated_burst_size = generate_packet_burst(test_params->mbuf_pool,\n+\tTEST_ASSERT_EQUAL(generate_packet_burst(test_params->mbuf_pool,\n \t\t\tpkts_burst,\ttest_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr,\n \t\t\t1, test_params->pkt_udp_hdr, burst_size, PACKET_BURST_GEN_PKT_LEN,\n-\t\t\t1);\n-\tif (generated_burst_size != burst_size)\n-\t\treturn -1;\n+\t\t\t1), burst_size, \"Failed to generate packet burst\");\n \n \t/* Send burst on bonded port */\n-\tnb_tx = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst,\n-\t\t\tburst_size);\n-\tif (nb_tx != burst_size) {\n-\t\tprintf(\"Bonded Port (%d) rx burst failed, packets transmitted value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\tnb_tx, burst_size);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0,\n+\t\t\tpkts_burst, burst_size), burst_size,\n+\t\t\t\"Bonded Port (%d) rx burst failed, packets transmitted value \"\n+\t\t\t\"not as expected (%d)\",\n+\t\t\ttest_params->bonded_port_id, burst_size);\n \n \t/* Verify bonded port tx stats */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size *\n-\t\t\ttest_params->bonded_slave_count) {\n-\t\tprintf(\"Bonded Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.opackets,\n-\t\t\t\tburst_size);\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets,\n+\t\t\t(uint64_t)burst_size * test_params->bonded_slave_count,\n+\t\t\t\"Bonded Port (%d) opackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.opackets,\n+\t\t\tburst_size);\n \n \t/* Verify slave ports tx stats */\n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_stats_get(test_params->slave_port_ids[i], &port_stats);\n-\t\tif (port_stats.opackets != (uint64_t)burst_size) {\n-\t\t\tprintf(\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\t\ttest_params->bonded_port_id,\n-\t\t\t\t\t(unsigned int)port_stats.opackets, burst_size);\n-\t\t}\n+\t\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n+\t\t\t\t\"Slave Port (%d) opackets value (%u) not as expected (%d)\\n\",\n+\t\t\t\ttest_params->bonded_port_id,\n+\t\t\t\t(unsigned int)port_stats.opackets, burst_size);\n \t}\n \n \t/* Put all slaves down and try and transmit */\n@@ -3791,10 +3352,9 @@ test_broadcast_tx_burst(void)\n \t}\n \n \t/* Send burst on bonded port */\n-\tnb_tx = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst,\n-\t\t\tburst_size);\n-\tif (nb_tx != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, pkts_burst, burst_size),  0,\n+\t\t\t\"transmitted an unexpected number of packets\");\n \n \t/* Clean up and remove slaves from bonded device */\n \treturn remove_slaves_and_stop_bonded_device();\n@@ -3930,20 +3490,20 @@ test_broadcast_rx_burst(void)\n \tstruct rte_eth_stats port_stats;\n \n \tint burst_size[BROADCAST_RX_BURST_NUM_OF_SLAVES] = { 10, 5, 30 };\n-\tint i, j, nb_rx;\n+\tint i, j;\n \n \tmemset(gen_pkt_burst, 0, sizeof(gen_pkt_burst));\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST, 0, 3, 1) != 0)\n-\t\treturn -1;\n-\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BROADCAST, 0, 3, 1),\n+\t\t\t\"Failed to intialise bonded device\");\n \n \t/* Generate test bursts of packets to transmit */\n \tfor (i = 0; i < BROADCAST_RX_BURST_NUM_OF_SLAVES; i++) {\n-\t\tif (generate_test_burst(&gen_pkt_burst[i][0], burst_size[i], 0, 0, 1, 0,\n-\t\t\t\t0) != burst_size[i])\n-\t\t\treturn -1;\n+\t\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t\t&gen_pkt_burst[i][0], burst_size[i], 0, 0, 1, 0, 0),\n+\t\t\t\tburst_size[i], \"failed to generate packet burst\");\n \t}\n \n \t/* Add rx data to slave 0 */\n@@ -3955,57 +3515,44 @@ test_broadcast_rx_burst(void)\n \n \t/* Call rx burst on bonded device */\n \t/* Send burst on bonded port */\n-\tnb_rx = rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst,\n-\t\t\tMAX_PKT_BURST);\n-\tif (nb_rx != burst_size[0] + burst_size[1] + burst_size[2]) {\n-\t\tprintf(\"round-robin rx burst failed\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_rx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST),\n+\t\t\tburst_size[0] + burst_size[1] + burst_size[2],\n+\t\t\t\"rx burst failed\");\n \n \t/* Verify bonded device rx count */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)(burst_size[0] + burst_size[1] +\n-\t\t\tburst_size[2])) {\n-\t\tprintf(\"Bonded Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.ipackets,\n-\t\t\t\tburst_size[0] + burst_size[1] + burst_size[2]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets,\n+\t\t\t(uint64_t)(burst_size[0] + burst_size[1] + burst_size[2]),\n+\t\t\t\"Bonded Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->bonded_port_id, (unsigned int)port_stats.ipackets,\n+\t\t\tburst_size[0] + burst_size[1] + burst_size[2]);\n \n \n \t/* Verify bonded slave devices rx counts */\n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)burst_size[0]) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0],\n-\t\t\t\t(unsigned int)port_stats.ipackets, burst_size[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0],\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[0], (unsigned int)port_stats.ipackets,\n+\t\t\tburst_size[0]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)burst_size[1]) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[1],\n-\t\t\t\t(unsigned int)port_stats.ipackets, burst_size[1]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[1],\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[0], (unsigned int)port_stats.ipackets,\n+\t\t\tburst_size[1]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)burst_size[2]) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[2],\n-\t\t\t\t(unsigned int)port_stats.ipackets,\n-\t\t\t\tburst_size[2]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[2],\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[2], (unsigned int)port_stats.ipackets,\n+\t\t\tburst_size[2]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);\n-\tif (port_stats.ipackets != 0) {\n-\t\tprintf(\"Slave Port (%d) ipackets value (%u) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->slave_port_ids[3],\n-\t\t\t\t(unsigned int)port_stats.ipackets, 0);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, 0,\n+\t\t\t\"Slave Port (%d) ipackets value (%u) not as expected (%d)\",\n+\t\t\ttest_params->slave_port_ids[3], (unsigned int)port_stats.ipackets,\n+\t\t\t0);\n \n \t/* free mbufs allocate for rx testing */\n \tfor (i = 0; i < BROADCAST_RX_BURST_NUM_OF_SLAVES; i++) {\n@@ -4024,48 +3571,38 @@ test_broadcast_rx_burst(void)\n static int\n test_broadcast_verify_promiscuous_enable_disable(void)\n {\n-\tint i, promiscuous_en;\n+\tint i;\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0, 4, 1) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BROADCAST, 0, 4, 1),\n+\t\t\t\"Failed to intialise bonded device\");\n \n \trte_eth_promiscuous_enable(test_params->bonded_port_id);\n \n-\tpromiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);\n-\tif (promiscuous_en != 1) {\n-\t\tprintf(\"Port (%d) promiscuous mode not enabled\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\n+\tTEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1,\n+\t\t\t\"Port (%d) promiscuous mode not enabled\",\n+\t\t\ttest_params->bonded_port_id);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n-\t\tpromiscuous_en = rte_eth_promiscuous_get(\n+\t\tTEST_ASSERT_EQUAL(rte_eth_promiscuous_get(\n+\t\t\t\ttest_params->slave_port_ids[i]), 1,\n+\t\t\t\t\"Port (%d) promiscuous mode not enabled\",\n \t\t\t\ttest_params->slave_port_ids[i]);\n-\t\tif (promiscuous_en != 1) {\n-\t\t\tprintf(\"slave port (%d) promiscuous mode not enabled\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n \t}\n \n \trte_eth_promiscuous_disable(test_params->bonded_port_id);\n \n-\tpromiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id);\n-\tif (promiscuous_en != 0) {\n-\t\tprintf(\"Port (%d) promiscuous mode not disabled\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0,\n+\t\t\t\"Port (%d) promiscuous mode not disabled\",\n+\t\t\ttest_params->bonded_port_id);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n-\t\tpromiscuous_en = rte_eth_promiscuous_get(\n+\t\tTEST_ASSERT_EQUAL(rte_eth_promiscuous_get(\n+\t\t\t\ttest_params->slave_port_ids[i]), 0,\n+\t\t\t\t\"Port (%d) promiscuous mode not disabled\",\n \t\t\t\ttest_params->slave_port_ids[i]);\n-\t\tif (promiscuous_en != 0) {\n-\t\t\tprintf(\"slave port (%d) promiscuous mode not disabled\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n \t}\n \n \t/* Clean up and remove slaves from bonded device */\n@@ -4077,45 +3614,39 @@ test_broadcast_verify_mac_assignment(void)\n {\n \tstruct ether_addr read_mac_addr, expected_mac_addr_0, expected_mac_addr_1;\n \n-\tint i, retval;\n+\tint i;\n \n \trte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0);\n \trte_eth_macaddr_get(test_params->slave_port_ids[2], &expected_mac_addr_1);\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST, 0, 4, 1) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\tBONDING_MODE_BROADCAST, 0, 4, 1),\n+\t\t\t\"Failed to intialise bonded device\");\n \n \t/* Verify that all MACs are the same as first slave added to bonded\n \t * device */\n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);\n-\t\tif (memcmp(&expected_mac_addr_0, &read_mac_addr,\n-\t\t\t\tsizeof(read_mac_addr))) {\n-\t\t\tprintf(\"slave port (%d) mac address not set to that of primary port\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\"slave port (%d) mac address not set to that of primary port\",\n+\t\t\t\ttest_params->slave_port_ids[i]);\n \t}\n \n \t/* change primary and verify that MAC addresses haven't changed */\n-\tretval = rte_eth_bond_primary_set(test_params->bonded_port_id,\n-\t\t\ttest_params->slave_port_ids[2]);\n-\tif (retval != 0) {\n-\t\tprintf(\"Failed to set bonded port (%d) primary port to (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, test_params->slave_port_ids[i]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id,\n+\t\t\ttest_params->slave_port_ids[2]),\n+\t\t\t\"Failed to set bonded port (%d) primary port to (%d)\",\n+\t\t\ttest_params->bonded_port_id, test_params->slave_port_ids[i]);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);\n-\t\tif (memcmp(&expected_mac_addr_0, &read_mac_addr,\n-\t\t\t\tsizeof(read_mac_addr))) {\n-\t\t\tprintf(\"slave port (%d) mac address has changed to that of primary\"\n-\t\t\t\t\t\"port without stop/start toggle of bonded device\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\"slave port (%d) mac address has changed to that of primary \"\n+\t\t\t\t\"port without stop/start toggle of bonded device\",\n+\t\t\t\ttest_params->slave_port_ids[i]);\n \t}\n \n \t/* stop / start bonded device and verify that primary MAC address is\n@@ -4123,45 +3654,41 @@ test_broadcast_verify_mac_assignment(void)\n \n \trte_eth_dev_stop(test_params->bonded_port_id);\n \n-\tif (rte_eth_dev_start(test_params->bonded_port_id) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),\n+\t\t\t\"Failed to start bonded device\");\n \n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of new primary\"\n-\t\t\t\t\" port\\n\", test_params->slave_port_ids[i]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of new primary  port\",\n+\t\t\ttest_params->slave_port_ids[i]);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);\n-\t\tif (memcmp(&expected_mac_addr_1, &read_mac_addr,\n-\t\t\t\tsizeof(read_mac_addr))) {\n-\t\t\tprintf(\"slave port (%d) mac address not set to that of new primary\"\n-\t\t\t\t\t\"port\\n\", test_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\"slave port (%d) mac address not set to that of new primary\"\n+\t\t\t\t\"port\", test_params->slave_port_ids[i]);\n \t}\n \n \t/* Set explicit MAC address */\n-\tif (rte_eth_bond_mac_address_set(test_params->bonded_port_id,\n-\t\t\t(struct ether_addr *)bonded_mac) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set(\n+\t\t\ttest_params->bonded_port_id, (struct ether_addr *)bonded_mac),\n+\t\t\t\"Failed to set MAC address\");\n \n \trte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);\n-\tif (memcmp(bonded_mac, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\tprintf(\"bonded port (%d) mac address not set to that of new primary port\\n\",\n-\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,\n+\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\"bonded port (%d) mac address not set to that of new primary port\",\n+\t\t\ttest_params->slave_port_ids[i]);\n+\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++) {\n \t\trte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);\n-\t\tif (memcmp(bonded_mac, &read_mac_addr, sizeof(read_mac_addr))) {\n-\t\t\tprintf(\"slave port (%d) mac address not set to that of new primary port\\n\",\n-\t\t\t\t\ttest_params->slave_port_ids[i]);\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,\n+\t\t\t\tsizeof(read_mac_addr)),\n+\t\t\t\t\"slave port (%d) mac address not set to that of new primary \"\n+\t\t\t\t\"port\", test_params->slave_port_ids[i]);\n \t}\n \n \t/* Clean up and remove slaves from bonded device */\n@@ -4183,26 +3710,22 @@ test_broadcast_verify_slave_link_status_change_behaviour(void)\n \tmemset(pkt_burst, 0, sizeof(pkt_burst));\n \n \t/* Initialize bonded device with 4 slaves in round robin mode */\n-\tif (initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST, 0,\n-\t\t\tBROADCAST_LINK_STATUS_NUM_OF_SLAVES, 1) != 0)\n-\t\treturn -1;\n+\tTEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(\n+\t\t\t\tBONDING_MODE_BROADCAST, 0, BROADCAST_LINK_STATUS_NUM_OF_SLAVES,\n+\t\t\t\t1), \"Failed to intialise bonded device\");\n \n \t/* Verify Current Slaves Count /Active Slave Count is */\n \tslave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves,\n \t\t\tRTE_MAX_ETHPORTS);\n-\tif (slave_count != 4) {\n-\t\tprintf(\"Number of slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, 4);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(slave_count, 4,\n+\t\t\t\"Number of slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, 4);\n \n-\tslave_count = rte_eth_bond_active_slaves_get(\n-\t\t\ttest_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS);\n-\tif (slave_count != 4) {\n-\t\tprintf(\"Number of active slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, 4);\n-\t\treturn -1;\n-\t}\n+\tslave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,\n+\t\t\tslaves, RTE_MAX_ETHPORTS);\n+\tTEST_ASSERT_EQUAL(slave_count, 4,\n+\t\t\t\"Number of active slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, 4);\n \n \t/* Set 2 slaves link status to down */\n \tvirtual_ethdev_simulate_link_status_interrupt(\n@@ -4212,11 +3735,9 @@ test_broadcast_verify_slave_link_status_change_behaviour(void)\n \n \tslave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,\n \t\t\tslaves, RTE_MAX_ETHPORTS);\n-\tif (slave_count != 2) {\n-\t\tprintf(\"Number of active slaves (%d) is not as expected (%d).\\n\",\n-\t\t\t\tslave_count, 2);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(slave_count, 2,\n+\t\t\t\"Number of active slaves (%d) is not as expected (%d).\",\n+\t\t\tslave_count, 2);\n \n \tfor (i = 0; i < test_params->bonded_slave_count; i++)\n \t\trte_eth_stats_reset(test_params->slave_port_ids[i]);\n@@ -4224,80 +3745,62 @@ test_broadcast_verify_slave_link_status_change_behaviour(void)\n \t/* Verify that pkts are not sent on slaves with link status down */\n \tburst_size = 21;\n \n-\tif (generate_test_burst(&pkt_burst[0][0], burst_size, 0, 0, 1, 0, 0) !=\n-\t\t\tburst_size) {\n-\t\tprintf(\"generate_test_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t&pkt_burst[0][0], burst_size, 0, 0, 1, 0, 0), burst_size,\n+\t\t\t\"generate_test_burst failed\");\n \n-\tif (rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt_burst[0][0],\n-\t\t\tburst_size) != burst_size) {\n-\t\tprintf(\"rte_eth_tx_burst failed\\n\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0,\n+\t\t\t&pkt_burst[0][0], burst_size), burst_size,\n+\t\t\t\"rte_eth_tx_burst failed\\n\");\n \n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.opackets != (uint64_t)(burst_size * slave_count)) {\n-\t\tprintf(\"(%d) port_stats.opackets (%d) not as expected (%d)\\n\",\n-\t\t\t\ttest_params->bonded_port_id, (int)port_stats.opackets,\n-\t\t\t\tburst_size * slave_count);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size * slave_count),\n+\t\t\t\"(%d) port_stats.opackets (%d) not as expected (%d)\\n\",\n+\t\t\ttest_params->bonded_port_id, (int)port_stats.opackets,\n+\t\t\tburst_size * slave_count);\n \n \trte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[0]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n+\t\t\t\"(%d) port_stats.opackets not as expected\",\n+\t\t\ttest_params->slave_port_ids[0]);\n \n \trte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);\n-\tif (port_stats.opackets != 0) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, 0,\n+\t\t\t\"(%d) port_stats.opackets not as expected\",\n \t\t\t\ttest_params->slave_port_ids[1]);\n-\t\treturn -1;\n-\t}\n \n \trte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);\n-\tif (port_stats.opackets != (uint64_t)burst_size) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,\n+\t\t\t\"(%d) port_stats.opackets not as expected\",\n \t\t\t\ttest_params->slave_port_ids[2]);\n-\t\treturn -1;\n-\t}\n+\n \n \trte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);\n-\tif (port_stats.opackets != 0) {\n-\t\tprintf(\"(%d) port_stats.opackets not as expected\\n\",\n-\t\t\t\ttest_params->slave_port_ids[3]);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.opackets, 0,\n+\t\t\t\"(%d) port_stats.opackets not as expected\",\n+\t\t\ttest_params->slave_port_ids[3]);\n+\n \n \tfor (i = 0; i < BROADCAST_LINK_STATUS_NUM_OF_SLAVES; i++) {\n-\t\tif (generate_test_burst(&pkt_burst[i][0], burst_size, 0, 0, 1, 0, 0) !=\n-\t\t\t\tburst_size) {\n-\t\t\treturn -1;\n-\t\t}\n+\t\tTEST_ASSERT_EQUAL(generate_test_burst(\n+\t\t\t\t&pkt_burst[i][0], burst_size, 0, 0, 1, 0, 0),\n+\t\t\t\tburst_size, \"failed to generate packet burst\");\n \n \t\tvirtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],\n \t\t\t\t&pkt_burst[i][0], burst_size);\n \t}\n \n \t/* Verify that pkts are not received on slaves with link status down */\n+\tTEST_ASSERT_EQUAL(rte_eth_rx_burst(\n+\t\t\ttest_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST),\n+\t\t\tburst_size + burst_size, \"rte_eth_rx_burst failed\");\n \n-\tif (rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst,\n-\t\t\tMAX_PKT_BURST) !=\n-\t\t\tburst_size + burst_size) {\n-\t\tprintf(\"rte_eth_rx_burst\\n\");\n-\t\treturn -1;\n-\t}\n \n \t/* Verify bonded device rx count */\n \trte_eth_stats_get(test_params->bonded_port_id, &port_stats);\n-\tif (port_stats.ipackets != (uint64_t)(burst_size + burst_size)) {\n-\t\tprintf(\"(%d) port_stats.ipackets not as expected\\n\",\n-\t\t\t\ttest_params->bonded_port_id);\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)(burst_size + burst_size),\n+\t\t\t\"(%d) port_stats.ipackets not as expected\\n\",\n+\t\t\ttest_params->bonded_port_id);\n \n \t/* free mbufs allocate for rx testing */\n \tfor (i = 0; i < BROADCAST_LINK_STATUS_NUM_OF_SLAVES; i++) {\n@@ -4320,19 +3823,14 @@ test_reconfigure_bonded_device(void)\n \ttest_params->nb_rx_q = 4;\n \ttest_params->nb_tx_q = 4;\n \n-\tif (configure_ethdev(test_params->bonded_port_id, 0, 0)  != 0) {\n-\t\tprintf(\"failed to reconfigure bonded device\");\n-\t\treturn -1;\n-\t}\n-\n+\tTEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, 0),\n+\t\t\t\"failed to reconfigure bonded device\");\n \n \ttest_params->nb_rx_q = 2;\n \ttest_params->nb_tx_q = 2;\n \n-\tif (configure_ethdev(test_params->bonded_port_id, 0, 0)  != 0) {\n-\t\tprintf(\"failed to reconfigure bonded device with less rx/tx queues\");\n-\t\treturn -1;\n-\t}\n+\tTEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, 0),\n+\t\t\t\"failed to reconfigure bonded device with less rx/tx queues\");\n \n \treturn 0;\n }\n",
    "prefixes": [
        "dpdk-dev",
        "v6",
        "8/8"
    ]
}