On 03/13/2012 06:56 AM, [email protected] wrote:
> From: Lei Yang<[email protected]>
>
> if the guest has dhclient process running, it will cause "dhclient(617) is
> already running - exiting"
> so before we run dhclient, we should kill it first.
> Signed-off-by: Lei Yang<[email protected]>
> ---
> client/tests/kvm/tests/nic_bonding.py | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/client/tests/kvm/tests/nic_bonding.py
> b/client/tests/kvm/tests/nic_bonding.py
> index 6266058..af3dd87 100644
> --- a/client/tests/kvm/tests/nic_bonding.py
> +++ b/client/tests/kvm/tests/nic_bonding.py
> @@ -36,6 +36,7 @@ def run_nic_bonding(test, params, env):
> for vlan, nic in enumerate(params.get("nics").split())]
> setup_cmd = "ifenslave bond0 " + " ".join(ifnames)
> session_serial.cmd(setup_cmd)
> + session_serial.sendline("kill -9 `pgrep dhclient`")
^ Wouldn't it be better to check whether dhclient is actually running
before trying to kill it? Or, calling .cmd rather than sendline, and
handling the possible aexpect.ShellCmdError that might happen in case
there's no dhclient process available? Actually, my later suggestion
seems better than the former :)
> session_serial.cmd("dhclient bond0")
>
> try:
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest