A Layer-2 switch which is modified on software is used to test IEEE-802.1Q VLAN automatically in this thesis. This system is able to reduce the money, manpower and time to execute automatic testing. The Management VLAN Testing Case in this thesis is a necessary complement of IOL VLAN Testing Case. This thesis also put forward a plan to improving the function of this automatic testing tool. There are more testing patterns are available for testing in this thesis. They can use to locate the bug after automatic testing without rebuild the testing environment. And what it can do is more than what several application software can do.