Monday, November 05, 2007

Home... Sweet Home...

Finally got a new home for myself. Many many thanks to manas for this nice gift. :-)

URL: http://sp2hari.com/

Feed URL: http://sp2hari.com/feed/

Update your links and feed url.

Monday, October 15, 2007

Blue... ;-) ;-)

Wikipedia says
"The term blue may refer to any of a number of similar colors. The sensation of blue is made by light having a spectrum dominated by energy in the wavelength range of about 440–490 nm.
Blue is considered to be one of the three primary additive colors in the RGB system; blue light has the shortest wavelength range of the three additive primary colors. The English language commonly uses "blue" to refer to any color from navy blue to cyan."

Some strange facts ( of course i googled for them :P )
  • Blue eyes are the most sensitive to light, brown eyes the least sensitive!
  • Owls are the only birds who can see the color blue!
  • 80 percent of Americans love blue color!
  • Blue and white are the most common school colors!
  • Animal breeders in Russia once claimed to have bred sheep with blue wool!
  • A scallop has 35 blue eyes!
  • Mosquitoes are attracted to the color blue twice as much as any other!
  • Maine produces about 98-99% of all wild blueberries in the US!
  • The red traffic light contains some orange color and the green traffic light contains some blue color making it easier for people with red-green color blindness!
  • More people use blue toothbrushes, than red ones!
  • Other than humans, black lemurs are the only primates that may have blue eyes!
  • There are only two animals with blue tongues, the Black Bear and the Chow dog!
  • The blue whale can produce sounds up to about 188 decibels!
  • A blue whales heart beats nine times per minute!
  • Most elephants weigh less than the tongue of the blue whale!
  • Blue whales weigh as much as 30 elephants and are as long as 3 Greyhound buses!
  • The blood vessels of a blue whale are wide enough for an adult trout to swim through!
Well enough of facts, I'll tell you some more nice facts :P :P
  • Sudden change to blue color makes people shout "Blue Blue Blue" all the time. This syndrome can be observed around one week even before the color change occurs.
  • Any girl who works in front of computer most of the time loves blue color than anything else.
  • Though blue color wavelength is 440-490 nm, the lower bound for blue color is 1200 and the upper bound is 1500.
  • Though the hexadecimal triplet for blue is #0000FF, the actual blue you see in the websites is #6666FF. This can be checked in the css file. For example
  • /* Blue */
    .coderTextBlue, .coderTextBlue:link, .coderTextBlue:visited, .coderTextBlue:hover, .coderTextBlue:active 
    { color: #6666FF; }
Hmmmm, i wish i could write more but have to stop here :-) :-)

Thursday, September 20, 2007

Slice...

Slice notation is one of the powerful feature in python using which can be used for operations like substr, str_reverse etc etc.

The slice notation is really powerful for strings. I'm not very sure whether it can be used for other data types.

For a string, it can be used as variable_name[start:end:step]

If the start and end are equal, then a null string is returned.
If step is positive and start is greater than the end, then a null string is returned.
If step is negative and start is lesser than the end, then a null string is returned.

Ok. If you are confused about start, end, step, equal, greater. lesser, positive and negative, don't worry. Things are explained very clearly after this. :-)

First few lines about the step. If the step is positive, then the direction in which the input string is scanned is forward direction. If the step is negative, then the string is scanned in reverse direction. So now i hope you understand why start must be less than end if step is positive. For the same reason, start must be less than end if the step is negative.

Let us see a simple slice example.

>>> i = "Hello World"
>>> i[2:10:1]
'llo Worl'

So it's very clear that the basic action of the slice notation is to return a sub string.
In the above example, it returns the characters from the string whose position are equal to and greater than start and less than end.

Note :: The character at position end is not returned.
In the above example i[10] = "d" is not returned.

If the start is not specified and step is positive, then the default value is 0
If the end is not specified and step is positive, then the default value is len(string).
If the start is not specified and step is negative then the default value is len(string).
If the end is not specified and step is negative, then the default value is NOT 0, coz in this case even 0th character is returned.
If the step is not specified, then the default value is 1


So i[::] prints the entire string. In fact, in most cases the step is not specified. So i[:] returns the entire string.

>>> i = "Hello World"
>>> i[::]
'Hello World'
>>> i[:]
'Hello World'
>>>

Slice notation can also take negative values.
If the start value is negative, then the last start characters are returned.
If the end value is negative, then the last end characters are not returned.

So if both start and end values are negative, then the absolute value of start must be greater than the absolute value of end. Else a null string will be returned.

>>> i = "Hello World"
>>> i[-5:] #Start is -ve. So last 5 characters
'World'
>>> i[:-5] #End is -ve. So everything except last 5 characters
'Hello '
>>> i[-8:-3] #Start is -8. =>"lo World". In this don't include last 3 characters => "lo Wo"
'lo Wo'
>>>

The real fun is when even step is negative.
If the start is greater than the end, then the step must be -ve, which makes the string to be returned as reverse.

So consider this example.
>>> i = "Hello World"
>>> i[8:4:-1]
'roW '
>>>

In the above example, i[8:4] part refers to i[8] and i[4] positions and since the step is negative, now it returns characters at i[8], i[7], i[6], i[5]. Note that even here i[4] is not returned.

Finally, if step is something other than 1, then every stepth character is returned. For example
>>> i = "Hello World"
>>> i[::2]
'HloWrd'
>>> i[::-2]
'drWolH'
>>>

Any idea why i wrote this post.

Saw this small snippet for string reverse in python

>>> a = "Hello World"
>>> print a[::-1]
dlroW olleH
>>>

Sweet and cute na. ;-)

To know more about slice notation you refer to the python python doc.

Sunday, September 09, 2007

Potato Guy ...


I wasn't sure why people celebrate shutdown day and all. The whole idea looked stupid. :P But it was not so.

Our college network was shutdown yesterday. No Gmail. No Orkut. No Spider. No Delta. Nothing :P
All i had was 2 or 3 computers with Linux and Windows :). Many many thanks to all the Gnome and KDE games, the day wasn't that boring. In fact, i don't mind having shutdown day once in a week :) :) :)
The good thing about shutdown day is that even if you want to work, you can't. :-). So you don't feel bad or guilty about not working for one whole day. :-) :-) :-)

Some of the nice games which are worth playing are
1. Attax
2. KAtomic (Even those who don't like chemistry might end up playing this for hours :) )
3. Kolf
4. Potato Guy
5. Iagno

Sunday, August 26, 2007

Firefox 3 is amazing :)

Working on any product which is not yet released and developed by hackers all over the world ;) gives you sweet surprises every now and then ;).

I have already mentioned how the form elements are made better in FF3.0 in http://sp2hari.blogspot.com/2007/06/firefox-3-ui-rocks.html

The next surprise is Bookmarks ,FTP browsing and Downloads window :-) :).

Check out the screenshot for yourself


The favicon for the ftp is cute :-).

Next one is the way bookmarks are added. Just like starring a mail in Gmail.
Check this screenshot. You can see a star there right in the Location bar right?

Click that once and the link is bookmarked :).

Next time you click it, you get bookmark options :)

Finally, the downloads window is more colorful now, with some new images :)


The search in the downloads is a cool feature :)

Hmmm, these are some of the features which i could notice while testing firefox. Not sure how much more is there :-). Really firefox 3 is going to rock :)

Saturday, August 25, 2007

Recording your screen in solaris :)

Recording your screen in Solaris works right out of the box. All you need to install is vncserver and vnc2swf.

A simple HOW TO about recording your screen in Solaris. :)

First you need to install Vncserver. Solaris by default doesn't come with a VNC. The easiest way to install VNC is through pkg-get

root@home# pkg-get -i vncserver

Before running that command, configure your pkg-get to get the packages from blastwave.org. Check http://www.blastwave.org/howto.html to get more details about setting up the repo.
That should install vncserver. :)

Next step it to install vnc2swf.
Download the C version of vnc2swf from http://www.unixuser.org/%7Eeuske/vnc2swf/index.html.
Extract the tar ball

