Re: [devel] [PATCH 1 of 1] log: fix ER syslog when running logtest 5 2 [#1864]

2016-09-19 Thread A V Mahesh
ACK,

Not tested.

-AVM


On 9/16/2016 2:30 PM, Canh Van Truong wrote:
>   tests/logsv/tet_LogOiOps.c |  11 +++
>   1 files changed, 11 insertions(+), 0 deletions(-)
>
>
> Not wait for apply callback in logtest 5 2 done before removing test directory
> (in this test case, it changes 'logRootDirectory' attribute, then there are 
> action of renames files)
>
> The patch adds a check loop to make sure all apply callback (rename log 
> files) done
> before removing the log test directory.
>
> diff --git a/tests/logsv/tet_LogOiOps.c b/tests/logsv/tet_LogOiOps.c
> --- a/tests/logsv/tet_LogOiOps.c
> +++ b/tests/logsv/tet_LogOiOps.c
> @@ -969,6 +969,7 @@ void saLogOi_52(void)
>   void saLogOi_48(void)
>   {
>   int rc = 0, tst_stat = 0;
> + unsigned int count = 100;
>   char command[256];
>   char tstdir[256];
>   
> @@ -1011,6 +1012,16 @@ void saLogOi_48(void)
>   }
>   
>   done_remove:
> + /* Check if all files have been renamed in 'tstdir' before remove them*/
> + for (int i = 0; i < count; i++) {
> + usleep(100*1000);
> + /* Find if any files in 'tstdir' have not been rename (append 
> time_stamp). */
> + sprintf(command, "find %s -type f | egrep -v 
> \".*_[0-9]{8}_[0-9]{6}.*\"  1> /dev/null",
> + tstdir);
> + rc = system(command);
> + if (WEXITSTATUS(rc) != 0)
> + break;
> + }
>   /* Remove xxtest no longer used */
>   sprintf(command, "rm -rf %s/", tstdir);
>   rc = tet_system(command);


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] log: fix ER syslog when running logtest 5 2 [#1864]

2016-09-16 Thread Vu Minh Nguyen
Ack

Regards, Vu

> -Original Message-
> From: Canh Van Truong [mailto:canh.v.tru...@dektech.com.au]
> Sent: Friday, September 16, 2016 4:00 PM
> To: lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au;
> mahesh.va...@oracle.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] log: fix ER syslog when running logtest 5 2
[#1864]
> 
>  tests/logsv/tet_LogOiOps.c |  11 +++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> 
> Not wait for apply callback in logtest 5 2 done before removing test
directory
> (in this test case, it changes 'logRootDirectory' attribute, then there
are
> action of renames files)
> 
> The patch adds a check loop to make sure all apply callback (rename log
files)
> done
> before removing the log test directory.
> 
> diff --git a/tests/logsv/tet_LogOiOps.c b/tests/logsv/tet_LogOiOps.c
> --- a/tests/logsv/tet_LogOiOps.c
> +++ b/tests/logsv/tet_LogOiOps.c
> @@ -969,6 +969,7 @@ void saLogOi_52(void)
>  void saLogOi_48(void)
>  {
>   int rc = 0, tst_stat = 0;
> + unsigned int count = 100;
>   char command[256];
>   char tstdir[256];
> 
> @@ -1011,6 +1012,16 @@ void saLogOi_48(void)
>   }
> 
>  done_remove:
> + /* Check if all files have been renamed in 'tstdir' before remove
> them*/
> + for (int i = 0; i < count; i++) {
> + usleep(100*1000);
> + /* Find if any files in 'tstdir' have not been rename
(append
> time_stamp). */
> + sprintf(command, "find %s -type f | egrep -v \".*_[0-
> 9]{8}_[0-9]{6}.*\"  1> /dev/null",
> + tstdir);
> + rc = system(command);
> + if (WEXITSTATUS(rc) != 0)
> + break;
> + }
>   /* Remove xxtest no longer used */
>   sprintf(command, "rm -rf %s/", tstdir);
>   rc = tet_system(command);


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] log: fix ER syslog when running logtest 5 2 [#1864]

2016-09-16 Thread Canh Van Truong
 tests/logsv/tet_LogOiOps.c |  11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)


Not wait for apply callback in logtest 5 2 done before removing test directory
(in this test case, it changes 'logRootDirectory' attribute, then there are 
action of renames files)

The patch adds a check loop to make sure all apply callback (rename log files) 
done
before removing the log test directory.

diff --git a/tests/logsv/tet_LogOiOps.c b/tests/logsv/tet_LogOiOps.c
--- a/tests/logsv/tet_LogOiOps.c
+++ b/tests/logsv/tet_LogOiOps.c
@@ -969,6 +969,7 @@ void saLogOi_52(void)
 void saLogOi_48(void)
 {
int rc = 0, tst_stat = 0;
+   unsigned int count = 100;
char command[256];
char tstdir[256];
 
@@ -1011,6 +1012,16 @@ void saLogOi_48(void)
}
 
 done_remove:
+   /* Check if all files have been renamed in 'tstdir' before remove them*/
+   for (int i = 0; i < count; i++) {
+   usleep(100*1000);
+   /* Find if any files in 'tstdir' have not been rename (append 
time_stamp). */
+   sprintf(command, "find %s -type f | egrep -v 
\".*_[0-9]{8}_[0-9]{6}.*\"  1> /dev/null",
+   tstdir);
+   rc = system(command);
+   if (WEXITSTATUS(rc) != 0)
+   break;
+   }
/* Remove xxtest no longer used */
sprintf(command, "rm -rf %s/", tstdir);
rc = tet_system(command);

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel