diff mbox

[5/5] validation: cls: split pmr chain test

Message ID 1452622307-18379-6-git-send-email-ivan.khoronzhuk@linaro.org
State New
Headers show

Commit Message

Ivan Khoronzhuk Jan. 12, 2016, 6:11 p.m. UTC
These tests are simple classification tests and better to see results
for each of them separately.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
 test/validation/classification/classification.h    | 22 ++++---
 .../classification/odp_classification_tests.c      | 72 ++++++++--------------
 2 files changed, 38 insertions(+), 56 deletions(-)

Comments

Balasubramanian Manoharan Jan. 14, 2016, 5:55 a.m. UTC | #1
The idea behind this suite is to have a mechanism to test the
behaviour of the system after applying all the different PMR, default
CoS, error CoS and L2 and L3 CoS values. your suggested changes tests
each and every configuration individually which defeats the idea of
the suite.
There is a dedicated suite to test individual PMR values behaviour.

Regards,
Bala


On 12 January 2016 at 23:41, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> wrote:
> These tests are simple classification tests and better to see results
> for each of them separately.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> ---
>  test/validation/classification/classification.h    | 22 ++++---
>  .../classification/odp_classification_tests.c      | 72 ++++++++--------------
>  2 files changed, 38 insertions(+), 56 deletions(-)
>
> diff --git a/test/validation/classification/classification.h b/test/validation/classification/classification.h
> index f363812..6d2e55f 100644
> --- a/test/validation/classification/classification.h
> +++ b/test/validation/classification/classification.h
> @@ -13,7 +13,6 @@
>  #define SHM_PKT_BUF_SIZE        1024
>
>  /* Config values for Default CoS */
> -#define TEST_DEFAULT           1
>  #define        CLS_DEFAULT             0
>  #define CLS_DEFAULT_SADDR      "10.0.0.1/32"
>  #define CLS_DEFAULT_DADDR      "10.0.0.100/32"
> @@ -21,29 +20,24 @@
>  #define CLS_DEFAULT_DPORT      2048
>
>  /* Config values for Error CoS */
> -#define TEST_ERROR             1
>  #define CLS_ERROR              1
>
>  /* Config values for PMR_CHAIN */
> -#define TEST_PMR_CHAIN         1
>  #define CLS_PMR_CHAIN_SRC      2
>  #define CLS_PMR_CHAIN_DST      3
>  #define CLS_PMR_CHAIN_SADDR    "10.0.0.5/32"
>  #define CLS_PMR_CHAIN_PORT     3000
>
>  /* Config values for PMR */
> -#define TEST_PMR               1
>  #define CLS_PMR                        4
>  #define CLS_PMR_PORT           4000
>
>  /* Config values for PMR SET */
> -#define TEST_PMR_SET           1
>  #define CLS_PMR_SET            5
>  #define CLS_PMR_SET_SADDR      "10.0.0.6/32"
>  #define CLS_PMR_SET_PORT       5000
>
>  /* Config values for CoS L2 Priority */
> -#define TEST_L2_QOS            1
>  #define CLS_L2_QOS_0           6
>  #define CLS_L2_QOS_MAX         5
>
> @@ -68,8 +62,20 @@ void classification_test_pktio_set_skip(void);
>  void classification_test_pktio_set_headroom(void);
>  void classification_test_pmr_terms_avail(void);
>  void classification_test_pmr_terms_cap(void);
> -void classification_test_pktio_configure(void);
> -void classification_test_pktio_test(void);
> +
> +void classification_test_configure_pktio_default_cos(void);
> +void classification_test_configure_pktio_error_cos(void);
> +void classification_test_configure_cls_pmr_chain(void);
> +void classification_test_configure_cos_with_l2_priority(void);
> +void classification_test_configure_pmr_cos(void);
> +void classification_test_configure_pktio_pmr_match_set_cos(void);
> +
> +void classification_test_pktio_default_cos(void);
> +void classification_test_pktio_error_cos(void);
> +void classification_test_cls_pmr_chain(void);
> +void classification_test_cos_with_l2_priority(void);
> +void classification_test_pmr_cos(void);
> +void classification_test_pktio_pmr_match_set_cos(void);
>
>  void classification_test_pmr_term_tcp_dport(void);
>  void classification_test_pmr_term_tcp_sport(void);
> diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c
> index 34fc570..482e2d0 100644
> --- a/test/validation/classification/odp_classification_tests.c
> +++ b/test/validation/classification/odp_classification_tests.c
> @@ -133,7 +133,7 @@ cls_create_packet(bool vlan, odp_atomic_u32_t *seq, bool flag_udp)
>         return pkt;
>  }
>
> -void configure_cls_pmr_chain(void)
> +void classification_test_configure_cls_pmr_chain(void)
>  {
>         /* PKTIO --> PMR_SRC(SRC IP ADDR) --> PMR_DST (TCP SPORT) */
>
> @@ -230,7 +230,7 @@ void configure_cls_pmr_chain(void)
>         CU_ASSERT(retval == 0);
>  }
>
> -void test_cls_pmr_chain(void)
> +void classification_test_cls_pmr_chain(void)
>  {
>         odp_packet_t pkt;
>         odph_ipv4hdr_t *ip;
> @@ -284,7 +284,7 @@ void test_cls_pmr_chain(void)
>         odp_packet_free(pkt);
>  }
>
> -void configure_pktio_default_cos(void)
> +void classification_test_configure_pktio_default_cos(void)
>  {
>         int retval;
>         odp_queue_param_t qparam;
> @@ -318,7 +318,7 @@ void configure_pktio_default_cos(void)
>         CU_ASSERT(retval == 0);
>  }
>
> -void test_pktio_default_cos(void)
> +void classification_test_pktio_default_cos(void)
>  {
>         odp_packet_t pkt;
>         odp_queue_t queue;
> @@ -344,7 +344,7 @@ void test_pktio_default_cos(void)
>         odp_packet_free(pkt);
>  }
>
> -void configure_pktio_error_cos(void)
> +void classification_test_configure_pktio_error_cos(void)
>  {
>         int retval;
>         odp_queue_param_t qparam;
> @@ -380,7 +380,7 @@ void configure_pktio_error_cos(void)
>         CU_ASSERT(retval == 0);
>  }
>
> -void test_pktio_error_cos(void)
> +void classification_test_pktio_error_cos(void)
>  {
>         odp_queue_t queue;
>         odp_packet_t pkt;
> @@ -434,7 +434,7 @@ void classification_test_pktio_set_headroom(void)
>         CU_ASSERT(retval < 0);
>  }
>
> -void configure_cos_with_l2_priority(void)
> +void classification_test_configure_cos_with_l2_priority(void)
>  {
>         uint8_t num_qos = CLS_L2_QOS_MAX;
>         odp_cos_t cos_tbl[CLS_L2_QOS_MAX];
> @@ -487,7 +487,7 @@ void configure_cos_with_l2_priority(void)
>         CU_ASSERT(retval == 0);
>  }
>
> -void test_cos_with_l2_priority(void)
> +void classification_test_cos_with_l2_priority(void)
>  {
>         odp_packet_t pkt;
>         odph_ethhdr_t *ethhdr;
> @@ -516,7 +516,7 @@ void test_cos_with_l2_priority(void)
>         }
>  }
>
> -void configure_pmr_cos(void)
> +void classification_test_configure_pmr_cos(void)
>  {
>         uint16_t val;
>         uint16_t mask;
> @@ -566,7 +566,7 @@ void configure_pmr_cos(void)
>         CU_ASSERT(retval == 0);
>  }
>
> -void test_pmr_cos(void)
> +void classification_test_pmr_cos(void)
>  {
>         odp_packet_t pkt;
>         odp_queue_t queue;
> @@ -588,7 +588,7 @@ void test_pmr_cos(void)
>         odp_packet_free(pkt);
>  }
>
> -void configure_pktio_pmr_match_set_cos(void)
> +void classification_test_configure_pktio_pmr_match_set_cos(void)
>  {
>         int retval;
>         odp_pmr_match_t pmr_terms[2];
> @@ -648,7 +648,7 @@ void configure_pktio_pmr_match_set_cos(void)
>         CU_ASSERT(retval == 0);
>  }
>
> -void test_pktio_pmr_match_set_cos(void)
> +void classification_test_pktio_pmr_match_set_cos(void)
>  {
>         uint32_t addr = 0;
>         uint32_t mask;
> @@ -697,46 +697,22 @@ void classification_test_pmr_terms_cap(void)
>         CU_ASSERT(retval & (1 << ODP_PMR_IPPROTO));
>  }
>
> -void classification_test_pktio_configure(void)
> -{
> -       /* Configure the Different CoS for the pktio interface */
> -       if (TEST_DEFAULT)
> -               configure_pktio_default_cos();
> -       if (TEST_ERROR)
> -               configure_pktio_error_cos();
> -       if (TEST_PMR_CHAIN)
> -               configure_cls_pmr_chain();
> -       if (TEST_L2_QOS)
> -               configure_cos_with_l2_priority();
> -       if (TEST_PMR)
> -               configure_pmr_cos();
> -       if (TEST_PMR_SET)
> -               configure_pktio_pmr_match_set_cos();
> -}
> -
> -void classification_test_pktio_test(void)
> -{
> -       /* Test Different CoS on the pktio interface */
> -       if (TEST_DEFAULT)
> -               test_pktio_default_cos();
> -       if (TEST_ERROR)
> -               test_pktio_error_cos();
> -       if (TEST_PMR_CHAIN)
> -               test_cls_pmr_chain();
> -       if (TEST_L2_QOS)
> -               test_cos_with_l2_priority();
> -       if (TEST_PMR)
> -               test_pmr_cos();
> -       if (TEST_PMR_SET)
> -               test_pktio_pmr_match_set_cos();
> -}
> -
>  odp_testinfo_t classification_suite[] = {
>         ODP_TEST_INFO(classification_test_pmr_terms_avail),
>         ODP_TEST_INFO(classification_test_pktio_set_skip),
>         ODP_TEST_INFO(classification_test_pktio_set_headroom),
>         ODP_TEST_INFO(classification_test_pmr_terms_cap),
> -       ODP_TEST_INFO(classification_test_pktio_configure),
> -       ODP_TEST_INFO(classification_test_pktio_test),
> +       ODP_TEST_INFO(classification_test_configure_pktio_default_cos),
> +       ODP_TEST_INFO(classification_test_configure_pktio_error_cos),
> +       ODP_TEST_INFO(classification_test_configure_cls_pmr_chain),
> +       ODP_TEST_INFO(classification_test_configure_cos_with_l2_priority),
> +       ODP_TEST_INFO(classification_test_configure_pmr_cos),
> +       ODP_TEST_INFO(classification_test_configure_pktio_pmr_match_set_cos),
> +       ODP_TEST_INFO(classification_test_pktio_default_cos),
> +       ODP_TEST_INFO(classification_test_pktio_error_cos),
> +       ODP_TEST_INFO(classification_test_cls_pmr_chain),
> +       ODP_TEST_INFO(classification_test_cos_with_l2_priority),
> +       ODP_TEST_INFO(classification_test_pmr_cos),
> +       ODP_TEST_INFO(classification_test_pktio_pmr_match_set_cos),
>         ODP_TEST_INFO_NULL,
>  };
> --
> 1.9.1
>
Ivan Khoronzhuk Jan. 14, 2016, 7:56 a.m. UTC | #2
On 14.01.16 07:55, Bala Manoharan wrote:
> The idea behind this suite is to have a mechanism to test the
> behaviour of the system after applying all the different PMR, default
> CoS, error CoS and L2 and L3 CoS values. your suggested changes tests
> each and every configuration individually which defeats the idea of
> the suite.
> There is a dedicated suite to test individual PMR values behaviour.
>
> Regards,
> Bala
Maybe, but it's hard to figure out what is broken, especially when some
parts are not supported or implemented. In case of splitting it's possible
to see what doesn't work, I can drop this patch but IMHO, one test includes
a lot of different units that has not been tested before, like error CoS,
default CoS (it was created but not tested), CoS with L2 pr.......And now
all in one chunk...one broken and seems like all are broken. It can be
leaved like this but it should be tested separately.


