Re: [devel] [PATCH 1/1] evt: resurrect apitests v2 [#2974]

2019-01-10 Thread mohan
 Hi Mathi,
Can you please push this patch.


 
Thanks Mohan
High Availability Solutions Pvt. Ltd.
www.hasolutions.in

 
 
- Original Message - Subject: Re: [PATCH 1/1] evt: resurrect 
apitests v2 [#2974]
From: "Mathi N P" 
Date: 1/10/19 4:54 pm
To: "Mohan Kanakam" 
Cc: "Hans Nordeback" , 
opensaf-devel@lists.sourceforge.net

 Ack, Mathi.


  On Tue, Dec 18, 2018 at 11:48 AM Mohan Kanakam  wrote:
---
  opensaf.spec.in |   1 +
  src/evt/Makefile.am |  17 ++
  src/evt/apitest/Makefile|  20 +++
  src/evt/apitest/evttest.c   |  44 +
  src/evt/apitest/tet_eda.c   | 320 ++--
  src/evt/apitest/tet_eda.h   |  23 ++-
  src/evt/apitest/tet_edsv_func.c |  54 ++
  src/evt/apitest/tet_edsv_util.c | 201 +-
  src/evt/apitest/tet_edsv_wrappers.c |  19 ++-
  9 files changed, 522 insertions(+), 177 deletions(-)
  create mode 100644 src/evt/apitest/Makefile
  create mode 100644 src/evt/apitest/evttest.c
 
 diff --git a/opensaf.spec.in b/opensaf.spec.in
 index 5ae2070..b7c37d9 100644
 --- a/opensaf.spec.in
 +++ b/opensaf.spec.in
 @@ -1533,6 +1533,7 @@ fi
  %{_bindir}/clmtest
  %{_bindir}/mdstest
  %{_bindir}/amftest
 +%{_bindir}/evttest
  %if %is_ais_smf
  #SMF: Demo and test of CCB handling
  %{_bindir}/ccbdemo_create
 diff --git a/src/evt/Makefile.am b/src/evt/Makefile.am
 index 0c36ea6..819bab8 100644
 --- a/src/evt/Makefile.am
 +++ b/src/evt/Makefile.am
 @@ -137,9 +137,26 @@ bin_osafevtd_LDADD = \
 
  if ENABLE_TESTS
 
 +bin_evttest_CPPFLAGS = \
 +   $(AM_CPPFLAGS)
 +
 +bin_PROGRAMS += bin/evttest
 +
  noinst_HEADERS += \
 src/evt/apitest/tet_eda.h
 
 +bin_evttest_SOURCES = \
 +  src/evt/apitest/tet_edsv_wrappers.c \
 +  src/evt/apitest/tet_eda.c \
 +  src/evt/apitest/tet_edsv_func.c \
 +  src/evt/apitest/tet_edsv_util.c \
 +  src/evt/apitest/evttest.c
 +
 +bin_evttest_LDADD = \
 +  lib/libSaEvt.la \
 +  lib/libopensaf_core.la \
 +  lib/libapitest.la
 +
  endif
 
  endif
 diff --git a/src/evt/apitest/Makefile b/src/evt/apitest/Makefile
 new file mode 100644
 index 000..561fe8b
 --- /dev/null
 +++ b/src/evt/apitest/Makefile
 @@ -0,0 +1,20 @@
 +#  -*- OpenSAF  -*-
 +#
 +#(C) Copyright 2017 The OpenSAF Foundation
 +#
 +#This program is distributed in the hope that it will be useful, but
 +#WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 +#or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
 +#under the GNU Lesser General Public License Version 2.1, February 1999.
 +#The complete license can be accessed from the following location:
 +#http://opensource.org/licenses/lgpl-license.php
 +#See the Copying file included with the OpenSAF distribution for full
 +# licensing terms.
 +#
 +# Author(s): High Availability Solutions
 +#
 +#
 +
 +all:
 +   $(MAKE) -C ../../.. bin/evttest
 +
 diff --git a/src/evt/apitest/evttest.c b/src/evt/apitest/evttest.c
 new file mode 100644
 index 000..3712b3e
 --- /dev/null
 +++ b/src/evt/apitest/evttest.c
 @@ -0,0 +1,44 @@
 +/*  -*- OpenSAF  -*-
 + *
 + * (C) Copyright 2017 The OpenSAF Foundation
 + *
 + * This program is distributed in the hope that it will be useful, but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
 + * under the GNU Lesser General Public License Version 2.1, February 1999.
 + * The complete license can be accessed from the following location:
 + * http://opensource.org/licenses/lgpl-license.php
 + * See the Copying file included with the OpenSAF distribution for full
 + * licensing terms.
 + *
 + * Author(s): High Availability Solutions
 + *
 + */
 +
 +#include 
 +#include 
 +#include "osaf/apitest/utest.h"
 +#include "osaf/apitest/util.h"
 +
 +int main(int argc, char **argv)
 +{
 +   int suite = ALL_SUITES, tcase = ALL_TESTS;
 +
 +   srandom(getpid());
 +
 +   if (argc > 1) {
 +   suite = atoi(argv[1]);
 +   }
 +
 +   if (argc > 2) {
 +   tcase = atoi(argv[2]);
 +   }
 +
 +   if (suite == 0) {
 +   test_list();
 +   return 0;
 +   }
 +
 +   return test_run(suite, tcase);
 +}
 +
 diff --git a/src/evt/apitest/tet_eda.c b/src/evt/apitest/tet_eda.c
 index bfd9d2e..4c551df 100644
 --- a/src/evt/apitest/tet_eda.c
 +++ b/src/evt/apitest/tet_eda.c
 @@ -1,7 +1,7 @@
 +#include 
  #include 
 -#include "tet_api.h"
 -#include "tet_startup.h"
  #include "tet_eda.h"
 +#include "osaf/apitest/utest.h"
  void tet_edsv_startup(void);
  void tet_edsv_cleanup(void);
 
 @@ -55,6 +55,7 @@ void tet_saEvtInitializeCases(int iOption)
 gl_rc = saEvtInitialize(NULL, _evtCallbacks, _version);
 result("saEvtInitialize() with NULL event handle",
SA_AIS_ERR_INVALID_PARAM);
 +   rc_validate(gl_rc, 

Re: [devel] [PATCH 1/1] evt: resurrect apitests v2 [#2974]

2019-01-10 Thread Mathi N P
Ack,
Mathi.

On Tue, Dec 18, 2018 at 11:48 AM Mohan Kanakam  wrote:

> ---
>  opensaf.spec.in |   1 +
>  src/evt/Makefile.am |  17 ++
>  src/evt/apitest/Makefile|  20 +++
>  src/evt/apitest/evttest.c   |  44 +
>  src/evt/apitest/tet_eda.c   | 320
> ++--
>  src/evt/apitest/tet_eda.h   |  23 ++-
>  src/evt/apitest/tet_edsv_func.c |  54 ++
>  src/evt/apitest/tet_edsv_util.c | 201 +-
>  src/evt/apitest/tet_edsv_wrappers.c |  19 ++-
>  9 files changed, 522 insertions(+), 177 deletions(-)
>  create mode 100644 src/evt/apitest/Makefile
>  create mode 100644 src/evt/apitest/evttest.c
>
> diff --git a/opensaf.spec.in b/opensaf.spec.in
> index 5ae2070..b7c37d9 100644
> --- a/opensaf.spec.in
> +++ b/opensaf.spec.in
> @@ -1533,6 +1533,7 @@ fi
>  %{_bindir}/clmtest
>  %{_bindir}/mdstest
>  %{_bindir}/amftest
> +%{_bindir}/evttest
>  %if %is_ais_smf
>  #SMF: Demo and test of CCB handling
>  %{_bindir}/ccbdemo_create
> diff --git a/src/evt/Makefile.am b/src/evt/Makefile.am
> index 0c36ea6..819bab8 100644
> --- a/src/evt/Makefile.am
> +++ b/src/evt/Makefile.am
> @@ -137,9 +137,26 @@ bin_osafevtd_LDADD = \
>
>  if ENABLE_TESTS
>
> +bin_evttest_CPPFLAGS = \
> +   $(AM_CPPFLAGS)
> +
> +bin_PROGRAMS += bin/evttest
> +
>  noinst_HEADERS += \
> src/evt/apitest/tet_eda.h
>
> +bin_evttest_SOURCES = \
> +  src/evt/apitest/tet_edsv_wrappers.c \
> +  src/evt/apitest/tet_eda.c \
> +  src/evt/apitest/tet_edsv_func.c \
> +  src/evt/apitest/tet_edsv_util.c \
> +  src/evt/apitest/evttest.c
> +
> +bin_evttest_LDADD = \
> +  lib/libSaEvt.la \
> +  lib/libopensaf_core.la \
> +  lib/libapitest.la
> +
>  endif
>
>  endif
> diff --git a/src/evt/apitest/Makefile b/src/evt/apitest/Makefile
> new file mode 100644
> index 000..561fe8b
> --- /dev/null
> +++ b/src/evt/apitest/Makefile
> @@ -0,0 +1,20 @@
> +#  -*- OpenSAF  -*-
> +#
> +#(C) Copyright 2017 The OpenSAF Foundation
> +#
> +#This program is distributed in the hope that it will be useful, but
> +#WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY
> +#or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
> +#under the GNU Lesser General Public License Version 2.1, February 1999.
> +#The complete license can be accessed from the following location:
> +#http://opensource.org/licenses/lgpl-license.php
> +#See the Copying file included with the OpenSAF distribution for full
> +# licensing terms.
> +#
> +# Author(s): High Availability Solutions
> +#
> +#
> +
> +all:
> +   $(MAKE) -C ../../.. bin/evttest
> +
> diff --git a/src/evt/apitest/evttest.c b/src/evt/apitest/evttest.c
> new file mode 100644
> index 000..3712b3e
> --- /dev/null
> +++ b/src/evt/apitest/evttest.c
> @@ -0,0 +1,44 @@
> +/*  -*- OpenSAF  -*-
> + *
> + * (C) Copyright 2017 The OpenSAF Foundation
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY
> + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
> + * under the GNU Lesser General Public License Version 2.1, February 1999.
> + * The complete license can be accessed from the following location:
> + * http://opensource.org/licenses/lgpl-license.php
> + * See the Copying file included with the OpenSAF distribution for full
> + * licensing terms.
> + *
> + * Author(s): High Availability Solutions
> + *
> + */
> +
> +#include 
> +#include 
> +#include "osaf/apitest/utest.h"
> +#include "osaf/apitest/util.h"
> +
> +int main(int argc, char **argv)
> +{
> +   int suite = ALL_SUITES, tcase = ALL_TESTS;
> +
> +   srandom(getpid());
> +
> +   if (argc > 1) {
> +   suite = atoi(argv[1]);
> +   }
> +
> +   if (argc > 2) {
> +   tcase = atoi(argv[2]);
> +   }
> +
> +   if (suite == 0) {
> +   test_list();
> +   return 0;
> +   }
> +
> +   return test_run(suite, tcase);
> +}
> +
> diff --git a/src/evt/apitest/tet_eda.c b/src/evt/apitest/tet_eda.c
> index bfd9d2e..4c551df 100644
> --- a/src/evt/apitest/tet_eda.c
> +++ b/src/evt/apitest/tet_eda.c
> @@ -1,7 +1,7 @@
> +#include 
>  #include 
> -#include "tet_api.h"
> -#include "tet_startup.h"
>  #include "tet_eda.h"
> +#include "osaf/apitest/utest.h"
>  void tet_edsv_startup(void);
>  void tet_edsv_cleanup(void);
>
> @@ -55,6 +55,7 @@ void tet_saEvtInitializeCases(int iOption)
> gl_rc = saEvtInitialize(NULL, _evtCallbacks,
> _version);
> result("saEvtInitialize() with NULL event handle",
>SA_AIS_ERR_INVALID_PARAM);
> +   rc_validate(gl_rc, SA_AIS_ERR_INVALID_PARAM);
> break;
>
> case 2:
> @@ -65,7 +66,7 @@ void tet_saEvtInitializeCases(int iOption)
> gl_rc = saEvtInitialize(_evtHandle, NULL, _version);
>