2012年10月31日 星期三

(Shell Script) Example


cat /sys/plx-ll/link_status > link.log
i=0
while [ "$i" -lt "500" ]
do
ifconfig plxnic0 down
sleep 5
ifconfig plxnic0 up
sleep 5
cat /sys/plx-ll/link_status > link_now.log
diff link.log link_now.log > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo "Round$i : Files are the same"
else
echo "Round$i : Files are different"
exit
fi
i=$(($i+1))
done

2012年10月28日 星期日

(Windows) 批次檔相關用法


1. Echo

@                        #不顯示此行
 echo off              #從下一行開始不顯示
 @echo off          #從本行開始,之後的內容都不顯示
 echo on              #從下一行開始顯示
 echo                   #顯示目前顯示狀態(on/off)
 echo.                  #輸出空白行

2. Date & Time

date /t                 #顯示系統日期,不出現輸入新日期提示
time /t                 #顯示系統時間,不出現輸入新時間提示

2012年10月10日 星期三

收RFQ時要考慮的事


  1. 機臺數量
  2. EVT, DVT次數
  3. 軟、硬體平臺
  4. 合作模式 (report、bug list的出法)
  5. 獨立model或是系列品 (要找上一代負責人拿取相取資料)
  6. 是否有特殊的測試製具、軟體
  7. 測試要在中山進行或在台北進行

2012年8月9日 星期四

FTP distributed stress test with JMeter

Terminology


Before we dive into the step-by-step instructions, it's a good idea to define the terms and make sure the definition is clear.
Master – the system running Jmeter GUI, which controls the test
Slave – the system running jmeter-server, which takes commands from the GUI and send requests to the target system(s)
Target – the webserver we plan to stress test

Environment:
Target IP address: 192.168.5.3
Master IP address: 192.168.5.200
Slave 1&2 IP address: 192.168.5.112, 192.168.5.114

Master Configuration:
Go to jmeter/bin directory,open jmeter.properties in a text editor. Find "remote_hosts=" and add slave's IP address, for example: 
remote_hosts=192.168.5.112, 192.168.5.114

Slave Configuration:
On the slave systems, go to jmeter/bin directory and execute jmeter-server.bat

Create Test Plan (on Master)
  • Go to jmeter/bin directory and run jmeter.bat to start jmeter GUI.
  • Add therad group.













  • Set thread properties.
  • Add ftp request.

  • Set ftp properties. For example , download file from Target. 
#Don't use root path as download destination, like "c:/123.exe". You should specific a folder as download destination, like "c:/test/123.exe"
# Username & Password must be filed, even ftp support anonymous login.



  • Add Listener : View Results in Table & Summary Report.



Run Test (on Master)


2012年8月2日 星期四

NTttcp

It is essentially a Winsock-based port of the ttcp tool that measures networking performance in terms of bytes transferred per second and CPU cycles per byte.
NTttcp can be configured in a variety of ways, including:

  • Software affinity for threads can be set to a specified processor index.
  • Asynchronous or synchronous data transfers.
  • Data verification at the application level for a pre-determined pattern in the application buffers.
  • Send and receive traffic from multiple IP addresses with single command.
  • Support IPv6 performance testing.
  • Support UDP performance testing.
  • Support time-driven testing.


Usage:
NTttcp [-s|-r] -m mapping
-s work as a sender
-r work as a receiver
-m mappping, Sessions,Processor,target ip address
-t runtime in seconds
Example:
NTttcp -s -m 4,0,192.168.10.11 -t 60
Sends 4 sessions on CPU 0 to host with ip address of 192.168.1.10 for 60 seconds.



Configuration:
Setup one system for receive and one system for send. Run the receive system first.
Example:
System A has an ip address of 192.168.10.10 and setup for Receive.
System B has an ip address of 192.168.10.11 and setup for Send.
Run NTttcp on System A:
NTttcp -R -m 4,0,192.168.10.11 -t 60
Note: the ip address is the expected sender’s ip.
Run NTttcp on System A:
NTttcp -R -m 4,0,192.168.10.10 -t 60
Note: the ip address is the receiver’s ip.
Monitor it with Windows Task Manager, Networking tab.
More options:
NTttcp: [-s|-r|-l|-n|-p|-a|-x|-rb|-sb|-i|-f|-u|-w|-d|-t|-cd|-wu|-nic] -m <mapping> [mapping]
-s work as a sender
-r work as a receiver
-l <Length of buffer> [default TCP: 64K, UDP: 128]
-n <Number of buffers> [default: 20K]
-p <port base> [default: 5001]
-sp synchronize data ports, if used -p should be same on every instance
-a <outstanding I/O>  [default: 2]
-x <PacketArray size> [default: 1]
-rb <Receive buffer size> [default: 64K]
-sb <Send buffer size>[default: 8K]
-u UDP send/recv
-w WSARecv/WSASend
-d Verify Flag
-t <Runtime> in seconds.
-cd <Cool-down> in seconds
-wu <Warm-up> in seconds
-nic <NIC IP> Use NIC with for sending data (sender only).
-m <mapping> [mapping]
where a mapping is a session(s),processor,StartReceiver IP set
e.g. -m 4,0,1.2.3.4 sets up:
4 sessions on processor 0 to test a network on 1.2.3.4