>
>
> On 12 January 2016 at 23:41, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> wrote:
>> These tests are simple classification tests and better to see results
>> for each of them separately.
>>
>> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
>> ---
>>   test/validation/classification/classification.h    | 22 ++++---
>>   .../classification/odp_classification_tests.c      | 72 ++++++++--------------
>>   2 files changed, 38 insertions(+), 56 deletions(-)
>>
>> diff --git a/test/validation/classification/classification.h b/test/validation/classification/classification.h
>> index f363812..6d2e55f 100644
>> --- a/test/validation/classification/classification.h
>> +++ b/test/validation/classification/classification.h
>> @@ -13,7 +13,6 @@
>>   #define SHM_PKT_BUF_SIZE        1024
>>
>>   /* Config values for Default CoS */
>> -#define TEST_DEFAULT           1
>>   #define        CLS_DEFAULT             0
>>   #define CLS_DEFAULT_SADDR      "10.0.0.1/32"
>>   #define CLS_DEFAULT_DADDR      "10.0.0.100/32"
>> @@ -21,29 +20,24 @@
>>   #define CLS_DEFAULT_DPORT      2048
>>
>>   /* Config values for Error CoS */
>> -#define TEST_ERROR             1
>>   #define CLS_ERROR              1
>>
>>   /* Config values for PMR_CHAIN */
>> -#define TEST_PMR_CHAIN         1
>>   #define CLS_PMR_CHAIN_SRC      2
>>   #define CLS_PMR_CHAIN_DST      3
>>   #define CLS_PMR_CHAIN_SADDR    "10.0.0.5/32"
>>   #define CLS_PMR_CHAIN_PORT     3000
>>
>>   /* Config values for PMR */
>> -#define TEST_PMR               1
>>   #define CLS_PMR                        4
>>   #define CLS_PMR_PORT           4000
>>
>>   /* Config values for PMR SET */
>> -#define TEST_PMR_SET           1
>>   #define CLS_PMR_SET            5
>>   #define CLS_PMR_SET_SADDR      "10.0.0.6/32"
>>   #define CLS_PMR_SET_PORT       5000
>>
>>   /* Config values for CoS L2 Priority */
>> -#define TEST_L2_QOS            1
>>   #define CLS_L2_QOS_0           6
>>   #define CLS_L2_QOS_MAX         5
>>
>> @@ -68,8 +62,20 @@ void classification_test_pktio_set_skip(void);
>>   void classification_test_pktio_set_headroom(void);
>>   void classification_test_pmr_terms_avail(void);
>>   void classification_test_pmr_terms_cap(void);
>> -void classification_test_pktio_configure(void);
>> -void classification_test_pktio_test(void);
>> +
>> +void classification_test_configure_pktio_default_cos(void);
>> +void classification_test_configure_pktio_error_cos(void);
>> +void classification_test_configure_cls_pmr_chain(void);
>> +void classification_test_configure_cos_with_l2_priority(void);
>> +void classification_test_configure_pmr_cos(void);
>> +void classification_test_configure_pktio_pmr_match_set_cos(void);
>> +
>> +void classification_test_pktio_default_cos(void);
>> +void classification_test_pktio_error_cos(void);
>> +void classification_test_cls_pmr_chain(void);
>> +void classification_test_cos_with_l2_priority(void);
>> +void classification_test_pmr_cos(void);
>> +void classification_test_pktio_pmr_match_set_cos(void);
>>
>>   void classification_test_pmr_term_tcp_dport(void);
>>   void classification_test_pmr_term_tcp_sport(void);
>> diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c
>> index 34fc570..482e2d0 100644
>> --- a/test/validation/classification/odp_classification_tests.c
>> +++ b/test/validation/classification/odp_classification_tests.c
>> @@ -133,7 +133,7 @@ cls_create_packet(bool vlan, odp_atomic_u32_t *seq, bool flag_udp)
>>          return pkt;
>>   }
>>
>> -void configure_cls_pmr_chain(void)
>> +void classification_test_configure_cls_pmr_chain(void)
>>   {
>>          /* PKTIO --> PMR_SRC(SRC IP ADDR) --> PMR_DST (TCP SPORT) */
>>
>> @@ -230,7 +230,7 @@ void configure_cls_pmr_chain(void)
>>          CU_ASSERT(retval == 0);
>>   }
>>
>> -void test_cls_pmr_chain(void)
>> +void classification_test_cls_pmr_chain(void)
>>   {
>>          odp_packet_t pkt;
>>          odph_ipv4hdr_t *ip;
>> @@ -284,7 +284,7 @@ void test_cls_pmr_chain(void)
>>          odp_packet_free(pkt);
>>   }
>>
>> -void configure_pktio_default_cos(void)
>> +void classification_test_configure_pktio_default_cos(void)
>>   {
>>          int retval;
>>          odp_queue_param_t qparam;
>> @@ -318,7 +318,7 @@ void configure_pktio_default_cos(void)
>>          CU_ASSERT(retval == 0);
>>   }
>>
>> -void test_pktio_default_cos(void)
>> +void classification_test_pktio_default_cos(void)
>>   {
>>          odp_packet_t pkt;
>>          odp_queue_t queue;
>> @@ -344,7 +344,7 @@ void test_pktio_default_cos(void)
>>          odp_packet_free(pkt);
>>   }
>>
>> -void configure_pktio_error_cos(void)
>> +void classification_test_configure_pktio_error_cos(void)
>>   {
>>          int retval;
>>          odp_queue_param_t qparam;
>> @@ -380,7 +380,7 @@ void configure_pktio_error_cos(void)
>>          CU_ASSERT(retval == 0);
>>   }
>>
>> -void test_pktio_error_cos(void)
>> +void classification_test_pktio_error_cos(void)
>>   {
>>          odp_queue_t queue;
>>          odp_packet_t pkt;
>> @@ -434,7 +434,7 @@ void classification_test_pktio_set_headroom(void)
>>          CU_ASSERT(retval < 0);
>>   }
>>
>> -void configure_cos_with_l2_priority(void)
>> +void classification_test_configure_cos_with_l2_priority(void)
>>   {
>>          uint8_t num_qos = CLS_L2_QOS_MAX;
>>          odp_cos_t cos_tbl[CLS_L2_QOS_MAX];
>> @@ -487,7 +487,7 @@ void configure_cos_with_l2_priority(void)
>>          CU_ASSERT(retval == 0);
>>   }
>>
>> -void test_cos_with_l2_priority(void)
>> +void classification_test_cos_with_l2_priority(void)
>>   {
>>          odp_packet_t pkt;
>>          odph_ethhdr_t *ethhdr;
>> @@ -516,7 +516,7 @@ void test_cos_with_l2_priority(void)
>>          }
>>   }
>>
>> -void configure_pmr_cos(void)
>> +void classification_test_configure_pmr_cos(void)
>>   {
>>          uint16_t val;
>>          uint16_t mask;
>> @@ -566,7 +566,7 @@ void configure_pmr_cos(void)
>>          CU_ASSERT(retval == 0);
>>   }
>>
>> -void test_pmr_cos(void)
>> +void classification_test_pmr_cos(void)
>>   {
>>          odp_packet_t pkt;
>>          odp_queue_t queue;
>> @@ -588,7 +588,7 @@ void test_pmr_cos(void)
>>          odp_packet_free(pkt);
>>   }
>>
>> -void configure_pktio_pmr_match_set_cos(void)
>> +void classification_test_configure_pktio_pmr_match_set_cos(void)
>>   {
>>          int retval;
>>          odp_pmr_match_t pmr_terms[2];
>> @@ -648,7 +648,7 @@ void configure_pktio_pmr_match_set_cos(void)
>>          CU_ASSERT(retval == 0);
>>   }
>>
>> -void test_pktio_pmr_match_set_cos(void)
>> +void classification_test_pktio_pmr_match_set_cos(void)
>>   {
>>          uint32_t addr = 0;
>>          uint32_t mask;
>> @@ -697,46 +697,22 @@ void classification_test_pmr_terms_cap(void)
>>          CU_ASSERT(retval & (1 << ODP_PMR_IPPROTO));
>>   }
>>
>> -void classification_test_pktio_configure(void)
>> -{
>> -       /* Configure the Different CoS for the pktio interface */
>> -       if (TEST_DEFAULT)
>> -               configure_pktio_default_cos();
>> -       if (TEST_ERROR)
>> -               configure_pktio_error_cos();
>> -       if (TEST_PMR_CHAIN)
>> -               configure_cls_pmr_chain();
>> -       if (TEST_L2_QOS)
>> -               configure_cos_with_l2_priority();
>> -       if (TEST_PMR)
>> -               configure_pmr_cos();
>> -       if (TEST_PMR_SET)
>> -               configure_pktio_pmr_match_set_cos();
>> -}
>> -
>> -void classification_test_pktio_test(void)
>> -{
>> -       /* Test Different CoS on the pktio interface */
>> -       if (TEST_DEFAULT)
>> -               test_pktio_default_cos();
>> -       if (TEST_ERROR)
>> -               test_pktio_error_cos();
>> -       if (TEST_PMR_CHAIN)
>> -               test_cls_pmr_chain();
>> -       if (TEST_L2_QOS)
>> -               test_cos_with_l2_priority();
>> -       if (TEST_PMR)
>> -               test_pmr_cos();
>> -       if (TEST_PMR_SET)
>> -               test_pktio_pmr_match_set_cos();
>> -}
>> -
>>   odp_testinfo_t classification_suite[] = {
>>          ODP_TEST_INFO(classification_test_pmr_terms_avail),
>>          ODP_TEST_INFO(classification_test_pktio_set_skip),
>>          ODP_TEST_INFO(classification_test_pktio_set_headroom),
>>          ODP_TEST_INFO(classification_test_pmr_terms_cap),
>> -       ODP_TEST_INFO(classification_test_pktio_configure),
>> -       ODP_TEST_INFO(classification_test_pktio_test),
>> +       ODP_TEST_INFO(classification_test_configure_pktio_default_cos),
>> +       ODP_TEST_INFO(classification_test_configure_pktio_error_cos),
>> +       ODP_TEST_INFO(classification_test_configure_cls_pmr_chain),
>> +       ODP_TEST_INFO(classification_test_configure_cos_with_l2_priority),
>> +       ODP_TEST_INFO(classification_test_configure_pmr_cos),
>> +       ODP_TEST_INFO(classification_test_configure_pktio_pmr_match_set_cos),
>> +       ODP_TEST_INFO(classification_test_pktio_default_cos),
>> +       ODP_TEST_INFO(classification_test_pktio_error_cos),
>> +       ODP_TEST_INFO(classification_test_cls_pmr_chain),
>> +       ODP_TEST_INFO(classification_test_cos_with_l2_priority),
>> +       ODP_TEST_INFO(classification_test_pmr_cos),
>> +       ODP_TEST_INFO(classification_test_pktio_pmr_match_set_cos),
>>          ODP_TEST_INFO_NULL,
>>   };
>> --
>> 1.9.1
>>
Balasubramanian Manoharan Jan. 14, 2016, 8:36 a.m. UTC | #3
Agreed. Error CoS and L2 should be added as separate suites and I
would preferable add them in odp_classification_test_pmr.c so that
each are tested separately. Maybe rename the file also :)

