Ally's a QA

2007-Dec-25 - Things to consider after a fix

From "Why Programs Fail".

 

1. Does the failure no longer occur? (There may be second cause.)

2. Does the fix introduce new problems?

3. Is there same mistake elsewhere? (The same developer, same APIs.)

4. Is the change committed? (Version control, bug track.)

 

Comments (0) :: Permanent Link

2007-Dec-25 - How to ... (Linux version)

1. How to add a user on Unix platform:

# useradd {user_name}

# more /etc/passwd                   --> Here {user_name} should has been added.

# passwd {user_name}             --> Here set a password for {user_name}

 

2. How to set DNS in Linux:

Modify file /etc/resolv.conf

 

3. How to modify locale in Linux:

1) To check current locale, run command: locale

2) localedef -f GB2312 -i zh_CN zh_CN.gb2312

--> /usr/lib/locale should has been added "zh_CN.gb2312"

     /usr/lib/gconv/gconv-modules includes "alias GB2312-1980// EUC-CN//"

3) export LC_ALL=zh_CN.gb2312

4) To verify, run command: date

--> It should display Chinese.

5) To automatically enter Chinese locale in the next boot, add the following two lines in file /root/.bashrc:

export LANG=zh_CN.gb2312

export LC_ALL=zh_CN.gb2312

 

4. How to change the default booting Operating System:

1) Open /boot/grub/grub.conf (menu.lst)

2) Modify "default #..."

 

5. How to set IP - hostname list in Linux:

/etc/hosts:

{ip}    {host_name(FQDN/long name)}    [short name]

 

6. How to change the listening port of Postfix:

1) /etc/postfix/master.cf:

Change

    smtp inet n - n - - smtpd

to

    mysmtp inet n - n - - smtpd

2) /etc/services:

Add

    mysmtp {port_number}/tcp mail

3) Restart postfix:

/etc/init.d/postfix restart

 

7. How to config IP in Linux:

/etc/sysconfig/network/ifcfg-eth-...:

Configure IPADDR and BOOTPROTO

 

8. How to add perl modules:

Precondition: Perl & modules installed.

# /usr/local/ActivePerl-5.8/bin/ppm

rep off 1                     --> To turn of the default modules. Optional.

rep off 1

rep add {module_name} "{module_path}"

search *

install n                    --> n is the No. of the module that you want to install.(eg. install 1, 2, 7) 

 

9. How to have a quick test on handle leak:

# ps -ef | grep processname                     --> Check the process ID that needs to test handle leak.

# cd /proc/{PID}/fd/

# ll                                              --> Check socket number

Compare with the current connection number to see whether there's handle leak.

 

10. How to compile and run a C program:

# gcc -o output_filename program_name.c     --> compile

# ./output_filename                                        --> run

 

11. How to enable core dump:

# ulimit -c unlimited

Note: run "ulimit -c" to check whether it's enabled. If it returns "0", it is disabled; If it returns "unlimited" or some other number (the core dump file size), it is enabled.

 

12. How to calculate the total number of files under a folder:

# ll | wc -l

 

13. How to check cpu info:

# cat /proc/cpuinfo

 

14. How to configure Xdm on Linux for remote Xwindows access?

1) Modify /etc/X11/xdm/xdm-config:
  "DisplayManager.requestPort:    0"---> "!DisplayManager.requestPort:    0"
2) Modify Xaccess:
"#*    #any host can get a login window" -->"*    #any host can get a login window"
3) Modify Xservers:
":0 local /usr/X11R6/bin/X" -->"#:0 local /usr/X11R6/bin/X"
4) run 'xdm'
5) then you can use Xmanager or X-Win32 to connect it.

 

Note: If on Suse, to configure Xdm for ROOT remote login:

1) Modify /etc/pam.d/login:

  "auth required pam_securetty.so" --> "# auth ..."

2) Modify /etc/sysconfig/displaymanager:

  DISPLAYMANAGER_REMOTE_ACCESS="yes"

  DISPLAYMANAGER_ROOT_LOGIN_REMOTE="yes"


15. How to test code coverage:

Command: gcov

1) When compile with gcc command, add arguments fprofile-arcs and ftest-coverage

eg. #gcc -g -o output_name input.c -fprofile-arcs -ftest-coverage

2) Run output_name

3) #gcov input.c

Now input.c.gcov file is created. Use "less" command to view the gcov file. The lines following ##### were not executed in the step 2) run.

 

Comments (0) :: Permanent Link

2007-Dec-6 - Linux Performance Monitoring - study notes

1. Start with the output of vmstat or mpstat for a dashboard of system performance.
# vmstat 1 10
1 second interval for 10 seconds
Field     Description
--- CPU performance ---
R     The amount of threads in the run queue. These are threads that are runnable, but the CPU is not available to execute them.
B     This is the number of processes blocked and waiting on IO requests to finish.
In     This is the number of interrupts being processed.
Cs     This is the number of context switches currently happening on the system.
Us     This is the percentage of user CPU utilization.
Sys     This is the percentage of kernel and interrupts utilization.
Wa     This is the percentage of idle processor time due to the fact that ALL runnable threads are blocked waiting on IO.
Id     This is the percentage of time that the CPU is completely idle.
--- virtual memory ---
Swapd     The amount of virtual memory in KB currently in use. As free memory reaches low thresholds, more data is paged to the swap device.
Free     The amount of physical RAM in kilobytes currently available to running applications.
Buff     The amount of physical memory in kilobytes in the buffer cache as a result of read() and write() operations.
Cache     The amount of physical memory in kilobytes mapped into process address space.
so     The amount of data in kilobytes written to the swap disk.
si     The amount of data in kilobytes written from the swap disk back into RAM.
Bo     The amount of disk blocks paged out from the RAM to the filesystem or swap device.
Bi     The amount of disk blocks paged into RAM from the filesystem or swap device.

also
# mpstat -P ALL 1 10
breaks the statistics out on a per processor basis.

2. Use iostat to determine from where the read requests are being generated.
# iostat -x 1

3. Using top, determine what application is most active on the system
# top -d 1


Comments (0) :: Permanent Link

2007-Nov-23 - Trouble shooting ... (network & apps)

Windows:

1. Domain name resolution error while sending a mail.

# ping {domain_name}

-> Return corresponding IP1, correct.

But

# nslookup {domain_name}

-> Return IP2, incorrect.

Troubleshoot:  (>> input ;  << output)

1) >> ipconfig /all

    << Windows IP configuration & Ethernet adapter Local Area Connection

2) >> nslookup

    << Default Server & address

    >> server {DNS_IP}                    -- Here reset the correct DNS server IP.

    << Default Server & address

    >> IP1

    << The corresponding domain_name       -- This step checks whether the DNS is correct.

3) Disable and enable network connection if anything changed.

 

2. Java Applet load failed.

1) Install MSJav

2) Open Internet Options -> Advanced, uncheck Java (Sun) and check MS VM.

 

3. HTTP download failed or file not found.

a. Check IIS (http server) privilege. Add everyone if necessary.

b. Add MIME Types:

Open IIS, open Default Web Site Properies -> HTTP Headers -> MIME Types -> New:

.*       application/octet-stream

 

4. Failed to connect to http server. (Unauthorized.)

a. Open IIS, open Default Web Site -> Properties -> Directory Security -> Authentication and access control. Click Edit. Check Enable anonymous access.

Or b. Type username and password in client.

 

5. Windows 2003 + IIS 6.0 "Service Unavailable" error.

Open IIS, then open Web Sites -> Properties -> Service. Check "Run WWW service in IIS 5.0 isolation mode". 

 

6. VMWare failed to launch peer process.

Probably caused by low disk space. Free some space, and stop all vmware related processes, then try again.

 

7. VMWare Station not able to take snapshot (the menu is grayed).

It's because the VM is created by old version of VMWare.

Select VM->Upgrade Virtual Machine.


8. Application displays junk code.
There are 3 kinds of junk code correspond to different solutions:
a. Displays "???".
Code page for the language version of the application is not installed. Open Control Panel -> Regional Options to install it.
b. Displays tofu.
The font is incorrect. Add the correct font to Fonts in Control Panel.
c. Displays other language codes.
Select the language that match the language version of the application in the Advanced tab of Regional Options in Control Panel.

 

Linux:

1. "ifconfig" command does not work in Turbo linux when remote access by PuTTY.

Change the Keyboard setting in PuTTY: select Control-H, rxvt, SCO.

 

2. Failed to access Suse linux by PuTTY.

Change the SSH authentication type:

Config -> SSH -> Auth: check SSH1. 

 

3. Postfix only binds to localhost (127.0.0.1).

1) Open /etc/postfix/main.cf

2) Search for: inet_interfaces = localhost 

3) Change it to: inet_interfaces = All

 

4. Program make/build error: Makefile is older than Makefile.org, Configure or config. (Error code 1)

Probably caused by lagging system time. Just change system time to current and try again.

 

 

 

 

 

 

 

Comments (0) :: Permanent Link

2007-Oct-29 - File descriptor and convention of Windows and Unix platform

When port web application to IIS, developer has to do the following conversion on his codes, so that the Unix files meet Windows convention. QA hence need to pay attention to these points too.

 

Feature

Unix Implementation

Change to Windows Implementation

Directory separator

Forward slash (/).

Backslash(\)。

Note: In Perl script, backslash is used as an excape character. So you have to use double backslash(\\) to indicate the backslash in a directory. 

File names and pathnames

Unix supports long file name and extension with 4 characters. File name is case sensitive.

FAT file system uses DOS 8.3 filename convention. And it's case insensitive.

NTFS is case aware, yet case insensitive.

Directory hierarchy

Unix file system appears as a single directory layer.

Windows storage is seperated to several physical and virtual drives, each of which has a directory hierarchy. So you have to specify the drive letter(C,D,E,etc.) as part of the file path when access a Windows file.

Text file line termination

Unix only uses LF(line feed) to indicate the end of a line in text file.

Uses both CR(carriage return) and LF to terminate a line in text file, and some applications.

File desciptors/handles

Unix file descriptors 0, 1, and 2 indicate stdin, stdout, and stderr respectively.

Win32 uses handles instead of descriptors. Call Win32 API GetStdHandle() to confirm which handle is in use.  

File path length limitation

Unix filename is restricted to 255 characters.

Windows file path is restricted to 259 characters.

Comments (0) :: Permanent Link

<- Last Page :: Next Page ->

About Me

Here I share my experiences and thoughts as a QA engineer, and a place to put my notes.

Search This Blog

Categories

My thinkings
My knowledge base
My tools

Links

Home
View my profile
Archives
Friends
Email Me

Friends

whollymindless
strazzerj
syed1982
mferris
ukkuru
michaeljf
agvasqa
priyabala
srini847
spikyone
naba123
Blog Widget by LinkWithin