Disable dhcpcd in test_port_security_macspoofing_port
Cirros 0.6.0+ switched to dhcpcd and dhcpcd by default it configures all the interfaces. In port_security_macspoofing_port test we spoof mac address and re assign ip address, but dhcpcd interfares with it and causes issues. Let's disable dhcpcd before reconfiguring the interface. Closes-Bug: #2008062 Change-Id: I75cf0477ae4195121c87bde6d276fa51c3d094aa
This commit is contained in:
parent
b7c55ad0d8
commit
629da89055
@ -898,10 +898,13 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest):
|
||||
nic=spoof_nic, should_succeed=True)
|
||||
# Set a mac address by making nic down temporary
|
||||
spoof_ip_addresses = ssh_client.get_nic_ip_addresses(spoof_nic)
|
||||
cmd = ("sudo ip link set {nic} down;"
|
||||
dhcp_cmd = ("sudo start-stop-daemon -K -x /sbin/dhcpcd -p "
|
||||
"/var/run/dhcpcd/pid -o || true")
|
||||
cmd = ("{dhcp_cmd}; sudo ip link set {nic} down;"
|
||||
"sudo ip link set dev {nic} address {mac};"
|
||||
"sudo ip link set {nic} up;"
|
||||
"sudo ip address flush dev {nic};").format(nic=spoof_nic,
|
||||
dhcp_cmd=dhcp_cmd,
|
||||
mac=spoof_mac)
|
||||
for ip_address in spoof_ip_addresses:
|
||||
cmd += (
|
||||
|
Loading…
x
Reference in New Issue
Block a user