As I pointed out enhancements can be done once API freeze is accepted.
Regards,
Bala


On 14 January 2016 at 13:26, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> wrote:
>
>
> On 14.01.16 07:55, Bala Manoharan wrote:
>>
>> The idea behind this suite is to have a mechanism to test the
>> behaviour of the system after applying all the different PMR, default
>> CoS, error CoS and L2 and L3 CoS values. your suggested changes tests
>> each and every configuration individually which defeats the idea of
>> the suite.
>> There is a dedicated suite to test individual PMR values behaviour.
>>
>> Regards,
>> Bala
>
> Maybe, but it's hard to figure out what is broken, especially when some
> parts are not supported or implemented. In case of splitting it's possible
> to see what doesn't work, I can drop this patch but IMHO, one test includes
> a lot of different units that has not been tested before, like error CoS,
> default CoS (it was created but not tested), CoS with L2 pr.......And now
> all in one chunk...one broken and seems like all are broken. It can be
> leaved like this but it should be tested separately.
>
>
>
>>
>>
>> On 12 January 2016 at 23:41, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
>> wrote:
>>>
>>> These tests are simple classification tests and better to see results
>>> for each of them separately.
>>>
>>> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
>>> ---
>>>   test/validation/classification/classification.h    | 22 ++++---
>>>   .../classification/odp_classification_tests.c      | 72
>>> ++++++++--------------
>>>   2 files changed, 38 insertions(+), 56 deletions(-)
>>>
>>> diff --git a/test/validation/classification/classification.h
>>> b/test/validation/classification/classification.h
>>> index f363812..6d2e55f 100644
>>> --- a/test/validation/classification/classification.h
>>> +++ b/test/validation/classification/classification.h
>>> @@ -13,7 +13,6 @@
>>>   #define SHM_PKT_BUF_SIZE        1024
>>>
>>>   /* Config values for Default CoS */
>>> -#define TEST_DEFAULT           1
>>>   #define        CLS_DEFAULT             0
>>>   #define CLS_DEFAULT_SADDR      "10.0.0.1/32"
>>>   #define CLS_DEFAULT_DADDR      "10.0.0.100/32"
>>> @@ -21,29 +20,24 @@
>>>   #define CLS_DEFAULT_DPORT      2048
>>>
>>>   /* Config values for Error CoS */
>>> -#define TEST_ERROR             1
>>>   #define CLS_ERROR              1
>>>
>>>   /* Config values for PMR_CHAIN */
>>> -#define TEST_PMR_CHAIN         1
>>>   #define CLS_PMR_CHAIN_SRC      2
>>>   #define CLS_PMR_CHAIN_DST      3
>>>   #define CLS_PMR_CHAIN_SADDR    "10.0.0.5/32"
>>>   #define CLS_PMR_CHAIN_PORT     3000
>>>
>>>   /* Config values for PMR */
>>> -#define TEST_PMR               1
>>>   #define CLS_PMR                        4
>>>   #define CLS_PMR_PORT           4000
>>>
>>>   /* Config values for PMR SET */
>>> -#define TEST_PMR_SET           1
>>>   #define CLS_PMR_SET            5
>>>   #define CLS_PMR_SET_SADDR      "10.0.0.6/32"
>>>   #define CLS_PMR_SET_PORT       5000
>>>
>>>   /* Config values for CoS L2 Priority */
>>> -#define TEST_L2_QOS            1
>>>   #define CLS_L2_QOS_0           6
>>>   #define CLS_L2_QOS_MAX         5
>>>
>>> @@ -68,8 +62,20 @@ void classification_test_pktio_set_skip(void);
>>>   void classification_test_pktio_set_headroom(void);
>>>   void classification_test_pmr_terms_avail(void);
>>>   void classification_test_pmr_terms_cap(void);
>>> -void classification_test_pktio_configure(void);
>>> -void classification_test_pktio_test(void);
>>> +
>>> +void classification_test_configure_pktio_default_cos(void);
>>> +void classification_test_configure_pktio_error_cos(void);
>>> +void classification_test_configure_cls_pmr_chain(void);
>>> +void classification_test_configure_cos_with_l2_priority(void);
>>> +void classification_test_configure_pmr_cos(void);
>>> +void classification_test_configure_pktio_pmr_match_set_cos(void);
>>> +
>>> +void classification_test_pktio_default_cos(void);
>>> +void classification_test_pktio_error_cos(void);
>>> +void classification_test_cls_pmr_chain(void);
>>> +void classification_test_cos_with_l2_priority(void);
>>> +void classification_test_pmr_cos(void);
>>> +void classification_test_pktio_pmr_match_set_cos(void);
>>>
>>>   void classification_test_pmr_term_tcp_dport(void);
>>>   void classification_test_pmr_term_tcp_sport(void);
>>> diff --git a/test/validation/classification/odp_classification_tests.c
>>> b/test/validation/classification/odp_classification_tests.c
>>> index 34fc570..482e2d0 100644
>>> --- a/test/validation/classification/odp_classification_tests.c
>>> +++ b/test/validation/classification/odp_classification_tests.c
>>> @@ -133,7 +133,7 @@ cls_create_packet(bool vlan, odp_atomic_u32_t *seq,
>>> bool flag_udp)
>>>          return pkt;
>>>   }
>>>
>>> -void configure_cls_pmr_chain(void)
>>> +void classification_test_configure_cls_pmr_chain(void)
>>>   {
>>>          /* PKTIO --> PMR_SRC(SRC IP ADDR) --> PMR_DST (TCP SPORT) */
>>>
>>> @@ -230,7 +230,7 @@ void configure_cls_pmr_chain(void)
>>>          CU_ASSERT(retval == 0);
>>>   }
>>>
>>> -void test_cls_pmr_chain(void)
>>> +void classification_test_cls_pmr_chain(void)
>>>   {
>>>          odp_packet_t pkt;
>>>          odph_ipv4hdr_t *ip;
>>> @@ -284,7 +284,7 @@ void test_cls_pmr_chain(void)
>>>          odp_packet_free(pkt);
>>>   }
>>>
>>> -void configure_pktio_default_cos(void)
>>> +void classification_test_configure_pktio_default_cos(void)
>>>   {
>>>          int retval;
>>>          odp_queue_param_t qparam;
>>> @@ -318,7 +318,7 @@ void configure_pktio_default_cos(void)
>>>          CU_ASSERT(retval == 0);
>>>   }
>>>
>>> -void test_pktio_default_cos(void)
>>> +void classification_test_pktio_default_cos(void)
>>>   {
>>>          odp_packet_t pkt;
>>>          odp_queue_t queue;
>>> @@ -344,7 +344,7 @@ void test_pktio_default_cos(void)
>>>          odp_packet_free(pkt);
>>>   }
>>>
>>> -void configure_pktio_error_cos(void)
>>> +void classification_test_configure_pktio_error_cos(void)
>>>   {
>>>          int retval;
>>>          odp_queue_param_t qparam;
>>> @@ -380,7 +380,7 @@ void configure_pktio_error_cos(void)
>>>          CU_ASSERT(retval == 0);
>>>   }
>>>
>>> -void test_pktio_error_cos(void)
>>> +void classification_test_pktio_error_cos(void)
>>>   {
>>>          odp_queue_t queue;
>>>          odp_packet_t pkt;
>>> @@ -434,7 +434,7 @@ void classification_test_pktio_set_headroom(void)
>>>          CU_ASSERT(retval < 0);
>>>   }
>>>
>>> -void configure_cos_with_l2_priority(void)
>>> +void classification_test_configure_cos_with_l2_priority(void)
>>>   {
>>>          uint8_t num_qos = CLS_L2_QOS_MAX;
>>>          odp_cos_t cos_tbl[CLS_L2_QOS_MAX];
>>> @@ -487,7 +487,7 @@ void configure_cos_with_l2_priority(void)
>>>          CU_ASSERT(retval == 0);
>>>   }
>>>
>>> -void test_cos_with_l2_priority(void)
>>> +void classification_test_cos_with_l2_priority(void)
>>>   {
>>>          odp_packet_t pkt;
>>>          odph_ethhdr_t *ethhdr;
>>> @@ -516,7 +516,7 @@ void test_cos_with_l2_priority(void)
>>>          }
>>>   }
>>>
>>> -void configure_pmr_cos(void)
>>> +void classification_test_configure_pmr_cos(void)
>>>   {
>>>          uint16_t val;
>>>          uint16_t mask;
>>> @@ -566,7 +566,7 @@ void configure_pmr_cos(void)
>>>          CU_ASSERT(retval == 0);
>>>   }
>>>
>>> -void test_pmr_cos(void)
>>> +void classification_test_pmr_cos(void)
>>>   {
>>>          odp_packet_t pkt;
>>>          odp_queue_t queue;
>>> @@ -588,7 +588,7 @@ void test_pmr_cos(void)
>>>          odp_packet_free(pkt);
>>>   }
>>>
>>> -void configure_pktio_pmr_match_set_cos(void)
>>> +void classification_test_configure_pktio_pmr_match_set_cos(void)
>>>   {
>>>          int retval;
>>>          odp_pmr_match_t pmr_terms[2];
>>> @@ -648,7 +648,7 @@ void configure_pktio_pmr_match_set_cos(void)
>>>          CU_ASSERT(retval == 0);
>>>   }
>>>
>>> -void test_pktio_pmr_match_set_cos(void)
>>> +void classification_test_pktio_pmr_match_set_cos(void)
>>>   {
>>>          uint32_t addr = 0;
>>>          uint32_t mask;
>>> @@ -697,46 +697,22 @@ void classification_test_pmr_terms_cap(void)
>>>          CU_ASSERT(retval & (1 << ODP_PMR_IPPROTO));
>>>   }
>>>
>>> -void classification_test_pktio_configure(void)
>>> -{
>>> -       /* Configure the Different CoS for the pktio interface */
>>> -       if (TEST_DEFAULT)
>>> -               configure_pktio_default_cos();
>>> -       if (TEST_ERROR)
>>> -               configure_pktio_error_cos();
>>> -       if (TEST_PMR_CHAIN)
>>> -               configure_cls_pmr_chain();
>>> -       if (TEST_L2_QOS)
>>> -               configure_cos_with_l2_priority();
>>> -       if (TEST_PMR)
>>> -               configure_pmr_cos();
>>> -       if (TEST_PMR_SET)
>>> -               configure_pktio_pmr_match_set_cos();
>>> -}
>>> -
>>> -void classification_test_pktio_test(void)
>>> -{
>>> -       /* Test Different CoS on the pktio interface */
>>> -       if (TEST_DEFAULT)
>>> -               test_pktio_default_cos();
>>> -       if (TEST_ERROR)
>>> -               test_pktio_error_cos();
>>> -       if (TEST_PMR_CHAIN)
>>> -               test_cls_pmr_chain();
>>> -       if (TEST_L2_QOS)
>>> -               test_cos_with_l2_priority();
>>> -       if (TEST_PMR)
>>> -               test_pmr_cos();
>>> -       if (TEST_PMR_SET)
>>> -               test_pktio_pmr_match_set_cos();
>>> -}
>>> -
>>>   odp_testinfo_t classification_suite[] = {
>>>          ODP_TEST_INFO(classification_test_pmr_terms_avail),
>>>          ODP_TEST_INFO(classification_test_pktio_set_skip),
>>>          ODP_TEST_INFO(classification_test_pktio_set_headroom),
>>>          ODP_TEST_INFO(classification_test_pmr_terms_cap),
>>> -       ODP_TEST_INFO(classification_test_pktio_configure),
>>> -       ODP_TEST_INFO(classification_test_pktio_test),
>>> +       ODP_TEST_INFO(classification_test_configure_pktio_default_cos),
>>> +       ODP_TEST_INFO(classification_test_configure_pktio_error_cos),
>>> +       ODP_TEST_INFO(classification_test_configure_cls_pmr_chain),
>>> +
>>> ODP_TEST_INFO(classification_test_configure_cos_with_l2_priority),
>>> +       ODP_TEST_INFO(classification_test_configure_pmr_cos),
>>> +
>>> ODP_TEST_INFO(classification_test_configure_pktio_pmr_match_set_cos),
>>> +       ODP_TEST_INFO(classification_test_pktio_default_cos),
>>> +       ODP_TEST_INFO(classification_test_pktio_error_cos),
>>> +       ODP_TEST_INFO(classification_test_cls_pmr_chain),
>>> +       ODP_TEST_INFO(classification_test_cos_with_l2_priority),
>>> +       ODP_TEST_INFO(classification_test_pmr_cos),
>>> +       ODP_TEST_INFO(classification_test_pktio_pmr_match_set_cos),
>>>          ODP_TEST_INFO_NULL,
>>>   };
>>> --
>>> 1.9.1
>>>
>
> --
> Regards,
> Ivan Khoronzhuk
diff mbox

