From: Amos Kong <akong@redhat.com>
To: lmr@redhat.com
Cc: autotest@test.kernel.org, qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [RFC PATCH 13/14] KVM-test: Improve vlan subtest
Date: Tue, 20 Jul 2010 09:36:41 +0800 [thread overview]
Message-ID: <20100720013641.2212.1105.stgit@z> (raw)
In-Reply-To: <20100720013414.2212.13476.stgit@z>
This is an enhancement of existed vlan test. Rename the vlan_tag.py to vlan.py,
it is more reasonable.
. Setup arp from "/proc/sys/net/ipv4/conf/all/arp_ignore"
. Multiple vlans exist simultaneously
. Test ping between same and different vlans
. Test by TCP data transfer, floop ping between same vlan
. Maximal plumb/unplumb vlans
Signed-off-by: Amos Kong <akong@redhat.com>
---
0 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/client/tests/kvm/tests/vlan.py b/client/tests/kvm/tests/vlan.py
new file mode 100644
index 0000000..dc7611b
--- /dev/null
+++ b/client/tests/kvm/tests/vlan.py
@@ -0,0 +1,181 @@
+import logging, time, re
+from autotest_lib.client.common_lib import error
+import kvm_subprocess, kvm_test_utils, kvm_utils, kvm_net_utils
+
+def run_vlan(test, params, env):
+ """
+ Test 802.1Q vlan of NIC, config it by vconfig command.
+
+ 1) Create two VMs
+ 2) Setup guests in 10 different vlans by vconfig and using hard-coded
+ ip address
+ 3) Test by ping between same and different vlans of two VMs
+ 4) Test by TCP data transfer, floop ping between same vlan of two VMs
+ 5) Test maximal plumb/unplumb vlans
+ 6) Recover the vlan config
+
+ @param test: KVM test object.
+ @param params: Dictionary with the test parameters.
+ @param env: Dictionary with test environment.
+ """
+
+ vm = []
+ session = []
+ vm_ip = []
+ digest_origin = []
+ vlan_ip = ['', '']
+ ip_unit = ['1', '2']
+ subnet = params.get("subnet")
+ vlan_num = int(params.get("vlan_num"))
+ maximal = int(params.get("maximal"))
+ file_size = params.get("file_size")
+
+ vm.append(kvm_test_utils.get_living_vm(env, params.get("main_vm")))
+ vm.append(kvm_test_utils.get_living_vm(env, "vm2"))
+
+ def add_vlan(session, id, iface="eth0"):
+ if session.get_command_status("vconfig add %s %s" % (iface, id)) != 0:
+ raise error.TestError("Fail to add %s.%s" % (iface, id))
+
+ def set_ip_vlan(session, id, ip, iface="eth0"):
+ iface = "%s.%s" % (iface, id)
+ if session.get_command_status("ifconfig %s %s" % (iface, ip)) != 0:
+ raise error.TestError("Fail to configure ip for %s" % iface)
+
+ def set_arp_ignore(session, iface="eth0"):
+ ignore_cmd = "echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore"
+ if session.get_command_status(ignore_cmd) != 0:
+ raise error.TestError("Fail to set arp_ignore of %s" % session)
+
+ def rem_vlan(session, id, iface="eth0"):
+ rem_vlan_cmd = "if [[ -e /proc/net/vlan/%s ]];then vconfig rem %s;fi"
+ iface = "%s.%s" % (iface, id)
+ s = session.get_command_status(rem_vlan_cmd % (iface, iface))
+ return s
+
+ def nc_transfer(src, dst):
+ nc_port = kvm_utils.find_free_port(1025, 5334, vm_ip[dst])
+ listen_cmd = params.get("listen_cmd")
+ send_cmd = params.get("send_cmd")
+
+ #listen in dst
+ listen_cmd = listen_cmd % (nc_port, "receive")
+ session[dst].sendline(listen_cmd)
+ time.sleep(2)
+ #send file from src to dst
+ send_cmd = send_cmd % (vlan_ip[dst], str(nc_port), "file")
+ if session[src].get_command_status(send_cmd, timeout = 60) != 0:
+ raise error.TestFail ("Fail to send file"
+ " from vm%s to vm%s" % (src+1, dst+1))
+ s, o = session[dst].read_up_to_prompt(timeout=60)
+ if s != True:
+ raise error.TestFail ("Fail to receive file"
+ " from vm%s to vm%s" % (src+1, dst+1))
+ #check MD5 message digest of receive file in dst
+ output = session[dst].get_command_output("md5sum receive").strip()
+ digest_receive = re.findall(r'(\w+)', output)[0]
+ if digest_receive == digest_origin[src]:
+ logging.info("file succeed received in vm %s" % vlan_ip[dst])
+ else:
+ logging.info("digest_origin is %s" % digest_origin[src])
+ logging.info("digest_receive is %s" % digest_receive)
+ raise error.TestFail("File transfered differ from origin")
+ session[dst].get_command_status("rm -f receive")
+
+ for i in range(2):
+ session.append(kvm_test_utils.wait_for_login(vm[i],
+ timeout=int(params.get("login_timeout", 360))))
+ if not session[i] :
+ raise error.TestError("Could not log into guest(vm%d)" % i)
+ logging.info("Logged in")
+
+ #get guest ip
+ vm_ip.append(vm[i].get_address())
+
+ #produce sized file in vm
+ dd_cmd = "dd if=/dev/urandom of=file bs=1024k count=%s"
+ if session[i].get_command_status(dd_cmd % file_size) != 0:
+ raise error.TestFail("File producing failed")
+ #record MD5 message digest of file
+ s, output =session[i].get_command_status_output("md5sum file",
+ timeout=60)
+ if s != 0:
+ raise error.TestFail("File MD5_checking failed" )
+ digest_origin.append(re.findall(r'(\w+)', output)[0])
+
+ #stop firewall in vm
+ session[i].get_command_status("/etc/init.d/iptables stop")
+
+ #load 8021q module for vconfig
+ load_8021q_cmd = "modprobe 8021q"
+ if session[i].get_command_status(load_8021q_cmd) != 0:
+ raise error.TestError("Fail to load 8021q module on VM%s" % i)
+
+ try:
+ for i in range(2):
+ for vlan_i in range(1, vlan_num+1):
+ add_vlan(session[i], vlan_i)
+ set_ip_vlan(session[i], vlan_i, "%s.%s.%s" % \
+ (subnet, vlan_i, ip_unit[i]))
+ set_arp_ignore(session[i])
+
+ for vlan in range(1, vlan_num+1):
+ logging.info("Test for vlan %s" % vlan)
+
+ logging.info("Ping between vlans")
+ interface = 'eth0.' + str(vlan)
+ for vlan2 in range(1, vlan_num+1):
+ for i in range(2):
+ dest = subnet +'.'+ str(vlan2)+ '.' + ip_unit[(i+1)%2]
+ s, o = kvm_net_utils.ping(dest, count=2,
+ interface=interface,
+ session=session[i], timeout=30)
+ if ((vlan == vlan2) ^ (s == 0)):
+ raise error.TestFail ("%s ping %s unexpected" %
+ (interface, dest))
+
+ vlan_ip[0] = subnet + '.' + str(vlan) + '.' + ip_unit[0]
+ vlan_ip[1] = subnet + '.' + str(vlan) + '.' + ip_unit[1]
+
+ logging.info("Flood ping")
+ def flood_ping(src, dst):
+ # we must use a dedicated session becuase the kvm_subprocess
+ # does not have the other method to interrupt the process in
+ # the guest rather than close the session.
+ session_flood = kvm_test_utils.wait_for_login(vm[src],
+ timeout = 60)
+ kvm_net_utils.ping(vlan_ip[dst], flood=True,
+ interface=interface,
+ session=session_flood, timeout=10)
+ session_flood.close()
+
+ flood_ping(0,1)
+ flood_ping(1,0)
+
+ logging.info("Transfering data through nc")
+ nc_transfer(0, 1)
+ nc_transfer(1, 0)
+
+ finally:
+ for vlan in range(1, vlan_num+1):
+ rem_vlan(session[0], vlan)
+ rem_vlan(session[1], vlan)
+ logging.info("rem eth0.%s" % vlan)
+
+ #Plumb/unplumb maximal unber of vlan interfaces
+ i = 1
+ s = 0
+ try:
+ logging.info("Testing the plumb of vlan interface")
+ for i in range (1, maximal+1):
+ add_vlan(session[0], i)
+ finally:
+ for j in range (1, i+1):
+ s = s or rem_vlan(session[0], j)
+ if s == 0:
+ logging.info("maximal interface plumb test done")
+ else:
+ logging.error("maximal interface plumb test failed")
+
+ session[0].close()
+ session[1].close()
diff --git a/client/tests/kvm/tests/vlan_tag.py b/client/tests/kvm/tests/vlan_tag.py
deleted file mode 100644
index cafd8fe..0000000
--- a/client/tests/kvm/tests/vlan_tag.py
+++ /dev/null
@@ -1,68 +0,0 @@
-import logging, time
-from autotest_lib.client.common_lib import error
-import kvm_subprocess, kvm_test_utils, kvm_utils
-
-
-def run_vlan_tag(test, params, env):
- """
- Test 802.1Q vlan of NIC, config it by vconfig command.
-
- 1) Create two VMs.
- 2) Setup guests in different VLANs by vconfig and test communication by
- ping using hard-coded ip addresses.
- 3) Setup guests in same vlan and test communication by ping.
- 4) Recover the vlan config.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- subnet = params.get("subnet")
- vlans = params.get("vlans").split()
-
- vm1 = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
- vm2 = kvm_test_utils.get_living_vm(env, "vm2")
-
- timeout = int(params.get("login_timeout", 360))
- session1 = kvm_test_utils.wait_for_login(vm1, timeout=timeout)
- session2 = kvm_test_utils.wait_for_login(vm2, timeout=timeout)
-
- try:
- ip_cfg_base = "vconfig add eth0 %s && ifconfig eth0.%s %s.%s"
- ip_cfg_cmd1 = ip_cfg_base % (vlans[0], vlans[0], subnet, "11")
- ip_cfg_cmd2 = ip_cfg_base % (vlans[1], vlans[1], subnet, "12")
-
- # Configure VM1 and VM2 in different VLANs
- ip_cfg_vm1 = session1.get_command_status(ip_cfg_cmd1)
- if ip_cfg_vm1 != 0:
- raise error.TestError("Failed to config VM 1 IP address")
- ip_cfg_vm2 = session2.get_command_status(ip_cfg_cmd2)
- if ip_cfg_vm2 != 0:
- raise error.TestError("Failed to config VM 2 IP address")
-
- # Trying to ping VM 2 from VM 1, this shouldn't work
- ping_cmd = "ping -c 2 -I eth0.%s %s.%s" % (vlans[0], subnet, "12")
- ping_diff_vlan = session1.get_command_status(ping_cmd)
- if ping_diff_vlan == 0:
- raise error.TestFail("VM 2 can be reached even though it was "
- "configured on a different VLAN")
-
- # Now let's put VM 2 in the same VLAN as VM 1
- ip_cfg_reconfig= ("vconfig rem eth0.%s && vconfig add eth0 %s && "
- "ifconfig eth0.%s %s.%s" % (vlans[1], vlans[0],
- vlans[0], subnet, "12"))
- ip_cfg_vm2 = session2.get_command_status(ip_cfg_reconfig)
- if ip_cfg_vm2 != 0:
- raise error.TestError("Failed to re-config IP address of VM 2")
-
- # Try to ping VM 2 from VM 1, this should work
- ping_same_vlan = session1.get_command_status(ping_cmd)
- if ping_same_vlan != 0:
- raise error.TestFail("Failed to ping VM 2 even though it was "
- "configured on the same VLAN")
-
- finally:
- session1.get_command_status("vconfig rem eth0.%s" % vlans[0])
- session1.close()
- session2.get_command_status("vconfig rem eth0.%s" % vlans[0])
- session2.close()
diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample
index dec988e..b25980e 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -337,17 +337,21 @@ variants:
- fmt_raw:
image_format_stg = raw
- - vlan_tag: install setup unattended_install.cdrom
- type = vlan_tag
+ - vlan: install setup unattended_install.cdrom
+ type = vlan
# subnet should not be used by host
- subnet = 192.168.123
- vlans = "10 20"
+ subnet = "192.168"
+ vlan_num = 5
+ file_size = 10
+ maximal = 4094
+ listen_cmd = "nc -l %s > %s"
+ send_cmd = "nc %s %s < %s"
nic_mode = tap
vms += " vm2"
extra_params_vm1 += " -snapshot"
extra_params_vm2 += " -snapshot"
+ kill_vm_vm2 = yes
kill_vm_gracefully_vm2 = no
- address_index_vm2 = 1
- ping: install setup unattended_install.cdrom
type = ping
@@ -1084,7 +1088,7 @@ variants:
# Windows section
- @Windows:
- no autotest linux_s3 vlan_tag ioquit unattended_install.(url|nfs|remote_ks) jumbo file_transfer nicdriver_unload nic_promisc multicast mac_change
+ no autotest linux_s3 vlan ioquit unattended_install.(url|nfs|remote_ks) jumbo file_transfer nicdriver_unload nic_promisc multicast mac_change
shutdown_command = shutdown /s /f /t 0
reboot_command = shutdown /r /f /t 0
status_test_command = echo %errorlevel%
WARNING: multiple messages have this Message-ID (diff)
From: Amos Kong <akong@redhat.com>
To: lmr@redhat.com
Cc: autotest@test.kernel.org, qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [Qemu-devel] [RFC PATCH 13/14] KVM-test: Improve vlan subtest
Date: Tue, 20 Jul 2010 09:36:41 +0800 [thread overview]
Message-ID: <20100720013641.2212.1105.stgit@z> (raw)
In-Reply-To: <20100720013414.2212.13476.stgit@z>
This is an enhancement of existed vlan test. Rename the vlan_tag.py to vlan.py,
it is more reasonable.
. Setup arp from "/proc/sys/net/ipv4/conf/all/arp_ignore"
. Multiple vlans exist simultaneously
. Test ping between same and different vlans
. Test by TCP data transfer, floop ping between same vlan
. Maximal plumb/unplumb vlans
Signed-off-by: Amos Kong <akong@redhat.com>
---
0 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/client/tests/kvm/tests/vlan.py b/client/tests/kvm/tests/vlan.py
new file mode 100644
index 0000000..dc7611b
--- /dev/null
+++ b/client/tests/kvm/tests/vlan.py
@@ -0,0 +1,181 @@
+import logging, time, re
+from autotest_lib.client.common_lib import error
+import kvm_subprocess, kvm_test_utils, kvm_utils, kvm_net_utils
+
+def run_vlan(test, params, env):
+ """
+ Test 802.1Q vlan of NIC, config it by vconfig command.
+
+ 1) Create two VMs
+ 2) Setup guests in 10 different vlans by vconfig and using hard-coded
+ ip address
+ 3) Test by ping between same and different vlans of two VMs
+ 4) Test by TCP data transfer, floop ping between same vlan of two VMs
+ 5) Test maximal plumb/unplumb vlans
+ 6) Recover the vlan config
+
+ @param test: KVM test object.
+ @param params: Dictionary with the test parameters.
+ @param env: Dictionary with test environment.
+ """
+
+ vm = []
+ session = []
+ vm_ip = []
+ digest_origin = []
+ vlan_ip = ['', '']
+ ip_unit = ['1', '2']
+ subnet = params.get("subnet")
+ vlan_num = int(params.get("vlan_num"))
+ maximal = int(params.get("maximal"))
+ file_size = params.get("file_size")
+
+ vm.append(kvm_test_utils.get_living_vm(env, params.get("main_vm")))
+ vm.append(kvm_test_utils.get_living_vm(env, "vm2"))
+
+ def add_vlan(session, id, iface="eth0"):
+ if session.get_command_status("vconfig add %s %s" % (iface, id)) != 0:
+ raise error.TestError("Fail to add %s.%s" % (iface, id))
+
+ def set_ip_vlan(session, id, ip, iface="eth0"):
+ iface = "%s.%s" % (iface, id)
+ if session.get_command_status("ifconfig %s %s" % (iface, ip)) != 0:
+ raise error.TestError("Fail to configure ip for %s" % iface)
+
+ def set_arp_ignore(session, iface="eth0"):
+ ignore_cmd = "echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore"
+ if session.get_command_status(ignore_cmd) != 0:
+ raise error.TestError("Fail to set arp_ignore of %s" % session)
+
+ def rem_vlan(session, id, iface="eth0"):
+ rem_vlan_cmd = "if [[ -e /proc/net/vlan/%s ]];then vconfig rem %s;fi"
+ iface = "%s.%s" % (iface, id)
+ s = session.get_command_status(rem_vlan_cmd % (iface, iface))
+ return s
+
+ def nc_transfer(src, dst):
+ nc_port = kvm_utils.find_free_port(1025, 5334, vm_ip[dst])
+ listen_cmd = params.get("listen_cmd")
+ send_cmd = params.get("send_cmd")
+
+ #listen in dst
+ listen_cmd = listen_cmd % (nc_port, "receive")
+ session[dst].sendline(listen_cmd)
+ time.sleep(2)
+ #send file from src to dst
+ send_cmd = send_cmd % (vlan_ip[dst], str(nc_port), "file")
+ if session[src].get_command_status(send_cmd, timeout = 60) != 0:
+ raise error.TestFail ("Fail to send file"
+ " from vm%s to vm%s" % (src+1, dst+1))
+ s, o = session[dst].read_up_to_prompt(timeout=60)
+ if s != True:
+ raise error.TestFail ("Fail to receive file"
+ " from vm%s to vm%s" % (src+1, dst+1))
+ #check MD5 message digest of receive file in dst
+ output = session[dst].get_command_output("md5sum receive").strip()
+ digest_receive = re.findall(r'(\w+)', output)[0]
+ if digest_receive == digest_origin[src]:
+ logging.info("file succeed received in vm %s" % vlan_ip[dst])
+ else:
+ logging.info("digest_origin is %s" % digest_origin[src])
+ logging.info("digest_receive is %s" % digest_receive)
+ raise error.TestFail("File transfered differ from origin")
+ session[dst].get_command_status("rm -f receive")
+
+ for i in range(2):
+ session.append(kvm_test_utils.wait_for_login(vm[i],
+ timeout=int(params.get("login_timeout", 360))))
+ if not session[i] :
+ raise error.TestError("Could not log into guest(vm%d)" % i)
+ logging.info("Logged in")
+
+ #get guest ip
+ vm_ip.append(vm[i].get_address())
+
+ #produce sized file in vm
+ dd_cmd = "dd if=/dev/urandom of=file bs=1024k count=%s"
+ if session[i].get_command_status(dd_cmd % file_size) != 0:
+ raise error.TestFail("File producing failed")
+ #record MD5 message digest of file
+ s, output =session[i].get_command_status_output("md5sum file",
+ timeout=60)
+ if s != 0:
+ raise error.TestFail("File MD5_checking failed" )
+ digest_origin.append(re.findall(r'(\w+)', output)[0])
+
+ #stop firewall in vm
+ session[i].get_command_status("/etc/init.d/iptables stop")
+
+ #load 8021q module for vconfig
+ load_8021q_cmd = "modprobe 8021q"
+ if session[i].get_command_status(load_8021q_cmd) != 0:
+ raise error.TestError("Fail to load 8021q module on VM%s" % i)
+
+ try:
+ for i in range(2):
+ for vlan_i in range(1, vlan_num+1):
+ add_vlan(session[i], vlan_i)
+ set_ip_vlan(session[i], vlan_i, "%s.%s.%s" % \
+ (subnet, vlan_i, ip_unit[i]))
+ set_arp_ignore(session[i])
+
+ for vlan in range(1, vlan_num+1):
+ logging.info("Test for vlan %s" % vlan)
+
+ logging.info("Ping between vlans")
+ interface = 'eth0.' + str(vlan)
+ for vlan2 in range(1, vlan_num+1):
+ for i in range(2):
+ dest = subnet +'.'+ str(vlan2)+ '.' + ip_unit[(i+1)%2]
+ s, o = kvm_net_utils.ping(dest, count=2,
+ interface=interface,
+ session=session[i], timeout=30)
+ if ((vlan == vlan2) ^ (s == 0)):
+ raise error.TestFail ("%s ping %s unexpected" %
+ (interface, dest))
+
+ vlan_ip[0] = subnet + '.' + str(vlan) + '.' + ip_unit[0]
+ vlan_ip[1] = subnet + '.' + str(vlan) + '.' + ip_unit[1]
+
+ logging.info("Flood ping")
+ def flood_ping(src, dst):
+ # we must use a dedicated session becuase the kvm_subprocess
+ # does not have the other method to interrupt the process in
+ # the guest rather than close the session.
+ session_flood = kvm_test_utils.wait_for_login(vm[src],
+ timeout = 60)
+ kvm_net_utils.ping(vlan_ip[dst], flood=True,
+ interface=interface,
+ session=session_flood, timeout=10)
+ session_flood.close()
+
+ flood_ping(0,1)
+ flood_ping(1,0)
+
+ logging.info("Transfering data through nc")
+ nc_transfer(0, 1)
+ nc_transfer(1, 0)
+
+ finally:
+ for vlan in range(1, vlan_num+1):
+ rem_vlan(session[0], vlan)
+ rem_vlan(session[1], vlan)
+ logging.info("rem eth0.%s" % vlan)
+
+ #Plumb/unplumb maximal unber of vlan interfaces
+ i = 1
+ s = 0
+ try:
+ logging.info("Testing the plumb of vlan interface")
+ for i in range (1, maximal+1):
+ add_vlan(session[0], i)
+ finally:
+ for j in range (1, i+1):
+ s = s or rem_vlan(session[0], j)
+ if s == 0:
+ logging.info("maximal interface plumb test done")
+ else:
+ logging.error("maximal interface plumb test failed")
+
+ session[0].close()
+ session[1].close()
diff --git a/client/tests/kvm/tests/vlan_tag.py b/client/tests/kvm/tests/vlan_tag.py
deleted file mode 100644
index cafd8fe..0000000
--- a/client/tests/kvm/tests/vlan_tag.py
+++ /dev/null
@@ -1,68 +0,0 @@
-import logging, time
-from autotest_lib.client.common_lib import error
-import kvm_subprocess, kvm_test_utils, kvm_utils
-
-
-def run_vlan_tag(test, params, env):
- """
- Test 802.1Q vlan of NIC, config it by vconfig command.
-
- 1) Create two VMs.
- 2) Setup guests in different VLANs by vconfig and test communication by
- ping using hard-coded ip addresses.
- 3) Setup guests in same vlan and test communication by ping.
- 4) Recover the vlan config.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- subnet = params.get("subnet")
- vlans = params.get("vlans").split()
-
- vm1 = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
- vm2 = kvm_test_utils.get_living_vm(env, "vm2")
-
- timeout = int(params.get("login_timeout", 360))
- session1 = kvm_test_utils.wait_for_login(vm1, timeout=timeout)
- session2 = kvm_test_utils.wait_for_login(vm2, timeout=timeout)
-
- try:
- ip_cfg_base = "vconfig add eth0 %s && ifconfig eth0.%s %s.%s"
- ip_cfg_cmd1 = ip_cfg_base % (vlans[0], vlans[0], subnet, "11")
- ip_cfg_cmd2 = ip_cfg_base % (vlans[1], vlans[1], subnet, "12")
-
- # Configure VM1 and VM2 in different VLANs
- ip_cfg_vm1 = session1.get_command_status(ip_cfg_cmd1)
- if ip_cfg_vm1 != 0:
- raise error.TestError("Failed to config VM 1 IP address")
- ip_cfg_vm2 = session2.get_command_status(ip_cfg_cmd2)
- if ip_cfg_vm2 != 0:
- raise error.TestError("Failed to config VM 2 IP address")
-
- # Trying to ping VM 2 from VM 1, this shouldn't work
- ping_cmd = "ping -c 2 -I eth0.%s %s.%s" % (vlans[0], subnet, "12")
- ping_diff_vlan = session1.get_command_status(ping_cmd)
- if ping_diff_vlan == 0:
- raise error.TestFail("VM 2 can be reached even though it was "
- "configured on a different VLAN")
-
- # Now let's put VM 2 in the same VLAN as VM 1
- ip_cfg_reconfig= ("vconfig rem eth0.%s && vconfig add eth0 %s && "
- "ifconfig eth0.%s %s.%s" % (vlans[1], vlans[0],
- vlans[0], subnet, "12"))
- ip_cfg_vm2 = session2.get_command_status(ip_cfg_reconfig)
- if ip_cfg_vm2 != 0:
- raise error.TestError("Failed to re-config IP address of VM 2")
-
- # Try to ping VM 2 from VM 1, this should work
- ping_same_vlan = session1.get_command_status(ping_cmd)
- if ping_same_vlan != 0:
- raise error.TestFail("Failed to ping VM 2 even though it was "
- "configured on the same VLAN")
-
- finally:
- session1.get_command_status("vconfig rem eth0.%s" % vlans[0])
- session1.close()
- session2.get_command_status("vconfig rem eth0.%s" % vlans[0])
- session2.close()
diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample
index dec988e..b25980e 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -337,17 +337,21 @@ variants:
- fmt_raw:
image_format_stg = raw
- - vlan_tag: install setup unattended_install.cdrom
- type = vlan_tag
+ - vlan: install setup unattended_install.cdrom
+ type = vlan
# subnet should not be used by host
- subnet = 192.168.123
- vlans = "10 20"
+ subnet = "192.168"
+ vlan_num = 5
+ file_size = 10
+ maximal = 4094
+ listen_cmd = "nc -l %s > %s"
+ send_cmd = "nc %s %s < %s"
nic_mode = tap
vms += " vm2"
extra_params_vm1 += " -snapshot"
extra_params_vm2 += " -snapshot"
+ kill_vm_vm2 = yes
kill_vm_gracefully_vm2 = no
- address_index_vm2 = 1
- ping: install setup unattended_install.cdrom
type = ping
@@ -1084,7 +1088,7 @@ variants:
# Windows section
- @Windows:
- no autotest linux_s3 vlan_tag ioquit unattended_install.(url|nfs|remote_ks) jumbo file_transfer nicdriver_unload nic_promisc multicast mac_change
+ no autotest linux_s3 vlan ioquit unattended_install.(url|nfs|remote_ks) jumbo file_transfer nicdriver_unload nic_promisc multicast mac_change
shutdown_command = shutdown /s /f /t 0
reboot_command = shutdown /r /f /t 0
status_test_command = echo %errorlevel%
next prev parent reply other threads:[~2010-07-20 1:36 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-20 1:34 [RFC PATCH 00/14] Patchset of network related subtests Amos Kong
2010-07-20 1:34 ` [Qemu-devel] [Autotest][RFC " Amos Kong
2010-07-20 1:34 ` [RFC PATCH 01/14] KVM-test: Add a new macaddress pool algorithm Amos Kong
2010-07-20 1:34 ` [Qemu-devel] " Amos Kong
2010-07-20 10:19 ` Michael Goldish
2010-07-20 10:19 ` Michael Goldish
2010-07-20 13:44 ` Amos Kong
2010-07-20 15:53 ` Michael Goldish
2010-07-20 15:53 ` Michael Goldish
2010-08-03 1:34 ` Amos Kong
2010-07-27 1:48 ` Lucas Meneghel Rodrigues
2010-07-27 1:48 ` [Qemu-devel] " Lucas Meneghel Rodrigues
2010-07-20 1:35 ` [RFC PATCH 02/14] KVM Test: Add a function get_interface_name() to kvm_net_utils.py Amos Kong
2010-07-20 1:35 ` [Qemu-devel] " Amos Kong
2010-07-27 2:08 ` Lucas Meneghel Rodrigues
2010-07-27 2:08 ` Lucas Meneghel Rodrigues
2010-07-28 10:29 ` Michael Goldish
2010-07-28 10:29 ` Michael Goldish
2010-08-03 1:39 ` Amos Kong
2010-07-20 1:35 ` [RFC PATCH 03/14] KVM Test: Add a common ping module for network related tests Amos Kong
2010-07-20 1:35 ` [Qemu-devel] " Amos Kong
2010-07-27 13:01 ` Lucas Meneghel Rodrigues
2010-07-28 11:50 ` Michael Goldish
2010-07-28 13:56 ` Michael Goldish
2010-07-28 13:56 ` Michael Goldish
2010-07-20 1:35 ` [RFC PATCH 04/14] KVM-test: Add a new subtest ping Amos Kong
2010-07-20 1:35 ` [Qemu-devel] " Amos Kong
2010-07-27 13:15 ` Lucas Meneghel Rodrigues
2010-07-27 13:15 ` [Qemu-devel] " Lucas Meneghel Rodrigues
2010-08-03 1:54 ` Amos Kong
2010-08-03 1:54 ` [Qemu-devel] " Amos Kong
2010-07-20 1:35 ` [RFC PATCH 05/14] KVM-test: Add a subtest jumbo Amos Kong
2010-07-20 1:35 ` [Qemu-devel] " Amos Kong
2010-07-27 14:13 ` Lucas Meneghel Rodrigues
2010-07-27 14:13 ` [Qemu-devel] " Lucas Meneghel Rodrigues
2010-08-10 7:18 ` Amos Kong
2010-08-10 7:18 ` [Qemu-devel] Re: [Autotest] " Amos Kong
2010-07-20 1:35 ` [RFC PATCH 06/14] KVM-test: Add basic file transfer test Amos Kong
2010-07-20 1:35 ` [Qemu-devel] " Amos Kong
2010-07-27 14:36 ` Lucas Meneghel Rodrigues
2010-08-10 9:29 ` [Autotest] " Amos Kong
2010-08-10 9:29 ` Amos Kong
2010-07-20 1:35 ` [RFC PATCH 07/14] KVM-test: Add a subtest of load/unload nic driver Amos Kong
2010-07-20 1:35 ` [Qemu-devel] " Amos Kong
2010-07-28 18:12 ` Lucas Meneghel Rodrigues
2010-07-20 1:35 ` [RFC PATCH 08/14] KVM-test: Add a subtest of nic promisc Amos Kong
2010-07-20 1:35 ` [Qemu-devel] " Amos Kong
2010-07-28 21:35 ` Lucas Meneghel Rodrigues
2010-07-28 21:35 ` [Qemu-devel] " Lucas Meneghel Rodrigues
2010-08-11 1:34 ` [Autotest] " Amos Kong
2010-08-11 1:34 ` [Qemu-devel] " Amos Kong
2010-07-20 1:36 ` [RFC PATCH 09/14] KVM-test: Add a subtest of multicast Amos Kong
2010-07-20 1:36 ` [Qemu-devel] " Amos Kong
2010-07-28 21:55 ` Lucas Meneghel Rodrigues
2010-07-20 1:36 ` [RFC PATCH 10/14] KVM-test: Add a subtest of pxe Amos Kong
2010-07-20 1:36 ` [Qemu-devel] " Amos Kong
2010-07-28 22:07 ` Lucas Meneghel Rodrigues
2010-08-10 6:11 ` Amos Kong
2010-07-20 1:36 ` [RFC PATCH 11/14] KVM-test: Add a subtest of changing mac address Amos Kong
2010-07-20 1:36 ` [Qemu-devel] " Amos Kong
2010-07-28 22:30 ` Lucas Meneghel Rodrigues
2010-07-20 1:36 ` [RFC PATCH 12/14] KVM-test: Add a subtest of netperf Amos Kong
2010-07-20 1:36 ` [Qemu-devel] " Amos Kong
2010-07-30 16:32 ` Lucas Meneghel Rodrigues
2010-07-20 1:36 ` Amos Kong [this message]
2010-07-20 1:36 ` [Qemu-devel] [RFC PATCH 13/14] KVM-test: Improve vlan subtest Amos Kong
2010-07-20 1:36 ` [RFC PATCH 14/14] KVM-test: Add subtest of testing offload by ethtool Amos Kong
2010-07-20 1:36 ` [Qemu-devel] " Amos Kong
2010-08-02 19:10 ` Lucas Meneghel Rodrigues
2010-08-02 19:10 ` [Qemu-devel] " Lucas Meneghel Rodrigues
2010-08-10 7:07 ` Amos Kong
2010-08-10 7:07 ` [Qemu-devel] Re: [Autotest] " Amos Kong
2010-07-20 12:12 ` [RFC PATCH 00/14] Patchset of network related subtests Lucas Meneghel Rodrigues
2010-07-20 12:12 ` [Qemu-devel] Re: [Autotest][RFC " Lucas Meneghel Rodrigues
2010-08-02 20:58 ` [RFC " Lucas Meneghel Rodrigues
2010-08-02 20:58 ` [Qemu-devel] Re: [Autotest][RFC " Lucas Meneghel Rodrigues
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100720013641.2212.1105.stgit@z \
--to=akong@redhat.com \
--cc=autotest@test.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=lmr@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.