Testing

From LemonWiki共筆
Jump to navigation Jump to search

troubleshooting steps for connection test

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


(1) local service

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 opened for 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

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

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

case 1: Access the server from outside network ex: WAN

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 alternative web services

  • (for python 2.x) python -m SimpleHTTPServer <port>[9]
  • (for python 3.x) python -m http.server <port>[10]

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

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[11]
    2. lynx http://127.0.0.1 [12] 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 [13] or netstat -npl | grep 3306[14] 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

browser & device issue

online IDE

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

e-mail testing issue

Email testing

monitoring the status or changes of files or registry

monitoring or generating the HTTP request sent to the server

HTTP request and response data tool

domain name issue

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[16], Win 10 & Windows Server 2008 R2 Standard
  • On Windows 2003 server: edit the file located at C:\WINNT\system32\drivers\etc\hosts
  • On Linux Os linux.png , input the command sudo vi /etc/hosts
127.0.0.1       localhost
# ip            domain.com
  • On Mac Os mac.png , input the command sudo vi /private/etc/hosts [17]


Clear the DNS cache

more on DNS checking

handling form data

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

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.[18]
  • Manually clear cookie and temporary files of browser

file upload

excel format compatibility

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

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

server environment

Testing server environment

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

check the server/service logs

OS

Microsoft Windows

Web server

Apache

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

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

  • C:\WINDOWS\system32\LogFiles\

Database server

MySQL

MySQL Server Logs:

  • step1: verify the system variable[20]
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) [21]
[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

Other

PHP

PHP_errors#logging

Java

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

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

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

find match string

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

related terms

  • functional testing

templates

references

further reading


Web site design and development process