Patch

diff --git a/test/validation/classification/classification.h b/test/validation/classification/classification.h
index f363812..6d2e55f 100644
--- a/test/validation/classification/classification.h
+++ b/test/validation/classification/classification.h
@@ -13,7 +13,6 @@ 
 #define SHM_PKT_BUF_SIZE        1024
 
 /* Config values for Default CoS */
-#define TEST_DEFAULT		1
 #define	CLS_DEFAULT		0
 #define CLS_DEFAULT_SADDR	"10.0.0.1/32"
 #define CLS_DEFAULT_DADDR	"10.0.0.100/32"
@@ -21,29 +20,24 @@ 
 #define CLS_DEFAULT_DPORT	2048
 
 /* Config values for Error CoS */
-#define TEST_ERROR		1
 #define CLS_ERROR		1
 
 /* Config values for PMR_CHAIN */
-#define TEST_PMR_CHAIN		1
 #define CLS_PMR_CHAIN_SRC	2
 #define CLS_PMR_CHAIN_DST	3
 #define CLS_PMR_CHAIN_SADDR	"10.0.0.5/32"
 #define CLS_PMR_CHAIN_PORT	3000
 
 /* Config values for PMR */
-#define TEST_PMR		1
 #define CLS_PMR			4
 #define CLS_PMR_PORT		4000
 
 /* Config values for PMR SET */
