forked from openstack/neutron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fullstack: Don't let dhcp agents failover
It turned out dhcp tests work only because agents are considered dead after 10 seconds while they report to server every 60 seconds. This led to calling network resync after agent revival and hiding the fact dhcp agent is not capable of receiving any amqp messages. This patch sets the report interval of agents to the half of agent_down_time on server side and uses eventlet dhcp agent in order to trigger eventlet monkey patching code. Eventlet was behind the failure with messages not getting processed. As [1] notes: "Note: If the “eventlet” executor is used, the threading and time library need to be monkeypatched." Because each port calls dhclient to obtain IP address and each dhclient instance overwrites /etc/resolv.conf there was added a script that generates fullstack-dhclient-script from an existing dhclient-script before starting fulltstack tests. This generated script is passed to each dhclient process running in fake fullstack machine using -sf parameter. [1] https://docs.openstack.org/developer/oslo.messaging/server.html Related-bug: 1453350 Change-Id: I0336176b9c364fe3a95be5cef9e7a3af1ef9d7e9
- Loading branch information
Showing
9 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
MAKE_RESOLV_CONF_FUNCTION=make_resolv_conf | ||
|
||
USAGE="$0 <path to virtual environment to place executable> | ||
The script takes existing dhclient-script and makes $MAKE_RESOLV_CONF_FUNCTION function a noop function. | ||
" | ||
|
||
if [ $# -lt 1 ]; then | ||
echo "Path to virtual environment directory is a required parameter." | ||
echo $USAGE | ||
exit 2 | ||
fi | ||
|
||
VENV_DIR=$1 | ||
DHCLIENT_SCRIPT_NAME=dhclient-script | ||
DHCLIENT_PATH=$(which $DHCLIENT_SCRIPT_NAME) | ||
FULLSTACK_DHCLIENT_SCRIPT=$VENV_DIR/bin/fullstack-dhclient-script | ||
|
||
if [ -n "$DHCLIENT_PATH" ]; then | ||
# Return from make_resolv_conf function immediately. This will cause | ||
# that /etc/resolv.conf will not be updated by fake fullstack machines. | ||
sed "/^$MAKE_RESOLV_CONF_FUNCTION()/a\ return" $DHCLIENT_PATH > $FULLSTACK_DHCLIENT_SCRIPT | ||
chmod +x $FULLSTACK_DHCLIENT_SCRIPT | ||
else | ||
echo "$DHCLIENT_SCRIPT_NAME not found." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters