Skip to content

Commit 203b02f

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Reserve keystone admin ports in test executions"
2 parents a7415d4 + 2107534 commit 203b02f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

run_tests.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,20 @@ if [ $(id -u) != 0 ]; then
109109
$SUDO service sshd restart
110110
fi
111111

112+
# Sometimes keystone admin port is used as ephemeral port for other connections and gate jobs fail with httpd error 'Address already in use'.
113+
# We reserve port 35357 at the beginning of the job execution to mitigate this issue as much as possible.
114+
# Similar hack is done in devstack https://github.com/openstack-dev/devstack/blob/master/tools/fixup_stuff.sh#L53-L68
115+
116+
# Get any currently reserved ports, strip off leading whitespace
117+
keystone_port=35357
118+
reserved_ports=$(sysctl net.ipv4.ip_local_reserved_ports | awk -F'=' '{print $2;}' | sed 's/^ //')
119+
120+
if [[ -z "${reserved_ports}" ]]; then
121+
$SUDO sysctl -w net.ipv4.ip_local_reserved_ports=${keystone_port}
122+
else
123+
$SUDO sysctl -w net.ipv4.ip_local_reserved_ports=${keystone_port},${reserved_ports}
124+
fi
125+
112126
# TODO: REMOVE ME
113127
# https://github.com/openstack/diskimage-builder/blob/b5bcb3b60ec33c4538baa1aeacd026998b155ca6/elements/yum-minimal/pre-install.d/03-yum-cleanup#L26
114128
$SUDO yum -y reinstall glibc-common

0 commit comments

Comments
 (0)