Testing

From LemonWiki共筆
Jump to: navigation, search

troubleshooting steps for connection test[edit]

find the problem occurred: (1) local service at the server (localhost) (2) from LAN to server (3) from WAN to server


(1) local service[edit]

WAN ○ -------> ○ LAN -------> ● server

Testing on localhost if you have the administrative permission to manage the server.

  • Check if your computer/server Is being assigned the IP Address.
    • Linux Os linux.png : (1) Check the IP Address. ifconfig. (2) Re-assign the IP Address and restart the networking service. service network restart for CentOS[1]
    • Win Os windows.png : Check the IP Address. ifconfig/all
    • More on Network problem
  • Is service alive? Is the port occupied by other process?
    • Linux Os linux.png
      • nmap "Network exploration tool and security / port scanner." e.g. nmap -p 80,443 ip
      • ss "utility to investigate sockets" e.g. ss -tnlp | grep 80 or using OR operator[2] ss -tnlp | grep '80\|443'
      • ps List the current processes. Input ps -aux | grep "PORT_NUMBER" e.g. ps -aux | grep 443
    • Win Os windows.png Using the software CurrPorts to check the process and port. e.g. Apache will not running if the 80 port was occupied by skype[3].
  • Is the port open to external users? OS firewall or protected by antivirus software.
    • Linux Os linux.png
      • iptables: (1) iptables -L to list all rules[4] (2) rule with smaller line-number will override the rule with larger line-number[5]
      • FirewallD rules: (1) sudo firewall-cmd --get-default-zone return 'public' (2) sudo firewall-cmd --list-all --zone=public[6] (3) Allow port with FirewallD
      • SELinux Policy Management: (1) After installed policycoreutils-python[7], input semanage port -l to list open ports. (2) Allow port with semanage.
    • Win Os windows.png Windows Firewall with Advanced Security -> configure firewall rules
    • protected by antivirus software?
  • connect to localhost ex: telnet 127.0.0.1 23 where 23 is the port number where the service running
    • Install Telnet Client on Win Os windows.png
    • if the local service is web server, you can also try lynx http://127.0.0.1 for Linux Os linux.png
  • double check the server/service logs

(2) from LAN to server[edit]

WAN ○ -------> ● LAN -------> ● server

  • testing on LAN (local network, subnet scope): Is service alive? The different servers between LAN or with the same ip class (ex: 1.2.3.*) may not have the firewall limit.
    • connect to localhost ex: telnet 172.18.0.1 23 (1) IP start with 172.18... is Private IP Network Numbers (2) where 23 is the port number where the service running
      • If the local service is web server, you can also try to connect the internal ip e.g. lynx http://172.18.0.1 for Linux Os linux.png
  • double check the server/service logs

(3) from WAN to server[edit]

WAN ● -------> ● LAN -------> ● server

We met the trouble on WAN (wide area network). If we do no have the administrative permission, the tests we can do as follows:

other issue:

connection test[edit]

case 1: Access the server from outside network ex: WAN[edit]

Where are you? Access the server from outside network ex: Wide Area Network (WAN) or Local Area Network (LAN)

open the browser from outside network ex: Wide Area Network (WAN) or Local Area Network (LAN)

  • and type the address: http://the.domain Icon exclaim.gif Note: Not Private network / Private IP address
  • or use the remote website monitoring services: Web Ping

Using telnet client

curl

  • curl -v -o /dev/null http://IP:Port If failed. It will show the message: "failed: Connection refused"

tools

  1. Check server: Check host - online website monitoring, Check IP "checks the possibility of a TCP connection to host's specified port from different locations around the world." quoted from website. [Last visited: 2015-08-02]

case 2: Access the server from inside ex: localhost or Local LAN[edit]

If you has permission to log in the server via SSH or Remote desktop service.

  • (1)open the browser, (2)type the address: http://127.0.0.1
  • Open Port Check Tool: Using browser to check the specified port of local machine from canyouseeme.org. Icon exclaim.gif it may returned wrong result if the server hosted with shared external IP
  • Linux command:
    1. (optional if lynx was not installed) yum install lynx for CentOS / sudo apt-get install lynx for Ubuntu[9]
    2. lynx http://127.0.0.1 [10] for Linux Os linux.png

telnet

  1. telnet 127.0.0.1 80
  2. (after telnet-ed the web 80 port, key in) get + SPACE
  3. more on HTTP Check Port 80 with the Telnet Command