-#define TEST_PMR_SET		1
 #define CLS_PMR_SET		5
 #define CLS_PMR_SET_SADDR	"10.0.0.6/32"
 #define CLS_PMR_SET_PORT	5000
 
 /* Config values for CoS L2 Priority */
-#define TEST_L2_QOS		1
 #define CLS_L2_QOS_0		6
 #define CLS_L2_QOS_MAX		5
 
@@ -68,8 +62,20 @@  void classification_test_pktio_set_skip(void);
 void classification_test_pktio_set_headroom(void);
 void classification_test_pmr_terms_avail(void);
 void classification_test_pmr_terms_cap(void);
-void classification_test_pktio_configure(void);
-void classification_test_pktio_test(void);
+
+void classification_test_configure_pktio_default_cos(void);
+void classification_test_configure_pktio_error_cos(void);
+void classification_test_configure_cls_pmr_chain(void);
+void classification_test_configure_cos_with_l2_priority(void);
+void classification_test_configure_pmr_cos(void);
+void classification_test_configure_pktio_pmr_match_set_cos(void);
+
+void classification_test_pktio_default_cos(void);
+void classification_test_pktio_error_cos(void);
+void classification_test_cls_pmr_chain(void);
+void classification_test_cos_with_l2_priority(void);
+void classification_test_pmr_cos(void);
+void classification_test_pktio_pmr_match_set_cos(void);
 
 void classification_test_pmr_term_tcp_dport(void);
 void classification_test_pmr_term_tcp_sport(void);
diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c
index 34fc570..482e2d0 100644
--- a/test/validation/classification/odp_classification_tests.c
+++ b/test/validation/classification/odp_classification_tests.c
@@ -133,7 +133,7 @@  cls_create_packet(bool vlan, odp_atomic_u32_t *seq, bool flag_udp)
 	return pkt;
 }
 
-void configure_cls_pmr_chain(void)
+void classification_test_configure_cls_pmr_chain(void)
 {
 	/* PKTIO --> PMR_SRC(SRC IP ADDR) --> PMR_DST (TCP SPORT) */
 
@@ -230,7 +230,7 @@  void configure_cls_pmr_chain(void)
 	CU_ASSERT(retval == 0);
 }
 
-void test_cls_pmr_chain(void)
+void classification_test_cls_pmr_chain(void)
 {
 	odp_packet_t pkt;
 	odph_ipv4hdr_t *ip;
@@ -284,7 +284,7 @@  void test_cls_pmr_chain(void)
 	odp_packet_free(pkt);
 }
 
-void configure_pktio_default_cos(void)
+void classification_test_configure_pktio_default_cos(void)
 {
 	int retval;
 	odp_queue_param_t qparam;
@@ -318,7 +318,7 @@  void configure_pktio_default_cos(void)
 	CU_ASSERT(retval == 0);
 }
 
