[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 02/14] KVM Test: Add a function get_interfac
From: |
Lucas Meneghel Rodrigues |
Subject: |
Re: [Qemu-devel] [RFC PATCH 02/14] KVM Test: Add a function get_interface_name() to kvm_net_utils.py |
Date: |
Mon, 26 Jul 2010 23:08:55 -0300 |
On Tue, 2010-07-20 at 09:35 +0800, Amos Kong wrote:
> The function get_interface_name is used to get the interface name of linux
> guest through the macaddress of specified macaddress.
I wonder if it wouldn't be overkill to have separate utility libraries
on the kvm test instead of a single kvm_utils and kvm_test_utils like
you are proposing. Any thoughts Michael?
> Signed-off-by: Jason Wang <address@hidden>
> Signed-off-by: Amos Kong <address@hidden>
> ---
> 0 files changed, 0 insertions(+), 0 deletions(-)
>
> diff --git a/client/tests/kvm/kvm_net_utils.py
> b/client/tests/kvm/kvm_net_utils.py
> new file mode 100644
> index 0000000..ede4965
> --- /dev/null
> +++ b/client/tests/kvm/kvm_net_utils.py
> @@ -0,0 +1,18 @@
> +import re
> +
> +def get_linux_ifname(session, mac_address):
> + """
> + Get the interface name through the mac address.
> +
> + @param session: session to the virtual machine
> + @mac_address: the macaddress of nic
> + """
> +
> + output = session.get_command_output("ifconfig -a")
> +
> + try:
> + ethname = re.findall("(\w+)\s+Link.*%s" % mac_address, output,
> + re.IGNORECASE)[0]
> + return ethname
> + except:
> + return None
>
>
[Qemu-devel] [RFC PATCH 04/14] KVM-test: Add a new subtest ping, Amos Kong, 2010/07/19
[Qemu-devel] [RFC PATCH 05/14] KVM-test: Add a subtest jumbo, Amos Kong, 2010/07/19
[Qemu-devel] [RFC PATCH 06/14] KVM-test: Add basic file transfer test, Amos Kong, 2010/07/19