netstat ex: find MySQL 3306 port

  1. netstat -a | find "3306" (note: require the double quote symbol, not single quote symbol) for Win Os windows.png [11] or netstat -npl | grep 3306[12] for Linux Os linux.png
  2. more on List open ports and listening services

tools

  1. Good! CurrPorts: Monitoring TCP/IP network connections on Windows
  2. PFPortCheck Program: check TCP/UDP port from localhost(where you installed the program) to portforward.com
  3. TCPView for Windows


user client node[edit]

browser & device issue[edit]

online IDE[edit]

code snippet web-based editor / communication tools between developers/designers

database testing

  • Ideone.com support SQL Icon exclaim.gif not support REGEXP function [Last visited: 2015-03-09]
  • SQL fiddle support MySQL, MS SQL server, Oracle, PostgreSQL, SQLite ... Icon exclaim.gif data may not showed in couple days [Last visited: 2015-03-09]

Save or share source codes

browser plug-ins issue[edit]

e-mail testing issue[edit]

Email testing

monitoring the status or changes of files or registry[edit]

monitoring or generating the HTTP request sent to the server[edit]

HTTP request and response data tool

domain name issue[edit]

Modify the following files if you want to test the domain name before the mapping of domain name and ip was changed really

  • C:\WINDOWS\system32\drivers\etc\hosts for Win Os windows.png XP, Win7[14], Win 10 & Windows Server 2008 R2 Standard
  • C:\WINNT\system32\drivers\etc\hosts for Windows 2003 server
  • /etc/hosts for Linux Os linux.png
127.0.0.1       localhost
# ip            domain.com
  • /private/etc/hosts for Mac Os mac.png [15]


Clear the DNS cache

more on DNS checking

handling form data[edit]

before submit the form data

  • (1)Use the Web Developer plugin for Firefox Browser firefox.png and (2)Menu -> Forms -> Display form details

after submit the form data


login issues into different accounts[edit]

If you need to clear the cookie frequently for the testing account issue

  • Using the privacy browsing for Firefox Browser firefox.png & Chrome Browser chrome.png . Each time you turning on the privacy browsing, the logged status and cookie will not saved.[16]
  • Manually clear cookie and temporary files of browser

file upload[edit]

excel format compatibility[edit]

Using Microsoft Excel Viewer to check the excel format compatibility. Icon exclaim.gif It's not save to check the excel file only by using the old version of Excel.


database issue[edit]

  • SQL
    • SQL Fiddle support MySQL, MS SQL, Oracle, PosgreSQL, SQLite ... Good!

server environment[edit]

Testing server environment

local server node (if you has permission to log in the server via SSH or Remote desktop service)[edit]

check the server/service logs

OS[edit]

Microsoft Windows[edit]

Web server[edit]

Apache[edit]

Apache HTTP server log: /etc/httpd/logs (location was set up in the configuration file /etc/httpd/conf/httpd.conf)

  • access.log
  • error.log - record when the apache service restarted/stopped

Using grep command to search the logs: grep -ir "string to search" /path/to/directory. More on Search text in files

IIS[edit]

Microsoft Internet Information Services (IIS) log (記錄檔)[17]

  • C:\WINDOWS\system32\LogFiles\

Database server[edit]

MySQL[edit]

MySQL Server Logs:

  • step1: verify the system variable[18]
mysql> SHOW VARIABLES LIKE '%general_log%';
mysql> SHOW GLOBAL VARIABLES LIKE '%general_log%';
  • step2: enable logging /var/log/mysql.log (location was set up in the configuration file /etc/my.cnf or my.ini) [19]
[mysqld] 
## includes all SQL queries/commands
# general_log = 1
# general_log_file="general_log_file.log"
log-error=/var/log/mysql/error.log
log-slow-queries = /var/log/mysql/mysql-slow.log
#another syntax
#slow_query_log_file = mysql-slow.log
long_query_time = 1
log-long-format
  • step3: restart MySQL service

Microsoft SQL Server[edit]

Other[edit]

PHP[edit]

PHP_errors#logging

Java[edit]

System.out.println("Boston, We Have A Problem" + variable); //output to Tomcat consile
out.println("Boston, We Have A Problem" + variable); //output to JSP webpage

or using NetBeans IDE - Debugger and Profiler to setup the breakpoints.

console command[edit]

//write the console output to the file
command > log.txt

//append to the same file
command >> log.txt

find match string[edit]

Owl icon.jpg If the message text or code snippets was not found in the plain text files, it may stored in the database.

related topic[edit]

related terms

  • functional testing

templates

references[edit]

further reading


Web site design and development process