-void test_pktio_default_cos(void)
+void classification_test_pktio_default_cos(void)
 {
 	odp_packet_t pkt;
 	odp_queue_t queue;
@@ -344,7 +344,7 @@  void test_pktio_default_cos(void)
 	odp_packet_free(pkt);
 }
 
-void configure_pktio_error_cos(void)
+void classification_test_configure_pktio_error_cos(void)
 {
 	int retval;
 	odp_queue_param_t qparam;
@@ -380,7 +380,7 @@  void configure_pktio_error_cos(void)
 	CU_ASSERT(retval == 0);
 }
 
-void test_pktio_error_cos(void)
+void classification_test_pktio_error_cos(void)
 {
 	odp_queue_t queue;
 	odp_packet_t pkt;
@@ -434,7 +434,7 @@  void classification_test_pktio_set_headroom(void)
 	CU_ASSERT(retval < 0);
 }
 
-void configure_cos_with_l2_priority(void)
+void classification_test_configure_cos_with_l2_priority(void)
 {
 	uint8_t num_qos = CLS_L2_QOS_MAX;
 	odp_cos_t cos_tbl[CLS_L2_QOS_MAX];
@@ -487,7 +487,7 @@  void configure_cos_with_l2_priority(void)
 	CU_ASSERT(retval == 0);
 }
 