hari@home:~$cd vnc2swf
hari@home:~$./configure
hari@home:~$make
root@home#make install

The commands mentioned above will install vnc2swf . :)

All you need to do to use vnc2swf is to start a vncserver. vnc2swf just needs the output file name to be passed as command line argument when started. Pressing F8 gives the options to start, stop, pause and clear the reocrding.

Some of the issues i faced are :)

1. When the same user tries to start a gnome-session in the vnc, an error message saying gnome-session is already running is given. So the best bet is to create a new user and start the vncserver of that user.

2. The icons are not displayed properly if you login into the new user's account using GNOME. Use Common Desktop Environment (CDE) to login and start a vncserver.

3. By default, the new user won't have a .vnc folder. So start a vnc and kill that. Now you will have .vnc folder with a xstartup file. Modify the file so that gnome-session runs in the vnc instead of the default twm. The xstartup file should look like

#!/bin/sh

/usr/openwin/bin/xrdb $HOME/.Xresources
/usr/openwin/bin/xsetroot -solid grey
/usr/openwin/bin/xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#/usr/openwin/bin/twm &
gnome-session &


And yeah, what i recorded can be viewed at http://download.freedesktop.org/ldtp/movies/screen2.html. Nice right ;-)

My Tinderbox is working...

Yes, you heard it right. My tinderbox is working. Even now i don't know why i was trying to setup a tinderbox after both Emily and Nags asked me to concentrate on Firefox automation. I felt it was almost done and just few more steps, i will be able to set it up. And that's what finally happened :)

So in this post, i am going to mention about all issues i faced in setting up a tinderbox and steps to fix them.

Note :: If you are ever setting up a tinderbox, be prepared to see huge log files. Like once my compilation ran for few hours and produced a log file of size 15MB. And if you are stuck up, DON'T send the entire file. A tail of that file should do. In fact, you should be in a position to find out from while line the exact error starts.

Yeah before you start reading this
http://sp2hari.blogspot.com/2007/06/conquered-solaris.html and
http://sp2hari.blogspot.com/2007/06/tinderbox.html has instructions about how to setup Tinderbox in Solaris environment.

Ok the first error i got was

Building deps for jsinterp.c
cc -o jsinterp.o -c -DOSTYPE=\"SunOS5\" -DOSARCH=SunOS -DEXPORT_JS_API -DJS_USE_SAFE_ARENA -I../../dist/include -I../../dist/include/js -I../../dist/include/nspr -DMOZ_PNG_READ -DMOZ_PNG_WRITE -I../../dist/sdk/include -I. -KPIC -xlibmil -xstrconst -xbuiltin=%all -mt -DNDEBUG -DTRIMMED -xO4 -DMOZILLA_VERSION=\"1.9a7pre\" -DMOZILLA_VERSION_U=1.9a7pre -DSOLARIS=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DD_INO=d_ino -DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_SIGINFO_T=1 -DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_INT64_T=1 -DHAVE_UINT=1 -DHAVE_UINT_T=1 -DHAVE_UINT16_T=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_BYTEORDER_H=1 -DHAVE_GETOPT_H=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_NL_TYPES_H=1 -DHAVE_MALLOC_H=1 -DHAVE_X11_XKBLIB_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_LIBM=1 -DHAVE_LIBDL=1 -DHAVE_LIBSOCKET=1 -DFUNCPROTO=15 -DHAVE_XSHM=1 -D_REENTRANT=1 -DHAVE_RANDOM=1 -DHAVE_STRERROR=1 -DHAVE_LCHOWN=1 -DHAVE_FCHMOD=1 -DHAVE_SNPRINTF=1 -DHAVE_MEMMOVE=1 -DHAVE_RINT=1 -DHAVE_STAT64=1 -DHAVE_LSTAT64=1 -DHAVE_FLOCKFILE=1 -DHAVE_LOCALTIME_R=1 -DHAVE_STRTOK_R=1 -DHAVE_LANGINFO_CODESET=1 -DVA_COPY=va_copy -DHAVE_VA_COPY=1 -DHAVE_I18N_LC_MESSAGES=1 -DMOZ_EMBEDDING_LEVEL_DEFAULT=1 -DMOZ_EMBEDDING_LEVEL_BASIC=1 -DMOZ_EMBEDDING_LEVEL_MINIMAL=1 -DMOZ_PHOENIX=1 -DMOZ_BUILD_APP=browser -DMOZ_XUL_APP=1 -DMOZ_DEFAULT_TOOLKIT=\"cairo-gtk2\" -DMOZ_WIDGET_GTK2=1 -DMOZ_ENABLE_XREMOTE=1 -DMOZ_THEBES=1 -DMOZ_CAIRO_GFX=1 -DMOZ_X11=1 -DMOZ_DISTRIBUTION_ID=\"org.mozilla\" -DMOZ_ENABLE_XFT=1 -DMOZ_ENABLE_PANGO=1 -DMOZ_ENABLE_COREXFONTS=1 -DMOZ_ENABLE_GNOMEUI=1 -DMOZ_EXTRA_X11CONVERTERS=1 -DOJI=1 -DIBMBIDI=1 -DMOZ_VIEW_SOURCE=1 -DACCESSIBILITY=1 -DMOZ_XPINSTALL=1 -DMOZ_JSLOADER=1 -DNS_PRINTING=1 -DNS_PRINT_PREVIEW=1 -DMOZ_NO_XPCOM_OBSOLETE=1 -DMOZ_XTF=1 -DMOZ_MATHML=1 -DMOZ_ENABLE_CANVAS=1 -DMOZ_SVG=1 -DMOZ_SVG_FOREIGNOBJECT=1 -DMOZ_UPDATE_CHANNEL=default -DMOZ_PLACES=1 -DMOZ_PLACES_BOOKMARKS=1 -DMOZ_FEEDS=1 -DMOZ_STORAGE=1 -DMOZ_SAFE_BROWSING=1 -DMOZ_URL_CLASSIFIER=1 -DMOZ_LOGGING=1 -DMOZ_USER_DIR=\".mozilla\" -DMOZ_ENABLE_LIBXUL=1 -DHAVE_STDINT_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_SYS_INT_TYPES_H=1 -DHAVE_UINT64_T=1 -DMOZ_XUL=1 -DMOZ_PROFILELOCKING=1 -DMOZ_RDF=1 -DMOZ_MORKREADER=1 -DMOZ_DLL_SUFFIX=\".so\" -DXP_UNIX=1 -DUNIX_ASYNC_DNS=1 -DJS_THREADSAFE=1 -DMOZ_ACCESSIBILITY_ATK=1 -DATK_MAJOR_VERSION=1 -DATK_MINOR_VERSION=12 -DATK_REV_VERSION=3 -DMOZILLA_LOCALE_VERSION=\"1.9a1\" -DMOZILLA_REGION_VERSION=\"1.9a1\" -DMOZILLA_SKIN_VERSION=\"1.8\" -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT jsinterp.c
ube: error: Assert has been violated at '/set/venus/builds.intel-S2/nightly.Thu/intel-S2/lang/ube/graphs/src/scregion.c 305'.
cc: ube failed for jsinterp.c
gmake[4]: *** [jsinterp.o] Error 2

Dave from Sun china asked me use a patch for Sun Studio 11 Compiler C. I don't have the link to the patch now but the patch id is 121016-05. I remember getting it from the sun website. So searching there should give you the link. The above patch was dependent on patch 120759-06. So installed patch 120759-06 first and then install the patch 121016-05.

Steps to add a patch in Solaris are given below. The commands are for patch 121016-05. Change the id according to the patch you are installing.

1. Download 121016-05.zip and extract the contents in your current directory
2. Login as root
3. root@home# patchadd 121016-05
Note :: If the above command doesn't work, then try
root@home# patchadd . 121016-05