How to Use NTttcp
·         To use NTttcp as a receiver, change the name to NTttcpr.exe.
·         To use NTttcp as a sender, change the name to NTttcps.exe.
If you use NTttcp without changing the name, it functions as a receiver by default.

By default, NTttcp uses synchronous data transfer. Data transfer is controlled by the -a option. If you do not set the ‑a option, then the data transfer is synchronous.

We recommend that you increase the number of posted overlapped buffers for the receiver to ensure that the application has enough posted buffers for incoming data
For example:
ntttcpr.exe -m 1,0,10.11.12.1 -a 16 -fr
ntttcps.exe -m 1,0,10.11.12.1 -a 2

Single-Threaded Operation
Sender Syntax for Single-Threaded Operation
The following command line: NTttcps -m 1,0,10.1.2.3 -a 2

Receiver Syntax for Single-Threaded Operation
The following command line: NTttcpr -m 1,0,10.1.2.3 -a 6 -fr

Multi-Threaded Operation
Sender Syntax for Multi-Threaded Operation
The following command line: NTttcps -m 2,0,10.1.2.3 2,1,11.4.5.6 -a 2

Receiver Syntax for Multi-Threaded Operation
The following command line: NTttcpr -m 2,0,10.1.2.3 -a 6 -fr

NTttcp Best Practices
Tip: The following are good practices for the appropriate number of receive buffers:
  •  For 1‑gigabit links, use 6 receive outstanding buffers. 
  •  For 10‑gigabit links, use 16 receive outstanding buffers.
A single thread is usually sufficient to achieve line rate on a 1‑gigabit link, but multiple threads might be required to achieve line rate on a 10‑gigabit link.
To avoid tracking short receives, use the ‑fr (full receive) option on the receiver.


Reference:
http://msdn.microsoft.com
http://www.confignotes.com/2011/06/ntttcp/

2012年8月1日 星期三

Disk Stress

# Purpose: The test should reach the bandwidth limit of the test device for the given test system configuration. 
6 scenarios on all of the found devices, each scenario is run for 15 minutes:
  1. Sequential read 
  2. Sequential write 
  3. Sequential verify (write followed by read and comparison) 
  4. Random read 
  5. Random write 
  6. Random verify
#Any write scenarios (including verify) are skipped for optical devices.

The size of the individual data transfers is is 32 KB.

The test tries to do raw writes, bypassing any file system that is mounted on the hard disk if it can. The test attempts raw writes if one of the following occurs:
  • The test can find a raw, unpartitioned disk. 
  • The test can find a raw, unformatted volume. 
  • The test can find a volume that it can dismount.
If none of the preceding situations are available, the test performs I/O through the file system.
#所以測試時用未分割磁區或是未格式化過的HDD較好

If you are testing any drive that requires media or testing in system-mode on a computer that contains drives that require media, you must insert media into the drives. The media that is used must be formatted and contain data that occupies at least 50% of the media's capacity.

#系統上若有光碟機,需放入資料光碟片,並且光碟容量需使用超過50%。

To ensure best device performance, you should delete any unnecessary files from the test device and should cleanly format or defragment the device before running the test.

#透過測Performance的方式達到Disk stress的目的?
Log File:DiskIO.wtl
Supported operating systems:
  • Windows 7 
  • Windows Server 2008 R2 
  • Windows Vista 
  • Windows Server 2003 
  • Windows XP 