-void test_cos_with_l2_priority(void)
+void classification_test_cos_with_l2_priority(void)
 {
 	odp_packet_t pkt;
 	odph_ethhdr_t *ethhdr;
@@ -516,7 +516,7 @@  void test_cos_with_l2_priority(void)
 	}
 }
 
-void configure_pmr_cos(void)
+void classification_test_configure_pmr_cos(void)
 {
 	uint16_t val;
 	uint16_t mask;
@@ -566,7 +566,7 @@  void configure_pmr_cos(void)
 	CU_ASSERT(retval == 0);
 }
 
-void test_pmr_cos(void)
+void classification_test_pmr_cos(void)
 {
 	odp_packet_t pkt;
 	odp_queue_t queue;
@@ -588,7 +588,7 @@  void test_pmr_cos(void)
 	odp_packet_free(pkt);
 }
 
-void configure_pktio_pmr_match_set_cos(void)
+void classification_test_configure_pktio_pmr_match_set_cos(void)
 {
 	int retval;
 	odp_pmr_match_t pmr_terms[2];
@@ -648,7 +648,7 @@  void configure_pktio_pmr_match_set_cos(void)
 	CU_ASSERT(retval == 0);
 }
 
-void test_pktio_pmr_match_set_cos(void)
+void classification_test_pktio_pmr_match_set_cos(void)
 {
 	uint32_t addr = 0;
 	uint32_t mask;
@@ -697,46 +697,22 @@  void classification_test_pmr_terms_cap(void)
 	CU_ASSERT(retval & (1 << ODP_PMR_IPPROTO));
 }
 
-void classification_test_pktio_configure(void)
-{
-	/* Configure the Different CoS for the pktio interface */
-	if (TEST_DEFAULT)
-		configure_pktio_default_cos();
-	if (TEST_ERROR)
-		configure_pktio_error_cos();
-	if (TEST_PMR_CHAIN)
-		configure_cls_pmr_chain();
-	if (TEST_L2_QOS)
-		configure_cos_with_l2_priority();
-	if (TEST_PMR)
-		configure_pmr_cos();
-	if (TEST_PMR_SET)
-		configure_pktio_pmr_match_set_cos();
-}
-
-void classification_test_pktio_test(void)
-{
-	/* Test Different CoS on the pktio interface */
-	if (TEST_DEFAULT)
-		test_pktio_default_cos();
-	if (TEST_ERROR)
-		test_pktio_error_cos();
-	if (TEST_PMR_CHAIN)
-		test_cls_pmr_chain();
-	if (TEST_L2_QOS)
-		test_cos_with_l2_priority();
-	if (TEST_PMR)
-		test_pmr_cos();
-	if (TEST_PMR_SET)
-		test_pktio_pmr_match_set_cos();
-}
-
 odp_testinfo_t classification_suite[] = {
 	ODP_TEST_INFO(classification_test_pmr_terms_avail),
 	ODP_TEST_INFO(classification_test_pktio_set_skip),
 	ODP_TEST_INFO(classification_test_pktio_set_headroom),
 	ODP_TEST_INFO(classification_test_pmr_terms_cap),
-	ODP_TEST_INFO(classification_test_pktio_configure),
-	ODP_TEST_INFO(classification_test_pktio_test),
+	ODP_TEST_INFO(classification_test_configure_pktio_default_cos),
+	ODP_TEST_INFO(classification_test_configure_pktio_error_cos),
+	ODP_TEST_INFO(classification_test_configure_cls_pmr_chain),
+	ODP_TEST_INFO(classification_test_configure_cos_with_l2_priority),
+	ODP_TEST_INFO(classification_test_configure_pmr_cos),
+	ODP_TEST_INFO(classification_test_configure_pktio_pmr_match_set_cos),
+	ODP_TEST_INFO(classification_test_pktio_default_cos),
+	ODP_TEST_INFO(classification_test_pktio_error_cos),
+	ODP_TEST_INFO(classification_test_cls_pmr_chain),
+	ODP_TEST_INFO(classification_test_cos_with_l2_priority),
+	ODP_TEST_INFO(classification_test_pmr_cos),
+	ODP_TEST_INFO(classification_test_pktio_pmr_match_set_cos),
 	ODP_TEST_INFO_NULL,
 };