Index: client/virt/tests/vlan.py |
diff --git a/client/tests/kvm/tests/vlan.py b/client/virt/tests/vlan.py |
similarity index 93% |
rename from client/tests/kvm/tests/vlan.py |
rename to client/virt/tests/vlan.py |
index b1864c9a7e63772e16d36af48be9520749a9146b..9fc1f6401eeaf7823d2e2df74e6b049cfb9f9cdb 100644 |
--- a/client/tests/kvm/tests/vlan.py |
+++ b/client/virt/tests/vlan.py |
@@ -1,6 +1,6 @@ |
import logging, time, re |
from autotest_lib.client.common_lib import error |
-import kvm_test_utils, kvm_utils, kvm_subprocess |
+from autotest_lib.client.virt import virt_utils, virt_test_utils, aexpect |
def run_vlan(test, params, env): |
@@ -53,7 +53,7 @@ def run_vlan(test, params, env): |
return session.cmd_status(rem_vlan_cmd % (iface, iface)) |
def nc_transfer(src, dst): |
- nc_port = kvm_utils.find_free_port(1025, 5334, vm_ip[dst]) |
+ nc_port = virt_utils.find_free_port(1025, 5334, vm_ip[dst]) |
listen_cmd = params.get("listen_cmd") |
send_cmd = params.get("send_cmd") |
@@ -66,7 +66,7 @@ def run_vlan(test, params, env): |
session[src].cmd(send_cmd, timeout=60) |
try: |
session[dst].read_up_to_prompt(timeout=60) |
- except kvm_subprocess.ExpectError: |
+ except aexpect.ExpectError: |
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 |
@@ -87,7 +87,7 @@ def run_vlan(test, params, env): |
raise error.TestError("Could not log into guest(vm%d)" % i) |
logging.info("Logged in") |
- ifname.append(kvm_test_utils.get_linux_ifname(session[i], |
+ ifname.append(virt_test_utils.get_linux_ifname(session[i], |
vm[i].get_mac_address())) |
#get guest ip |
vm_ip.append(vm[i].get_address()) |
@@ -122,7 +122,7 @@ def run_vlan(test, params, env): |
for i in range(2): |
interface = ifname[i] + '.' + str(vlan) |
dest = subnet +'.'+ str(vlan2)+ '.' + ip_unit[(i+1)%2] |
- s, o = kvm_test_utils.ping(dest, count=2, |
+ s, o = virt_test_utils.ping(dest, count=2, |
interface=interface, |
session=session[i], timeout=30) |
if ((vlan == vlan2) ^ (s == 0)): |
@@ -134,11 +134,11 @@ def run_vlan(test, params, env): |
logging.info("Flood ping") |
def flood_ping(src, dst): |
- # we must use a dedicated session becuase the kvm_subprocess |
+ # we must use a dedicated session becuase the aexpect |
# does not have the other method to interrupt the process in |
# the guest rather than close the session. |
session_flood = vm[src].wait_for_login(timeout=60) |
- kvm_test_utils.ping(vlan_ip[dst], flood=True, |
+ virt_test_utils.ping(vlan_ip[dst], flood=True, |
interface=ifname[src], |
session=session_flood, timeout=10) |
session_flood.close() |