Command Syntax
Command option
Description
/a
Run on all associated devices.
/b <blockSize>
Block size (integer) in bytes of IO transactions. MB & KB supported. ex: /b 32KB
/c <scenarios>
Scenarios to test. <scenarios> should be a list delimited with ','s or ';'s. Valid characters are: s: sequential scenario, x: random scenario, r: read access, w: write access, v: verify (writes followed by reads and data verification), ex: /c sv;xr;xw, ex: /c sv,xr,xw
/d <device>
Device identifiers of devices to test delimited with ','s or ';'s. If none are specified all disks are tested. Identifiers include: Instance path, PhysicalDriveX, and Drive letter. An identifier of "any" will cause the test to run on any device on the system. ex: /d "IDE\DISKMAXTOR_6L160M0__________________________BANC1G10\5&2A36C317&0&0.1.0" /d PhysicalDrive1;G:;"PCI\VEN_8086&DEV_2651&SUBSYS_01791028&REV_03\3&172E68DD&0&FA"
/f
Force file mode. The test won't attempt to dismount volumes. This should not be used as an accurate measure of disk performance.
/i <iterations>
Iterations (integer) to run. Cannot be specified with /d. Default is 1 if /d is not specified.
/l <numBuckets>
Number of buckets to use for approximate latency measurements.
/o
Enable testing of optical drives.
/q <queueDepth>
Depth of the IO queue (integer).
/s <size>
Size (integer) in bytes of one iteration. KB, MB, & GB supported. ex: /s 6GB
/t <time>
Time (integer) in seconds to execute. Cannot be specified with /i. You may also use TimeSpan formatting: dd.hh:mm:ss
/v
Use verbose logging /x <file.xml> Name of XML File to use for reporting. If file.xml is undefined a unique name based on machine, date, and time will be used.



Reference:
msdn.microsoft.com

2012年7月23日 星期一

(BurnInTest) HDD Test


Each test file is filled with a coded number sequence (a Pattern) that is used to verify the correct operation of the disk when the file is verified (read). Files are created in the free space on the disk until the disk is at least 94%* full (we’ll refer to this as the ‘full’ level). When the disk has reached this limit, all the test files are deleted and the test starts again.
(*) 94% is used on disks that have a swap file or a Windows directory. A limit of 94% is used to ensure that some space is kept for use by other applications (including the windows swap file). On disks that do not have a swap file or a Windows directory, between 99.5% and 100% of the disk will be used.

簡單來說,在有OS系統檔的磁區下,預設會寫到94%滿,沒有OS系統檔的磁區,預設會寫到99%滿

Reference: BurnInTest help document

2012年7月22日 星期日

(Abbreviation) CFE

CFE:customer focus executive
1. 掌控產品在工廠試作的狀況及協助解決工程問題。
2. 為工廠製造端客戶對應窗口,解決客戶所需相關問題。
簡單的說 就是工廠最高指導單位 總管工廠大小事

2012年5月3日 星期四

(CCNA) Network Address

Number of hosts that can be on that network: (2^n)-2, n means numbers of host bits.

The reason we subtract 2 is because all 1s within the host portion of an IP address is a broadcast address for that network and cannot be assigned to a specific host. All 0s within the host portion indicates the network ID and again, cannot be assigned to a specific host.



Reference: www.cisco.com

2012年4月4日 星期三

(Windows) 修改win7開機順序

1. Execute "cmd.exe"
2. Enter "Bcdedit"
3. Bcdedit/?  <== instruction
4. bcdedit /set {current} Description “Windows 7 32位元家用進階版”

各別開進各個OS修改描述:D

2012年4月3日 星期二

2012年4月2日 星期一

iometer batch mode

iometer /c test.icf /r results.csv

iometer /r "test results.csv" /c test.icf

iometer /c iometer.icf /r results.csv /t 100

iometer iometer.icf results.csv /t 100

ref: http://3nity.ru/files/iometr_docs/#_Toc465000573

2012年3月21日 星期三

(CentOS 6.2) Samba start&config&mount usb drive

start samba
# smbd && nmbd
or
# /etc/init.d/smb start
or
# service smb restart

firewall disabled

smb.conf
#======================= Global Settings =====================================
[global]
workgroup = whq
server string = BUILDROOT
max log size = 50
security = share
encrypt passwords = no
smb passwd file = /etc/samba/smbpasswd
log file = /var/log/samba/log.smbd
hosts allow =
#interfaces = eth0 192.168.0.1/255.255.255.0
#socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

#============================ Share Definitions ==============================
#idmap uid = 16777216-33554431
#idmap gid = 16777216-33554431
#template shell = /bin/false
#winbind use default domain = no

[data]
path = /
public = yes
writable = yes
printable = no
browsable = yes
force create mode = 0777
force directory mode = 0777

[data2]
path = /mnt/sdb1
public = yes
writable = yes
printable = no
browsable = yes

force create mode = 0777
force directory mode = 0777

#=============================

mount usb drive
如果mount usb裝置後無法存取,試用以下指令   (uid&pid 可能需要改動,看系統中的nobody uid值)

#mount -o  auto,users,umask=000,dmask=000,fmask=000,uid=65534,gid=65534 ${part} ${path}