The above steps should install the patch in your system. To check whether the patch is installed properly, check the folder /var/sadm/patch/. You should see seperate directories for each patch you have installed. In my system here, the /var/sdm/patch is like
# cd /var/sadm/patch/
# ls
120759-06 121016-05

That fixed the above problem :).

The next error i got was

jsinterp.c
ir2hf: error: Ran out of memory
cc: ir2hf failed for jsinterp.c

Now this is a strange problem and which can be fixed without much issue. You need more RAM. My system had 768MB (512+256) RAM, but you need 1GB RAM to fix this issue. So next day i got 1GB RAM and never got this error back.

After that, i got many compilation errors. This happened because of some issue in the mozilla code. This generally never happens. I got errors in lines having inline. Anyway now i am not getting the error anymore. So i think the mozilla code is fixed now. :)

Finally i got an error saying,

gmake[3]: Leaving directory `/export/home/hari/tinderbox
/SunOS_5.11_Depend/mozilla'
gmake[2]: Leaving directory `/export/home/hari/tinderbox/SunOS_5.11_Depend/mozilla'
make[1]: Leaving directory `/export/home/hari/tinderbox/SunOS_5.11_Depend/mozilla'
firefox-bin built successfully.
firefox-bin built successfully.
firefox-bin binary exists, build successful.
Unable to find path to Talkback client. Proceeding as if Talkback was not installed.


Running regxpcom test ...
Timeout = 120 seconds.
Begin: Fri Aug 24 08:08:37 2007
cmd = /export/home/hari/tinderbox/SunOS_5.11_Depend/mozilla//dist/bin/firefox-bin -register
End: Fri Aug 24 08:08:38 2007
----------- Output from regxpcom -------------
----------- End Output from regxpcom ---------
regxpcom: test failed
No profile found, creating profile.
Begin: Fri Aug 24 08:08:38 2007
cmd = /export/home/hari/tinderbox/SunOS_5.11_Depend/mozilla//dist/bin/firefox-bin -CreateProfile default
End: Fri Aug 24 08:08:39 2007
----------- Output from Profile Creation -------------
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(firefox-bin:6432): Gtk-WARNING **: cannot open display:
----------- End Output from Profile Creation ---------
ERROR: profile /export/home/hari/tinderbox/SunOS_5.11_Depend/.mozilla/firefox/ does not exist
no pref file found

The solution for the above bug was to allow connections to X server. This is done by executing the following command before starting a tinderbox compilation. Remember the user who is running the tinderbox should execute the command.

hari@home:~$/usr/openwin/bin/xhost +
access control disabled, clients can connect from any host

Few other things to note while trying to compile firefox under tinderbox are
1. Never ever run two instances of tinderbox at the same time. Make sure the first one is killed before starting a new one.
2. Delete the SunOS_5.11_Depend folder when you are facing any compilation errors.
3. Use -XO3 for CFLAGS and CXXFLAGS
4. Make sure your mozconfig file has these lines
ac_add_options --disable-freetype2
ac_add_options --disable-debug
ac_add_options --disable-tests

Wednesday, August 22, 2007

SOC ....

Updates about SOC.
30 test scripts are working fine without any issue :). My target is to write 50 test cases and i will try to reach that this weekend :) :).

The scripts can be downloaded from here.

Things to be modified when you run your script in your environment are.
1. In the file firefox.xml, change the value of <filepath> for so that it points the file called index.html in the folder called data in your scripts directory.

Let me give a detailed HOW TO for running these scripts.

1. First, LDTP must be installed in your system.
The CVS page in ldtp.freedesktop.org provides the instructions for getting the LDTP code through CVS.

Note : I had a small issue compiling the code which i got from CVS.
While using ./configure it gave me an error saying

./configure: line 3998: syntax error near unexpected token `LIBXML2,'
./configure: line 3998: `PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.0.0)'

The above error is because autoconf and pkg-conf are installed at two different locations. For more details check http://lists.freedesktop.org/pipermail/xserver/2003-December/000573.html

So i used this package which compiled without any issue :).
For more details on how to install, check here.

2. Enable Accessibility from gnome-control-center

3. Download and start Firefox3.0a*pre from here ( Any FF3.0 alpha release should work, though with FF3.0a8pre, it is tested throughly.
Note :: When you start firefox, make sure you don't have any other instance of firefox running.

4.Run the command

hari@home:~/soc/tinderbox$ ldtprunner run.xml


If you have set LDTP_DEBUG=1 in your shell, then it will show lots of output. Don't get scared. It only means things are working fine :)
Note :: You can also work with LDTP_DEBUG unset, if you want a "clean" output.

Once that command is executed, then it will run the test cases provided in the run.xml.

A file called log.xml gives the details about the test cases run. The last three lines in the log file should be like this if the test case ran properly for all the 30 test cases provided.

<groupsstatus total="30" pass="30" fail="0"/>
</group>
</ldtp>

The screen record video on Solaris 11 is given can be viewed from here.
http://download.freedesktop.org/ldtp/movies/screen2.html

The current status of the test cases can be viewed from here.
http://ldtp.freedesktop.org/wiki/Firefox_Test_Cases

Friday, August 17, 2007

Friday, August 03, 2007

Life is beautiful :)

Sorry for not updating the blog for a long time :(. Even now i am not going to write much. Just a list of arbit words which comes to my mind :-).

Helloooooooo
Delta Inductions
Spider Inductions
Idiot
Brave
Olarify
Promise
Psycho
***aloooooooooooooooo
Fli.......
mummyyyyyy
hmmmmmmmm

If you have no clue what these mean, then just think that i was not sane while i was typing this. ;)
"Don't Panic". I am still sane. ;-)

Thursday, July 05, 2007

file-roller ...

When i saw the mail from nags saying
" Can somebody evaluate it and send me back the results. It was done by Yazhini, long time back, but I could not check them."
even i didn't think i will write the test cases for file-roller that night. I just wanted to see the code and maybe make a comment. After seeing the code, i felt really sorry for file-roller :P . Yeah now it looks crazy, but not at that time. When evolution, gedit and other applications have new new scripts, why should file-roller have the old test scripts. :-)

So wrote the test cases for file-roller according to the new file-roller and new LDTP.

I will write about what all changes should be made while changing the scripts, so that it will be useful for someone who might change the code for other applications like gcalctool, bugbuddy, gnome-font, gnome-search-tool, gdf etc.

The files can be downloaded from here. Just take care that you don't have a file called ldtptestarchive.tar.gz in your home folder. Apart from that, you need to change the run.xml . I tried the scripts in solaris but setcontext didn't work properly there :(. Have to check that soon.

1. Names of objects in applications.
This has changed a lot, especially in the frame names. In the old scripts for file roller, it will be like
selectmenuitem ('ArchiveManager','mnuHelp;mnuAbout')
But according to the new LDTP, it is better to have
selectmenuitem ('frmArchiveManager','mnuHelp;mnuAbout')

Note the way the window name is mentioned in the new version. If has the prefix frm in that. The older one might still work but it is better to change soon. The prefix for each and every object can be seen in a file called remap.c in src folder. The function get_object_info (Accessible *accessible) in that file is the one which can give information about the prefix for each object type.
Apart from this, a ldtp function called getobjectlist () is also useful. Another utility called appmap is also useful in this case, but it is better not to use it, since the appmap is obsolete and latest changes are not incorporated into that. I think getobjectlist is the best solution. A tool called at-poke is also very useful to find the objects and object types inside an application.

2. Runner XML.
In the old scripts a python file used to call each and every other test case files using exec(). In many cases this main python file will be the name of the application. For example, check the file-roller.py
#To create a new archive
log ('Create New Archive', 'teststart')
execfile ('create-archive.py')
log ('Create New Archive', 'testend')

time.sleep(2)
#To open an existing archive and extracing them.
log ('Open Extract Archive ', 'teststart')
execfile ('open-extract.py')
log ('Open Extract Archive', 'testend')

So this way many scripts are tested from the a single python file. In the new test files, the concept of ldtprunner and runner xml is introduced. The links mentioned there are the best place to learn about runner XML. Just for the sake of completion let me add a sample runner xml for the above code here

<ldtp>
<logfileoverwrite>1</logfileoverwrite>
<logfile>log.xml</logfile>
<group>
<script>
<name>create-archive.py</name>
<data>fileroller.xml</data>
</script>
<script>
<name>open-extract.py</name>
<data>fileroller.xml</data>
</script>
</group>
</ldtp>

Scripts can be easily added, removed and grouped using the runner.xml .

3. waittillguiexist() and waittillguinotexist().
The two functions are really useful if you want your code till an object appears or disappears. The docs for these two functions explains the usage clearly. The old test code will have an approximate time.sleep() in their code. A better and proper solution is to incorporate waittillguiexist() and waittillguinotexist() and remove the unwanted time.sleep()

4. LDTPExecutionError :
The old code just has an except block which can catch any exception that occurs. It is better to handle the LDTPExecutionError separately and other errors in a different manner. A typical except block in the new script will be like

except LdtpExecutionError, msg:
  msg = 'open-extract test case failed'
  log (msg, 'error')
  raise LdtpExecutionError (msg)


5. Data XML.
One of the most important thing in LDTP, which adds great flexibility to the test cases. The filenames and other variables need not be hard coded. A single XML (generally called the data XML) can have all the details like the filenames, paths used in a test case and these value can be extracted from the XML file. Thus even the arguments passed to the test cases can be changed using a data XML.

6. Appmap file.
Since now in LDTP , the remapping of the objects in application is done automatically, there is no need to use initappmap() or remap() anymore. So there is no need to have a default map file for each application.
Therefore you can remove the following piece of code if you find it in your test case.

if len (sys.argv) == 1:
  if os.access ('./file-roller.map', os.F_OK | os.R_OK) == 0:
    print 'Appmap path missing'
    sys.exit(0);
  else:
    appmap_path = '.'
else:
  appmap_path = sys.argv[1]
initappmap (appmap_path + '/file-roller.map')


Friday, June 29, 2007

Tinderbox ....

You never know when things will work and but if you believe that they will work ,they will. Ha, finally my own quote :P .

The Solaris download which i asked my friend to do failed :-( . Crap . I waited for that for more than 2 days and finally it failed. Now i can't to afford to wait more. I have to proceed with Tinderbox, that too with real pace. With Emily's trip to GUADEC and college reopening soon, i really have to do some magic.

Emily wanted me to update from Solaris Nevada snv_55 to Solaris Nevada snv_64. Even i wanted to see what's new in next version but looks like fate was against me.

As such i had to reinstall my Solaris Nevada snv_55 because while installing i made a stupid mistake of selecting the default options. If you are ever planning to install Solaris, never ever do that. Do choose the custom install . After some two steps it will ask you which hard disk to choose and after that you can edit the partition size. If you fail to do this, Solaris by default allocates only required space to / and rest all to /export/home. For me it ended up having only 400MB free space in / while my /export/home had around 15GB free space :-(. I never wanted to try gparted and other things. A reinstall will fix all the problems and it did.

So finally my partition size fixed and i am ready to start Tinderbox, when the postman gave a parcel for me. It was Solaris Nevada snv_64 from SUN, which i had registered few days back. I didn't know whether to cry or laugh. Felt like banging my head on the monitor. Murphy is GOD . :-)

So made another install of Solaris Nevada snv_64 and finally was ready to start with Tinderbox. Now i had Solaris Nevada snv_64 and all the softwares required. A new and nice thing about this version is a Shutdown button in the start menu. I really missed that in the previous version.


Another small thing about networking in Solaris. If you want your Solaris box to work with dns entries provided, then you should edit the /etc/nsswitch.conf as follows .

A line in /etc/nsswitch.conf will be as follows
hosts: files
Change that line to
hosts: files dns
This will make sure that first /etc/hosts and then dns entires are looked during networking.

The mail from Emily had the following details with this attachment.

Pre-steps
1. Install the latest Solaris Express(s11)
2. Install SunOne Studio compiler
3. Install JDS CBE

1. Set up environment var. (See myenv.sh attached)
2. Check out tinderbox client from community
$ . /path/to/myenv.sh
$ cvs co -d tinderbox mozilla/tools/tinderbox
3. Some modification to be done in the tinderbox source code
1) post-mozilla.pl
$ cd tinderbox; mv post-mozilla.pl post-mozilla.pl.bak
2) tinder-confg.pl (modify the one attached and use it)
$BuildAdministrator = "%YOUR_ALIAS"
$CVS = 'runsocks cvs -q': (only necessary if you use proxy to access Internet)
3) mozconfig (use the one attached)

4, this step is necessary only if you access Internet via proxy
1) build-seamonkey-util.pl(see the patch file build-seamonkey-util.pl.diff)
2) set http_proxy and ftp_proxy in $HOME/.wgetrc since tinderbox client uses wget to send test result to server

5, let's go -- start up your tinderbox client
$ . /path/to/myenv.sh
$ cd /path/to/tinderbox && ./build-firefox.pl --depend -t MozillaTest > ~/build-firefox.log 2>&1 &

So things were really were clear in her mail.
As of now, i was in pre-steps with just Solaris 11 and neither a Solaris studio nor a CBE . So i started with Solaris studio.

The nice thing about Solaris is that the installing a new software is a matter of few clicks. Almost all the installers in Solaris works right out of the box. So with a few seconds i had Solaris studio installed . I had to change my PATH variables like

export PATH=/opt/SUNWspro/bin:$PATH
export MANPATH=/opt/SUNWspro/man:$MANPATH

So after this, you will have to run sunstudio, but i got the following error saying "java 2 SDK not found"
Omg, so now i had to install j2sdk. Downloaded the file "j2sdk-1_4_2_15-solaris-i586.sh" and when i ran that shell script, it created a folder in the current directory with quite a few files.

No i had no clue what to do that. Finally pinging a few of my friends, came to know that i had to set JAVA_HOME and change PATH variable again. I copied the folder that shell script created (j2sdk1.4.2_15) to /opt and had to modify the environment variables as shown below.

export JAVA_HOME=/opt/j2sdk1.4.2_15
export PATH=/opt/j2sdk1.4.2_15/bin:$PATH

Now if you run sunstudio, things work fine :-) . So now 2/3 pre-steps done. The only step remaining is Common Build Environment (CBE).
Now this again wasn't that difficult. The only catch is to give the proper C compiler. As such, i was supposed to use the Solaris compiler that comes along with Sun studio and not gcc. So first time i made a mistake of giving the path to gcc but next time did that fine.

Phew, all pre-steps done. Now to setup tinderbox. All the steps mentioned there worked right out of box. In step 2, it needed the environment variable $CVSROOT. As such $CVS_ROOT was configured in Emily's script. So just changed that to $CVSROOT and things worked fine :-)

Now finally i ran tinderbox and i am not quite sure about the ouput it produced . It surely generates a lot of output . I had no clue what the output meant and what i am supposed to do with that.
The output i got was like

Name "TreeSpecific::clobber_target" used only once: possible typo at ./build-firefox.pl line 33.
Name "TreeSpecific::build_target" used only once: possible typo at ./build-firefox.pl line 31.
Name "TreeSpecific::checkout_clobber_target" used only once: possible typo at ./build-firefox.pl line 13.
Name "TreeSpecific::extrafiles" used only once: possible typo at ./build-firefox.pl line 34.
Possible unintended interpolation of @gmail in string at (eval 318) line 23.
Starting dir is : /root/tinderbox/SunOS_5.11_Depend

tinderbox: tree: MozillaTest
tinderbox: builddate: 1183129260
tinderbox: status: building
tinderbox: build: SunOS/i386 5.11 home Depend trunk
tinderbox: errorparser: unix
tinderbox: buildfamily: unix
tinderbox: version: $Revision: 1.1 $
tinderbox: END

Opening SunOS_5.11_Depend.log
current dir is -- home:/root/tinderbox/SunOS_5.11_Depend
Build Administrator is sp2hari.com
uname -a = SunOS home 5.11 snv_64a i86pc i386 i86pc
AB_CARDCATALOG=/usr/dt/share/answerbooks/C/ab_cardcatalog
ADDON_PATH=/root/tinderbox/SunOS_5.11_Depend/mozilla//dist/bin:
COLORTERM=gnome-terminal
CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
CVS_ROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-zAaS6sa66Z,guid=9c8119a191db027be12633004684e7cc
DESKTOP_STARTUP_ID=
DISPLAY=:0.0
DTAPPSEARCHPATH=/root/.dt/appmanager:/usr/dt/appconfig/appmanager/%L:/usr/dt/appconfig/appmanager/C
DTDATABASESEARCHPATH=/root/.dt/types,/usr/dt/appconfig/types/%L,/usr/dt/appconfig/types/C
DTDEVROOT=
DTHELPSEARCHPATH=/root/.dt/help/root-home-0/%H:/root/.dt/help/root-home-0/%H.sdl:/root/.dt/help/root-home-0/%H.hv:/root/.dt/help/%H:/root/.dt/help/%H.sdl:/root/.dt/help/%H.hv:/usr/dt/appconfig/help/%L/%H:/usr/dt/appconfig/help/%L/%H.sdl:/usr/dt/appconfig/help/%L/%H.hv:/usr/dt/appconfig/help/C/%H:/usr/dt/appconfig/help/C/%H.sdl:/usr/dt/appconfig/help/C/%H.hv
DTSCREENSAVERLIST=StartDtscreenSwarm StartDtscreenQix StartDtscreenFlame StartDtscreenHop StartDtscreenImage StartDtscreenLife StartDtscreenRotor StartDtscreenPyro StartDtscreenWorm StartDtscreenBlank
DTSOURCEPROFILE=true
DTUSERSESSION=root-home-0
DTXSERVERLOCATION=local
EDITOR=/usr/dt/bin/dtpad
GNOME_DESKTOP_SESSION_ID=Default
GNOME_KEYRING_SOCKET=/var/tmp/keyring-a1aGab/socket
GTK_RC_FILES=/etc/gtk/gtkrc:/root/.gtkrc-1.2-gnome2
G_BROKEN_FILENAMES=yes
G_FILENAME_ENCODING=@locale,UTF-8
HELPPATH=/usr/openwin/lib/locale:/usr/openwin/lib/help
HOME=/root
JAVA_HOME=/opt/j2sdk1.4.2_15
LANG=C
LC_ALL=C
LC_CTYPE=C
LD_LIBRARY_PATH=/root/tinderbox/SunOS_5.11_Depend/mozilla/dist/bin:
LIBPATH=/root/tinderbox/SunOS_5.11_Depend/mozilla//dist/bin:
LIBRARY_PATH=/root/tinderbox/SunOS_5.11_Depend/mozilla//dist/bin:/root/tinderbox/SunOS_5.11_Depend/mozilla//dist/bin/components:
LOGNAME=root
MAIL=/var/mail/root
MANPATH=/opt/SUNWspro/man:/usr/dt/man:/usr/man:/usr/openwin/share/man
MOZCONFIG=/root/tinderbox/mozconfig
MOZILLA_FIVE_HOME=/root/tinderbox/SunOS_5.11_Depend/mozilla//dist/bin
MOZ_BYPASS_PROFILE_AT_STARTUP=1
MOZ_CO_DATE=06/29/2007 15:01 +0000
MOZ_PACKAGE_MSI=0
MOZ_SYMBOLS_TRANSFER_TYPE=scp
NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat:/usr/dt/lib/nls/msg/C/%N.cat
NO_EM_RESTART=1
OLDPWD=/root
OPENWINHOME=/usr/openwin
PATH=/opt/csw/bin:/opt/SUNWspro/bin:/opt/SUNWspro/bin:/opt/j2sdk1.4.2_15/bin:/usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/ucb:/root/tinderbox/SunOS_5.11_Depend/mozilla//dist/bin
PWD=/root/tinderbox
SDT_NO_DTDBCACHE=1
SDT_NO_TOOLTALK=1
SESSIONTYPE=altDt
SESSION_MANAGER=local/home:/tmp/.ICE-unix/316,inet6/home:35165,inet/home:60138
SESSION_SVR=home
SHELL=/bin/bash
SHLVL=2
SSH_AGENT_PID=321
SSH_AUTH_SOCK=/tmp/ssh-XXXAaGNa/agent.316
START_SPECKEYSD=no
TERM=xterm
TZ=Asia/Calcutta
USER=root
WINDOWID=41943093
XFILESEARCHPATH=/etc/dt/app-defaults/%L/%N:/etc/dt/app-defaults/C/%N:/usr/dt/app-defaults/%L/%N:/usr/dt/app-defaults/C/%N:/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%S
XMBINDDIR=/usr/dt/lib/bindings
XMICONBMSEARCHPATH=/root/.dt/icons/%B%M.bm:/root/.dt/icons/%B%M.pm:/root/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%B
XMICONSEARCHPATH=/root/.dt/icons/%B%M.pm:/root/.dt/icons/%B%M.bm:/root/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B
XPCOM_DEBUG_BREAK=warn
_=./build-firefox.pl
dtstart_sessionlogfile=/dev/null
-->mozconfig<----------------------------------------
# Make flags
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_CO_MODULE="mozilla/tools/codesighs"

# Configure flags
ac_add_options --enable-application=browser
ac_add_options --enable-optimize
ac_add_options --enable-codesighs
ac_add_options --enable-crypto
ac_add_options --enable-xft
ac_add_options --enable-svg
ac_add_options --enable-canvas
ac_add_options --disable-freetype2
ac_add_options --disable-debug
ac_add_options --disable-tests
-->end mozconfig<----------------------------------------
Didn't find /root/tinderbox/post-mozilla.pl
===============================
Compiler is -- CC
===============================
Begin: Fri Jun 29 20:32:28 2007
cvs -q checkout -P -D "06/29/2007 15:01 +0000" mozilla/client.mk mozilla/browser/config
End: Fri Jun 29 20:32:31 2007
/root/tinderbox/SunOS_5.11_Depend/mozilla//dist/bin/firefox-bin does not exist.
No binary detected; none deleted.
Begin: Fri Jun 29 20:32:31 2007
make -f client.mk checkout
make: Fatal error in reader: client.mk, line 126: Unexpected end of line seen
End: Fri Jun 29 20:32:32 2007
Error: CVS checkout failed.

The last line is scary :-(. Have to ask about that to emily or nags soon. And oh yeah, now that i have setup a Tinderbox in Solaris, i want to setup one in Linux. Just want to see whether it is so easy in Linux. ;). Now i got my confidence back :). I can now really finish lots in integration of Firefox Test cases into Tinderbox before i go back to college. And now i am no more scared of Solaris :-) .

Have to figure out something about the Tinderbox log.
Bye for now.

Thursday, June 21, 2007

Projects ...

"The word "project" originally meant "something that comes before anything else is done". When the word was initially adopted, it referred to a plan of something, not to the act of actually carrying this plan out. Something performed in accordance with a project was called an object. This use of "project" changed in the 1950s when several techniques for project management were introduced" -- Wikipedia

Now that holidays are about to get over, now i realized :P a few strange things about projects. Most of them are from personal experiences.

1. Whatever happens, you will finish the project on time. On time, meaning the last day when you have to submit your project (this includes quite a few a night outs before that day).

2. If you finish the project one/two weeks before time, either the project is very very simple for you or you didn't do your project at all :P

3. The first few weeks of the project will be really frustrating as you will be reading and chatting more than you code. Actually for the first few weeks, if your LOC is around 3-4 it is really great.

4. The last two-three days of your project, the LOC will shoot up to few hundreds :-)

5. Even if you chat 24*7 during the project time, somehow you will complete the project on time. You won't even realize how the code actually came there, but at the end of the day, it will be there.Though even if you work really hard 24*7, you will have the same output.

6. If you are geek and you are doing a project in Bangalore, don't try to go to a pub.

7. You will be really satisfied about completing the project on the last day.

8. You will feel bad that you could have done lots more in the project only on the last day. You will realize you have taken more time to understand the old code :P Only on that day you will start loving your project and you will feel like working more on that.

9. Only if you have project review, you will feel really really sleepy that you might end up not coming for the review.

10 . Your friend's project will always look easier.

11. The last three days, you will be cursing your project like anything. You will hate it to the core. But after that, you will think that your project is not so bad.

12. Only for the first one week, you will report for your project work on time. After that it will be late from 2-4 hours. Though this will be compensated by the night outs you do for your project.

Love story of a topper ...

Well, i am kind of not sure whether i should write this or not. I have never written a blog describing about someone else ,his second girl friend and about their deep love and how she became my girl friend after that. But recently, the tech level of my blog has increased so much that my normal friends don't even bother to read my blog. Looks like it is too techie for them. So this might be something for them. And yes, if i get a chance to shoot a movie, i will do this one.

Ok , the hero (or rather the villain :P ) of the story of is Manas Garg. He is the topper of Computer Science Dept and now is happily working in M$.

First i should tell you that all i am going to tell you is true and only true. I have not modified anything to make the story interesting. It's just plain facts. I have proof for that which i have added to this post. To make the story more interesting first the proof and then the story.

The following is the chat log between me and manas garg. Not even a single word in that chat log is modified. To make things clear, i have removed what i spoke in between.

Manas: that would be soo cool
i was crazy about her
spent nights with her


Manas: took care of her more than myself then

me: lol :-)

Manas: i had to leave her gave her to others coz i had to go
i still love her


Manas: i always will

me: ha ha

Manas: one day we will unite again and the world will salute our love

So that's what he confessed to me today.

Since that girl might feel bad if i tell her name ( actually too many people in our college love her. :P In fact i am one in the list . ) . So let us name her X. Hmmm no why X ?? X is for unknown values. I know her and you know her too. So let us name her S.

Now our hero manas, met this girl in second year and he didn't like her much. She used to give boring work to our villain ( ???? ). So manas never liked her. In fact he hated her so much, that he never wanted seeing her again. But manas, when he first met that girl felt that he could change her and make her better. But this girl was so bad that manas had almost lost hopes :-(
// If you want you add a sad song here where just the hero sings something in sad tone all alone. Like

dil ke raste me aisi thokar maine khayi
tute khawab sare aisi mayusi hai chhayi
har khusi ko gaye,jindagi so gaye
tumko jo pyar kiya maine to saja me paye
tanhayee,tanhayee,tanhayee......
from Dil Chahta Hai

If you don't know Hindi, you can imagine this song

kaN paesum vaarthaigaL purivadhillai
kaathirundhaal peN kanivadhillai
oru mugam maRu mugam theriya
kaNNaadi idhayam illai, kadal kai koodi maRaivadhillai

from 7G Rainbow colony

Then suddenly S and manas met more often. Manas also got some people (including me) to help him. Soon he changed S. It was magic. This stupid girl who is not useful for anything suddenly became the hot topic in college.
// A duet song here will be fine. Don't worry we will make manas dance when i shoot this movie ;) . Songs like the following will be fine

jise dhundata hoon main har kahin
jo nahi mili mujhe thi kahin
mujhe jiske pyar par ho yakin
wo ladki hai kahan
jise sirf mujhse hi pyar ho
jo ye kehne ko bhi taiyaar ho
suno tumhi mere dildaar ho
wo ladki hai kahan
From Dil Chahta Hai

or

Sutrum vizhi sudare
Sutrum vizhi sudare
En lagam unnai sutruthe
Sattai payyil un panam
Thottu thottu urasa
En idhayam patri kolluthey
Un vizhiyil vizhunden
Vinveliyil paranthen
Kanvizhithu soppanam kanden
Unnale kanvizhithu soppanam kanden

From Ghajini


After she changed, manas loved her more and more. He forgot about his studies. He forgot about his room, friends and almost everything. All cared only about her and sometimes was ready to do anything for her.

But a sad thing happened. I was a good friend of both manas (thanks to Spider) and her. I knew manas was in love with her, but even i started liking her. So much that sometimes i was ready to give anything for her. :-). Now i don't know who loved her more since it is not possible to compare. Soon manas came to know that i had a crush over her. I though he will be angry with me :P but he didn't say anything.

Though me and manas were good friends, last semester we were really fighting for her. We gave her so much importance but we forgot about everything else.

And on Spider's Farewell day, just some few minutes before the end of the party, she proposed me :P . It was kind of strange, coz others started clapping and all when she did that. I was actually blushing. I knew that was going to happen but i never that it will happen during the farewell. And actually even manas was there when she proposed me. He was very sad that day. :P Anyway the party mood made him forget about that. :P

Now that manas is gone, she is all mine.Unfortunately, now more and more people are getting really really interested in her, though as of now, i think i am the only person mad about her.

Note ::
If you have found out who she is, just say that so. You need not tell her name. :P
Also there is another interesting story :P by suren . Check it here

I'm interested



Do you know that when you use caps or large font while chatting or in mail, it implies that you are shouting.

I generally get irritated when people shout, but this one is an exception. I was really glad that he shouted. In fact, i was waiting for him to shout. Now that he is with us, nothing can stop us. :-)

Disclaimer :: Sorry. This blog post is only for me. If you don't get anything, just forget about this and move to the next post.
If you are still curious about this post, hack my gmail ;-)

Wednesday, June 20, 2007

Conquered solaris ....

Got up at 4 PM :-). Yes 4 PM. Yesterday after finding out that my Ethernet card had some arbit problem, planned to buy a new one. But felt like checking my Ethernet card for the last time. Went to my friend's place and checked my Ethernet and it worked there :-(. I was both happy and sad. Happy because my Ethernet is working, no need to buy another one and sad because now i don't even know what is the problem with my computer. Anyway i got another Ethernet card from my friend's computer (of course after promising her a treat).

First checked the computer with her Ethernet card. Internet worked both in Solaris and Windows. WOW :) . Now again, i checked again with my Ethernet card and WOW WOW WOW, it connected to Internet from all three OS. Now what is happening here ??? Yesterday i spent more than 7 hours trying to make this card work and now this is working out of box within 5 mins. And as such i did the same thing what i did previous night. Looks like you can never try to reason out few things.

Anyway now i am in Solaris and it is cool. First had to install new softwares. Taggy gave me the this link. And this one was also very useful. So within a matter of 5 mins, i installed most of the softwares i might need.

As such i had three main things to do in Solaris according to the mail Emily Chen sent me. They are

1. Read about tinderbox setup from http://www.mozilla.org/projects/tinderbox/ .

2. Sun Studio 11
http://developers.sun.com/sunstudio/products/previous/11/index.jsp
On Solaris, Sun Studio is used to build Firefox, not gcc, so have to install Sun Studio.

3. Set up CBE (Common Build Environment)
http://opensolaris.org/os/project/jds/contributing/building/

Now my goals were very clear. And internet from Solaris was working cool, just thought of downloading everything then, but Sun Studio was around 300 MB and already my internet bills have reached peak. So had to wait till 11 PM ( 11PM to 9 AM free internet :P) .

Started downloading at 11. 15 . OMG. It started at 7KBs and said it is gonna take 24 hrs :-(. Now i can't do anything to this. Have to sit and wait :P . When i am writing this blog (ie 8 AM), it says only 5 hrs left.

Still network configuration has few glitches. I have to enter the DNS entries every time i reboot the system. And even though i have configured it to activate on boot, the Ethernet card has to manually activated after every time. This is strange since, i have a file called hostname.rtls0 in / (which should activate the Ethernet card on boot )

Yesterday Solaris had me. It made me frust to the core. It made me raise doubts about whether i will be able to finish SOC on time. But today is my day. I conquered :P solaris. In fact now that Solaris phobia is slowly disappearing. Now it is time to say Hello World to Tinderbox :P.

Tuesday, June 19, 2007

networking not working :P...

I have got a new phobia. Solaris phobia :P. lol.
Well how easy solaris can ruin one whole night. Though i shouldn't blame Solaris completely but at least it deserves something for troubling me with DNS thing sometime back .

Anyway here comes the story. After discussing with Casanova about tinderbox i realized that setting up tinderbox is an important issue. So i was all set to start with tinderbox setup. But looks like fate had other plans. Anyway after discussing with Casanova ( at around 10 pm ), soon started working into tinderbox.

But once i booted into Solaris and went to Google.com, it said "Could Not Connect". Since i have seen this error many a times already, i just went to the network manager and found all my previous entries missing there :P. Nothing unusual actually. So entered the values again and restarted networking. Now again the same old error. Since i have already configured DNS once and connected to internet from solaris, i thought the same settings will work this time also.

But noticed something strange. This time it won't even ping to my DNS or Gateway. Well this is certainly strange. I called taggy (solaris club head :P) and explained him the situation. He gave a few solutions and i tried some other things which i found in internet. The bad part about networking not working is that even to Google or download something, you need to reboot :-( "Life is too short for reboots" they used to say.

Anyway now the time was 12 . Shit. Two hours gone and still no progress. Had a idea of going back to Firefox test cases but NO. I have to work with Tinderbox and i will do it tonight. So read manuals from here and there about configuration and tried everything given there :(. No luck. Though internet seems to work from windows and Linux.

Now one unfortunate thing is i have two Ethernet cards ( Realtek and VIA). Solaris detects only Realtek , so i use that for Solaris while i use VIA for Linux and Windows. Just then it realized. Is the Realtek Ethernet card working ??? What if that has the problem ??

So one more reboot. Configured the Realtek card to connect to internet. Widows detected the card, LAN enabled but internet was not working. Same problem as i had in solaris. SHIT SHIT SHIT. So finally my Ethernet card has some problem :-(. The strange thing is, it detects my card and all, but just that it wont send/receive anything through the card. Strange problem, but why to me :-( :-(

After realizing the problem (well time is 3 am now), i thought of finding the driver for the VIA Ethernet card, and managed to download a driver. A reboot back to Solaris, i realized that i don't even have a gcc to compile the driver. Downloaded gcc and finally now it is 5 am :-(

I am NOT going to try installing the driver for VIA Ethernet card. I am getting frustrated , irritated and what not,when i see a reboot. A 60-75 reboots in a span of 7 hours is not something really exciting and motivating :(. So all i am gonna do is to check this Ethernet card in friends place and get a new one.

Finally when i wrote this blog it is 5 AM. From 10 PM to 5 AM, no progress at all. All i found out is my Ethernet card might not be working :( :( . Not even a single line of Code in 7 hrs of real hard working :-(, actually not even a single word of code :P .
A nightout is nothing new for me, but this time i really felt the pain of one whole night completely wasted :(.

Now all i hope is my Ethernet card should have a problem, so that i can get another one soon and start with my work. Only God can save me if it was not an Ethernet problem :P.

Sunday, June 17, 2007

Firefox 3 UI rocks...

Really , the user interface of Firefox 3 rocks. Text boxes and other form fields have a nice smooth corners and select menu item is similar to the one you find in gnome :) .

The old form elements are shown in this image.

Click image for a clear view

New here comes the new interface of the same webpage in Firefox 3 :-)

Click image for a clear view

Wow, looks like any web developer can make web pages which will look really cool in Firefox 3.

Finally 10....

Ok, i am certainly not talking anything about my GPA. After fighting (fighting is an understatement i suppose) with Firefox and LDTP for 3 hours (well this is actually few days), finally managed to get 10 test cases work properly.

At least these 10 test cases will work properly for integration with Tinderbox. Have to send these test cases to emily soon and get them integrated with tinderbox.

The output log is
<ldtp>
<group name="group1">
<script name="verifyaddressfield.py">
<test name="address field and go button">
<pass>1</pass>
</test>
</script>
<script name="verifybackforward.py">
<test name="Back and Forward buttons">
<pass>1</pass>
</test>
</script>
<script name="verifyhome.py">
<test name="verify home button">
<pass>1</pass>
</test>
</script>
<script name="verifynewtab.py">
<test name="Open a new tab ">
<pass>1</pass>
</test>
</script>
<script name="verifyyahoo.py">
<test name="topsite - yahoo">
<pass>1</pass>
</test>
</script>
<script name="verifymsn.py">
<test name="topsite - msn test">
<pass>1</pass>
</test>
</script>
<script name="verifyamazon.py">
<test name="topsite - amazon">
<pass>1</pass>
</test>
</script>
<script name="verifyftp.py">
<test name="navigate ftp">
<pass>1</pass>
</test>
</script>
<script name="verifysearch.py">
<test name="Open search by keyboard shortcuts">
<pass>1</pass>
</test>
</script>
<script name="verifyfindinpage.py">
<test name="Find in Page">
<pass>1</pass>
</test>
</script>
<timeinfo start="03:23:00 AM on 18-Jun-2007" elapsed="0:1:8"></timeinfo>
<groupsstatus total="10" pass="10" fail="0"></groupsstatus>
</group>
</ldtp>

Well looks like i have underestimated how bugs can trouble a poor coder like me :P.

Each test case has its unique problem :P.
The major problem is the Firefox crash :(. Though the test case work individually, Firefox crashes if all the test cases were run under a single runner xml :-(. I have downloaded Firefox firefox-3.0a6pre now ( was using firefox-3.0a5pre all these days). Hopefully Firefox 6 is stable against the test cases :-).

Anyway the 10 is not the final list. I am supposed to test 30 test cases properly for the Functionality subgroup of smoketests testgroup for Firefox 3.0. Not to mention about the lots and lots of test cases from other test groups.

Let me post the issues i am facing with the other test cases, so that it is easier for me to fix them later.

Before that, the 10 test cases which worked in my favour are :)

3954: Address Field and Go button
4032: Back and Forward buttons
4031: Home button
4086: Open a new tab
3955: Top Site - Yahoo
3956: Top Site - MSN
3957: Top Site - Amazon
3959: Navigate FTP
4245: Open search by keyboard shortcuts
3967: Find in Page

The test cases having issues are
1. 4137: Add an RSS feed/Livemark
This is the strangest test case i have ever found :(. This doesn't work for the first time. Next time without any modification, if i run the test case it works like properly. Third time it is not working and fourth time it again works properly . Well, that is more than enough for me, i either end up banging the computer monitor or beating myself that there is no 5 th time :-(. Should check this test case properly.

Looks like this is the only test case which troubles me as of now. Have the rest of the code ready but looks like new problems are starting soon. For the same runner xml, same files , same Firefox, test case 2 shows come error. Have to check that soon. Got firefox-3.0a6pre few mins back. Have to run the test cases with that.

And yes, tried something with the list not getting selected problem. Even nags confirmed this problem some time back and finally able to find out the exact line where the error occurs .

if (AccessibleSelection_selectChild (selection, text_index)) { }
That is line 110 from list.c. The if statement is returning false ending up in "LDTP_ERROR_UNABLE_TO_SELECT_CHILD" . Hoping to fix this soon. Will be really happy if i fix this one as i will be able to add something to the ldtp source code. Been a long time since my name appeared in the Changelog ;-) ;-)

Only thing i am happy about is both Ubuntu Linux and Solaris responds similarly for the test cases. So no separate Firefox issues and Solaris issues as of now. Let us see how this proceeds.

Another small issue.
Whenever i get any error in any of the test cases, i get the following error
<script name="verifyamazon.py">
<test name="topsite - amazon">
<ERROR>Traceback (most recent call last):
File "/usr/local/bin/ldtprunner", line 407, in executescript
execfile (scriptname, scriptglobal)
File "verifyamazon.py", line 52, in <module>
log (msg, 'error')
File "/usr/local/lib/python2.5/site-packages/ldtp.py", line 2500, in log
logger.error (message)
File "logging/__init__.py", line 1015, in error
File "logging/__init__.py", line 1100, in _log
File "/usr/local/lib/python2.5/site-packages/ldtp.py", line 2421, in makeRecord
return LdtpLogRecord (name, level, fn, lno, msg, args, exc_info)
File "/usr/local/lib/python2.5/site-packages/ldtp.py", line 2394, in __init__
msg = '<' + logging.getLevelName (level) +'>' + saxutils.escape (msg) + '</' + logging.getLevelName (level) + '>'
File "/usr/lib/python2.5/site-packages/_xmlplus/sax/saxutils.py", line 31, in escape
data = data.replace("&", "&amp;")
AttributeError: 'LdtpExecutionError' object has no attribute 'replace'
</ERROR>
</script>

I am giving the error message properly in the try block, but not in the except block. When i give the error in the except block then i get the error message in the log file properly. But i am supposed to pass the error message from the try block to the except block. Should learn a bit of python exceptions to know more about this

Anyway the files for the test cases which are working can be obtained from here

Note :: Have added many more test cases to the above file now, but didn't like to change the title.

Tuesday, June 12, 2007

Meet GNU/Linux 07

After 2 successful editions of Meet GNU/Linux, which is conducted by
GLUG-T every year for beginners, the third edition of MGL is starting
on 27th July, at NITT.

A few updates about MGL'07 :

1. Guys are planning to release a beginner handbook, which would be
given out to them. The content is being edited in a wiki :
http://glugt-mgl.pbwiki.com/ Go ahead and edit when you are free.

2. This is GNU/Linux for dummies. So, if you have any of your
friend/relative interested in learning about it(in trichy), you can
ask them to contact suren who is co-ordinating
the event.

3. The co-ords are planning to release podcasts of the events, which
will be helpful.

Ideas, suggestion about how to organise the classes are welcome!

Comments :)

How many comments have you seen for a single blog ?

Well, when i asked taggy (the internet guru of NITT) he replied around 10-20. Suren has seen around 50 for a he-she blog.

But this one is amazing. A single blog (in fact a single line blog) getting around 268 comments (and still counting).

Reminds me that "What you say is more important than how much you say".

Monday, June 11, 2007

Topping google search

I attended the podworks.in last weekend. For those who don't know what podworks is , PodWorks.in is a 2-day workshop styled unconference dedicated to the sharing of knowledge around audio and video podcasting. It's a successor to the extremely successful BlogCamp that was held last year.

Though i have lots and lots to say about the event, one strange and nice thing is that if you google for podworks.in my blog tops the list :-) :-)


Sunday, June 10, 2007

Internet from solaris ...

DNS makes our life real easy. Without that, i don't think people will say check out http://google.com but check out http://64.233.187.99. I realized how important DNS is to us and without DNS how one can go mad.

I installed Solaris (Neveda ) two weeks back and it was good. :-) . Though i was a bit scared in the initial stages, i didn't find much difference between Linux and Solaris as far as LDTP is concerned. Anyway i had Emily Chen from Sun China (my Soc Mentor ) to help me with the issues and many thanks to her, she was always willing to help me in any issue. In fact almost all her mails had something saying
" I am on Gtalk almost every workday, feel free to ping me when you have problems. " or something similar to that :-) :-)

But there was one issue which really troubled me in Solaris and that was DNS wasn't working. Instead of typing http://www.google.com, i had to type http://64.233.187.99/ :(

I had a huge list of servers which i might use and their ip's . (Many thanks to dnsstuff.com). I was getting more and more frust typing IP's instead of url's and browsing only the cached page instead of the actual pages. I tried many a things and even Emily also helped me with few tips and tricks. But things never worked. I was really getting irritated as this was delaying my progress in SOC.

Determined to solve the issue somehow, i started trying all the options in the Network Settings. One strange thing i noted is that, whenever i add a DNS server and close it, next time i open Network Settings, the entries won't be there. Simply disappeared from there :-(.

I noticed an option called Location in the Network Settings. It was empty and i wasn't sure whether i have seen anything like this in Linux.



Not sure of what to do with that Location, i gave "home" there. I wasn't sure whether this will solve my problem, but no harm in trying. But once i restarted network, www.google.com worked.
YES. IT WORKED. IT WORKED .IT WORKED. IT WORKED .IT WORKED. IT WORKED


I am pretty sure anyone who had seen me at that time would have thought that i am mad. Even i wont blame them . I accept, suddenly jumping out of the chair and shouting "IT WORKED" at 3 in the morning is quite odd. :P

Anyways, now that things have started working, will be saying my "Hello World" to tinderbox soon :-)

Running a test case ...

Having written the test scripts for Firefox, this time going to tell how to test Firefox with these scripts. The test scripts can be found here

There is a wiki page in LDTP website which gives quick tips about how to run LDTP test cases.

First quick steps to get LDTP installed . If you have LDTP already installed, then you can skip this.

Installation
Get the source/binary from the downloads section of LDTP web page. Any other dependencies which LDTP might need while installation is libxml2 and libat-spi. (I generally install the debug and dev packages of the above two). After this installation of LDTP shouldn't have any issues :-)

Runner XML
Runner XML files makes testing many test cases one after another in a batch mode easy. A sample runner XML can be found here. A very simple runner XML needed to run a single test case will be like

<ldtp>
<logfileoverwrite>1</logfileoverwrite>
<logfile>log.xml</logfile>
<group>
<script>
<name>verifyaddress-autocomplete.py</name>
<data>firefox.xml</data>
</script>
</group>
</ldtp>

The tags are self explanatory.
You can have any number of script blocks and thereby test any number of test cases one after another. The data tag is not necessary but it is better to have a separate data file.

Test
Well, that's all you have to do. Start Firefox and then

hari@home:~$ ldtprunner run.xml

The above command starts testing the application with the test case provided in the run.xml .

Note :: It is also possible to test simply by giving

hari@home:~$ python verifyaddress-autocomplete.py

But i prefer doing it using runner XML, as that has more features.

There is a complete tutorial for LDTP here. This explains everything needed to write a test script clearly and is worth reading :)

Friday, June 08, 2007

SOC report ...

My SoC is going fine and great. Hoping to finish this well ahead of time:) This is a blog + report :)

So i have started with Automation of Firefox.
For the current status of all the test cases i have mentioned here, check this link

The categories under which i have written test cases till now are
1. Firefox 3.0 :: SmokeTests :: Functionality
Most of the test cases in this category are done. certain test cases which are yet to be done are marked as TODO in the status page.

2. Firefox 2.0 :: Basic Functional Tests :: Help
This is a really small category, with just two cases. Both of them working fine, but have to check the closewindow() function which didn't close the help window.

3. Firefox 2.0 :: Basic Functional Tests :: Options (Preferences)
Have done almost all the test cases. There is again a small issue in this. The objects shown in the preferences window are list-items whose parent is a list. We tried to copy the code for combobox for list but it didn't work. Have to add functions specific for list in list.c

4. Firefox 2.0 :: Basic Functional Tests :: Printing
This had bug in the print preview option. The CPU just hangs and processor takes 100% load . This bug is already reported in bugzilla.mozilla.org .

5. Firefox 2.0 :: Basic Functional Tests :: Location bar
Works perfectly. Had to use LTFX functions activatewin and typekey .

6. Firefox 2.0 :: Basic Functional Tests :: Popup and Annoyance Blocking
Most of the test cases have been automated. Testing Java and Javascript is a small issue in this.

Some of the important categories which i have started tesing and is in near completion are
1. Bookmarks
2. MenuBar
3. RSS
4. Downloading
5. Addons Manager

Finally, the code for the above tests can be found here.
Finally one small and interesting thing ;-). The icon which shows that the loading of a page ( the circular thing which rotates while a page is loading) is a push button :-) . Was really surprised when i noticed it :P. No clue why is it that way ;)