]> git.droids-corp.org - dpdk.git/commitdiff
test: skip some subtests in no-huge mode
authorRuifeng Wang <ruifeng.wang@arm.com>
Mon, 23 Mar 2020 19:59:23 +0000 (20:59 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 24 Mar 2020 10:14:22 +0000 (11:14 +0100)
When running with '--no-huge' flag, tests failed with messages as:
    ACL context creation with invalid NUMA should have failed!
    fbk hash creation should have failed
    test_table_pipeline: Check pipeline invalid params failed.

These cases test against invalid socket ID as input parameter, and
expect error return. But function calls return success because
invalid sock ID is overwritten to SOCKET_ID_ANY when in no-huge mode.

The tests against invalid socket ID are skipped in no-huge mode.

Fixes: 5640171c528a ("malloc: fix external heap allocation in no-huge mode")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
app/test/test_acl.c
app/test/test_hash.c
app/test/test_table_pipeline.c

index 501de35da1fc304e311e0535313f1d6fd11c54e0..316bf4d065ad237d57c428b03e84b3bbfe22c493 100644 (file)
@@ -1397,16 +1397,18 @@ test_invalid_parameters(void)
        } else
                rte_acl_free(acx);
 
-       /* invalid NUMA node */
-       memcpy(&param, &acl_param, sizeof(param));
-       param.socket_id = RTE_MAX_NUMA_NODES + 1;
-
-       acx = rte_acl_create(&param);
-       if (acx != NULL) {
-               printf("Line %i: ACL context creation with invalid NUMA "
-                               "should have failed!\n", __LINE__);
-               rte_acl_free(acx);
-               return -1;
+       if (rte_eal_has_hugepages()) {
+               /* invalid NUMA node */
+               memcpy(&param, &acl_param, sizeof(param));
+               param.socket_id = RTE_MAX_NUMA_NODES + 1;
+
+               acx = rte_acl_create(&param);
+               if (acx != NULL) {
+                       printf("Line %i: ACL context creation with invalid "
+                                       "NUMA should have failed!\n", __LINE__);
+                       rte_acl_free(acx);
+                       return -1;
+               }
        }
 
        /* NULL name */
index fbd5725c6869ffc38a6971ed640ffcf7fbd4a6ea..ab978ea689394b033fc43e8f4ab665e4fea7c729 100644 (file)
@@ -1136,8 +1136,11 @@ fbk_hash_unit_test(void)
        handle = rte_fbk_hash_create(&invalid_params_7);
        RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed");
 
-       handle = rte_fbk_hash_create(&invalid_params_8);
-       RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed");
+       if (rte_eal_has_hugepages()) {
+               handle = rte_fbk_hash_create(&invalid_params_8);
+               RETURN_IF_ERROR_FBK(handle != NULL,
+                                       "fbk hash creation should have failed");
+       }
 
        handle = rte_fbk_hash_create(&invalid_params_same_name_1);
        RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation should have succeeded");
index 441338ac01aa6d96ad3af7b6bcbe60637e6f5483..bc412c3081a44222c10364e02ce467479a5e3ad4 100644 (file)
@@ -190,11 +190,13 @@ check_pipeline_invalid_params(void)
                goto fail;
        }
 
-       p = rte_pipeline_create(&pipeline_params_3);
-       if (p != NULL) {
-               RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with invalid "
-                       "socket\n", __func__);
-               goto fail;
+       if (rte_eal_has_hugepages()) {
+               p = rte_pipeline_create(&pipeline_params_3);
+               if (p != NULL) {
+                       RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with "
+                               "invalid socket\n", __func__);
+                       goto fail;
+               }
        }
 
        /* Check pipeline consistency */