Hi Canh, Ack with comments. See attached diff file
This code does not live up to good standard regarding correct documentation and clarity (and there are other things as well that will not pass static code check). This is however not directly related to the fix as such but it is always a good idea to clean up a bit. See my attached comments for examples Thanks Lennart > -----Original Message----- > From: Canh Van Truong [mailto:canh.v.tru...@dektech.com.au] > Sent: den 31 oktober 2017 08:42 > To: Lennart Lund <lennart.l...@ericsson.com>; Vu Minh Nguyen > <vu.m.ngu...@dektech.com.au> > Cc: opensaf-devel@lists.sourceforge.net; Canh Van Truong > <canh.v.tru...@dektech.com.au> > Subject: [PATCH 1/1] log: fix logtest 4 56 fail because egrep log file fail > [#2662] > > In test case logtest 4 56, it verifies that whether written log file format is > reflected correctly. > It finds and checks the log file that has been closed > (FILENAME_YYYYMMDD_HHMMSS_YYYYMMDD_HHMMSS.log). > But sometimes the log file has not been closed successfully due to timeout > reason, this cause > that test case can not find the log file to check the content. > > The test case should also check with file format name: > FILENAME_YYYYMMDD_HHMMSS.log > --- > src/log/apitest/tet_LogOiOps.c | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/src/log/apitest/tet_LogOiOps.c b/src/log/apitest/tet_LogOiOps.c > index 86da4f862..28abf862f 100644 > --- a/src/log/apitest/tet_LogOiOps.c > +++ b/src/log/apitest/tet_LogOiOps.c > @@ -3858,10 +3858,10 @@ void verDefaultLogFileFmt(void) > The description for this macro is same as one for VERIFY_CMD. > Except, it includes close timestamp. > */ > -#define VERIFY_CMD_ > \ > - "find %s -type f -mmin -1" \ > - " | egrep \"%s_[0-9]{8}_[0-9]{6}_[0-9]{8}_[0-9]{6}\\.log$\"" \ > - " | xargs egrep \" %s \"" \ > +#define VERIFY_CMD_ \ > + "find %s -type f -mmin -1" \ > + " | egrep \"%s_[0-9]{8}_[0-9]{6}.*\\.log$\"" \ > + " | xargs egrep \" %s \"" \ > " 1> /dev/null" > > /* Get current value of the attribute */ > @@ -3896,10 +3896,8 @@ void verDefaultLogFileFmt(void) > if (rc == -1) { > /* Failed to execute command on the shell. Report > error, > * then exit */ > - fprintf( > - stderr, > - "Failed to execute command (%s) on the shell. \n", > - VERIFY_CMD_); > + fprintf(stderr, "Failed to execute command (%s) on " > + "the shell. \n", VERIFY_CMD_); > test_validate(rc, 0); > return; > } > -- > 2.13.0
smf_2662_review_Lennart1.diff
Description: smf_2662_review_Lennart1.diff
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel