avocado-framework / avocado-vt

Avocado VT Plugin
https://avocado-vt.readthedocs.org/
Other
83 stars 242 forks source link

Wrong check for free port. #557

Open Andrei-Stepanov opened 8 years ago

Andrei-Stepanov commented 8 years ago

We have a bunch of very serious bugs. Through virttest we ask for available port with next command:

utils_misc.find_free_port(*port_range)

This return a free port on "localhost"

This command doesn't take in to account next values:

host_ip_addr / netdst get_host_ip_address see : avocado-vt/virttest/utils_net.py

The problem is that we test for FREE port at localhost at: https://github.com/avocado-framework/avocado-vt/blob/master/virttest/qemu_vm.py#L930

But, bind to https://github.com/avocado-framework/avocado-vt/blob/master/virttest/qemu_vm.py#L944 so.. they are two different interfaces ....

We need to ask for free port on interface where we want to bind.

xutian commented 8 years ago

How about change default host address from 'localhost' to '0.0.0.0'

Andrei-Stepanov commented 8 years ago

Hi. I don't think so. In my case I set listening_addr = to nothing. Just do not specify address to listen on. But, if we specify specific address then qemu_vm.py can fail.