From: Robbie Williamson <[email protected]> Subject: Re: [LTP] Help Need for Ar01 Test Case Date: Tue, 17 Mar 2009 15:34:25 -0500
> On 03/16/2009 09:05 PM, CAI Qian wrote: >> From: Robbie Williamson <[email protected]> >> Subject: Re: [LTP] Help Need for Ar01 Test Case >> Date: Mon, 16 Mar 2009 16:29:48 -0500 >> >>> Fixed this testcase. I'm not sure why it was written the way it was. It >>> could >>> be that the 'ar' command has changed over the past years, making test #17 >>> incorrect...which sometimes happens. In any case, I uploaded the changes to >>> CVS, and the test FAILS as it apparently should. :/ >>> >> >> Thanks. I have seen your changes, >> >> $ cvs diff -ur1.10 ar01 >> --- ar01 21 Oct 2008 06:54:15 -0000 1.10 >> +++ ar01 16 Mar 2009 21:29:30 -0000 1.12 >> @@ -454,10 +454,10 @@ >> rm -rf $TCtmp/lib.a;cd $TCdat >> ar -cr $TCtmp/lib.a file1.o >> crtest >> -size1=`ls -s $TCtmp/lib.a|(read a b; echo $a)` >> +size1=`ls -l $TCtmp/lib.a|awk '{print $5}'` >> strip $TCtmp/lib.a 2>&1 1>/dev/null >> -ar -ts $TCtmp/lib.a 2>&1 1>/dev/null >> -size2=`ls -s $TCtmp/lib.a|(read a b; echo $a)` >> +ar -s $TCtmp/lib.a 2>&1 1>/dev/null >> +size2=`ls -l $TCtmp/lib.a|awk '{print $5}'` >> >> if [ $size1 -eq $size2 ] >> >> @@ -465,7 +465,7 @@ >> echo "-)17" >> else >> TCRESULT=17 >> - echo "FAIL - ar with -does not regenerate symbol table" >> + echo "FAIL - ar with -s does not regenerate symbol table" >> fi >> >> # The -t option prints a table of contents of the archive file. >> @@ -569,7 +569,7 @@ >> ar -cr $TCtmp/lib.a file1.in file2.in file3.in >> crtest >> >> -ls -ln file1.in file2.in file3.in | >> +ls -ln --time-style=+%b" "%d" "%H:%M file1.in file2.in file3.in | >> while >> read permissions link uid gid size month day time file_name >> do >> >> (What does the last part do-- ls -ln --time-style... ? I can't find any >> description in the changelog.) > This was just something that I caught when I ran the test on my system. Where > 'ls -ln' was not exactly the same as the output of 'ar -v'. I figured I would > hard format the ls output to help. Obviously, if 'ar' decides to change its' > format, then another failure will arise....which I suppose would need code to > handle slight changes in formatting. :/ >> >> So, it was working before when it was originally written that "ar -s" >> can restore the file size to that before the strip run? Do you mean it >> might be a "ar" regression bug? > yep :). > It also seems that "ranlib" is unable to regenerate the index as well. I am filling a bug to see what developers think. Ranlib and "ar -s" Can Not Regenerate Index Last https://bugzilla.redhat.com/show_bug.cgi?id=490797 Thanks, CAI Qian >> >> In addition, test case 19 might need the some fix as well. > Done, thanks. > > -Robbie >> >> Signed-off-by: CAI Qian <[email protected]> >> >> --- testcases/commands/ade/ar/ar01.orig 2009-03-17 09:58:28.000000000 >> +0800 >> +++ testcases/commands/ade/ar/ar01 2009-03-17 09:56:47.000000000 +0800 >> @@ -495,10 +495,10 @@ >> rm -rf $TCtmp/lib.a;cd $TCdat >> ar -cr $TCtmp/lib.a file1.o >> crtest >> -size1=`ls -s $TCtmp/lib.a|(read a b; echo $a)` >> +size1=`ls -l $TCtmp/lib.a|awk '{print $5}'` >> strip $TCtmp/lib.a 2>&1 1>/dev/null >> ar -ts $TCtmp/lib.a 2>&1 1>/dev/null >> -size2=`ls -s $TCtmp/lib.a|(read a b; echo $a)` >> +size1=`ls -l $TCtmp/lib.a|awk '{print $5}'` >> >> if [ $size1 -eq $size2 ] >> then >> >> >>> -Robbie >>> >>> On 03/16/2009 11:49 AM, Robbie Williamson wrote: >>>> It's been awhile since I last looked at this testcase. I'll look into >>>> it today. :) >>>> >>>> -Robbie >>>> >>>> On 03/16/2009 11:23 AM, Subrata Modak wrote: >>>>> On Mon, Mar 16, 2009 at 9:31 PM, CAI Qian <[email protected] >>>>> <mailto:[email protected]>> wrote: >>>>> >>>>> From: CAI Qian <[email protected] <mailto:[email protected]>> >>>>> Subject: Help Need for Ar01 Test Case >>>>> Date: Mon, 16 Mar 2009 17:32:17 +0800 (CST) >>>>> >>>>> > Hi Robbie, >>>>> > >>>>> >>>>> I got delevery failure for Robbie's email address, >>>>> >>>>> Your message >>>>> >>>>> Subject: Help Need for Ar01 Test Case >>>>> >>>>> was not delivered to: >>>>> >>>>> [email protected] <mailto:[email protected]> >>>>> >>>>> because: >>>>> >>>>> User robbiew ([email protected] <mailto:[email protected]>) >>>>> not listed in Domino Directory >>>>> >>>>> Does anybody happen to know his up-to-date email? >>>>> >>>>> >>>>> He is here now :-) >>>>> >>>>> Regards-- >>>>> Subrata >>>>> >>>>> >>>>> >>>>> >>>>> CAI Qian >>>>> >>>>> > I may need your help to understand ar01 test case under >>>>> > testcases/commands/ade/ar/. >>>>> > >>>>> > The following test code may fail, and I don't understand what it >>>>> does, >>>>> > >>>>> > # The -s causes regeneration of symbol table even if a symbol table >>>>> > exists. >>>>> > >>>>> > # CODE >>>>> > >>>>> > rm -rf $TCtmp/lib.a;cd $TCdat >>>>> > ar -cr $TCtmp/lib.a file1.o >>>>> > crtest >>>>> > size1=`ls -s $TCtmp/lib.a|(read a b; echo $a)` >>>>> > strip $TCtmp/lib.a 2>&1 1>/dev/null >>>>> > ar -ts $TCtmp/lib.a 2>&1 1>/dev/null >>>>> > size2=`ls -s $TCtmp/lib.a|(read a b; echo $a)` >>>>> > >>>>> > if [ $size1 -eq $size2 ] >>>>> > >>>>> > then >>>>> > echo "-)17" >>>>> > else >>>>> > TCRESULT=17 >>>>> > echo "FAIL - ar with -does not regenerate symbol table" >>>>> > >>>>> > I have two questions. The first one is, why use "t" and "s" options >>>>> > together? >>>>> > >>>>> > ar -ts $TCtmp/lib.a 2>&1 1>/dev/null >>>>> > >>>>> > From the manpage, >>>>> > >>>>> > t Display a table listing the contents of archive, or those >>>>> of the >>>>> > files listed in member... that are present in the archive. >>>>> > Normally only the member name is shown; if you also want to >>>>> see the >>>>> > modes (permissions), timestamp, owner, group, and size, you can >>>>> > request that by also specifying the v modifier. >>>>> > >>>>> > s Write an object-file index into the archive, or update an >>>>> existing >>>>> > one, even if no other change is made to the archive. You >>>>> may use >>>>> > this modifier flag either with any operation, or alone. >>>>> Running ar >>>>> > s on an archive is equivalent to running ranlib on it. >>>>> > >>>>> > I can't see how they are related. Do you mean "ar -s"? >>>>> > >>>>> > The second one is, this piece of test code fails for me, and it >>>>> works >>>>> > sometimes probably just by dumb luck. It can be explained by the >>>>> > following, >>>>> > >>>>> > First, we create an archieve file lib.a by including file1.o. >>>>> > # ar -cr lib.a file1.o >>>>> > >>>>> > Second, we get lib.a's block size. >>>>> > # # ls -s lib.a >>>>> > 8 lib.a >>>>> > >>>>> > # nm -s lib.a >>>>> > >>>>> > Archive index: >>>>> > main in file1.o >>>>> > >>>>> > file1.o: >>>>> > 0000000000000000 r .LC0 >>>>> > 0000000000000000 T main >>>>> > U puts >>>>> > >>>>> > >>>>> > Then, we strip its symbols. >>>>> > # strip lib.a >>>>> > >>>>> > # ls -s lib.a >>>>> > 8 lib.a >>>>> > >>>>> > # nm -s lib.a >>>>> > >>>>> > file1.o: >>>>> > nm: file1.o: no symbols >>>>> > >>>>> > >>>>> > Next, use "ar -s" to generate symbol index? >>>>> > # ar -s lib.a >>>>> > >>>>> > # ls -s lib.a >>>>> > 8 lib.a >>>>> > >>>>> > # nm -s lib.a >>>>> > >>>>> > file1.o: >>>>> > nm: file1.o: no symbols >>>>> > >>>>> > >>>>> > Finally, we get lib.a's new block size, and compare with the old >>>>> one. If >>>>> > they are same, the test passes. Otherwise, fails. >>>>> > >>>>> > As you can from the above, there are two things does not make >>>>> sense to >>>>> > me, >>>>> > >>>>> > * the lib.a's block size is the same before and after stripping the >>>>> > symbols. >>>>> > >>>>> > * "ar -s" seems have not effect indicating by "nm -s" and "ls -s". >>>>> > >>>>> > Any pointer? >>>>> > >>>>> > CAI Qian >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Apps built with the Adobe(R) Flex(R) framework and Flex >>>>> Builder(TM) are >>>>> powering Web 2.0 with engaging, cross-platform capabilities. >>>>> Quickly and >>>>> easily build your RIAs with Flex Builder, the Eclipse(TM)based >>>>> development >>>>> software that enables intelligent coding and step-through debugging. >>>>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com >>>>> _______________________________________________ >>>>> Ltp-list mailing list >>>>> [email protected] <mailto:[email protected]> >>>>> https://lists.sourceforge.net/lists/listinfo/ltp-list >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Regards & Thanks-- >>>>> Subrata >>>> >>> >>> -- >>> Robbie Williamson [email protected] >>> Ubuntu Foundations Team Manager robbiew[irc.freenode.net] >>> http://wiki.ubuntu.com/FoundationsTeam +1 512 686 2051 >>> >>> "You can't be lucky all the time, but you can be smart everyday" >>> -Mos Def >>> >>> "Arrogance is thinking you are better than everyone else, while >>> Confidence is knowing no one else is better than you." -Me ;) >>> >> >> ------------------------------------------------------------------------------ >> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are >> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and >> easily build your RIAs with Flex Builder, the Eclipse(TM)based development >> software that enables intelligent coding and step-through debugging. >> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com >> _______________________________________________ >> Ltp-list mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/ltp-list > ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
