Build the Go test server on devstack test-config
Every time we update the Go test server code, we have to re-compile it locally and commit the binary file. Git is not great for binary blobs. One other reason that carrying the binary in-tree is suboptimal is it is compiled against amd64 architecture, thus not much multi-arch friendly. This change drops the need to compile and carry the test server binary file in the Git tree. The test server will now be compiled at devstack test-config phase. On my work station, it takes less than 6 seconds. Change-Id: I3d8ad18ddd1f23720618d733a9d8a53a6b4e6dfc
This commit is contained in:
parent
3bc1f4decd
commit
f077c3a5d6
|
@ -1,14 +1,49 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
saveenv=$-
|
||||||
|
set -e
|
||||||
|
|
||||||
# install_octavia_tempest_plugin
|
# install_octavia_tempest_plugin
|
||||||
function install_octavia_tempest_plugin {
|
function install_octavia_tempest_plugin {
|
||||||
setup_dev_lib "octavia-tempest-plugin"
|
setup_dev_lib "octavia-tempest-plugin"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function build_backend_test_server {
|
||||||
|
if is_fedora || is_ubuntu; then
|
||||||
|
install_package golang
|
||||||
|
else
|
||||||
|
die "Distribution not supported. Supported distributions are: RHEL, CentOS, Fedora, Ubuntu"
|
||||||
|
fi
|
||||||
|
|
||||||
|
go_path=$(find $DEST/tempest/.tox/tempest/ -name test_server.go)
|
||||||
|
bin_path=${go_path%.go}.bin
|
||||||
|
CGO_ENABLED=0 GOOS=linux go build \
|
||||||
|
-a -ldflags '-s -w -extldflags -static' -o $bin_path \
|
||||||
|
${DEST}/octavia-tempest-plugin/octavia_tempest_plugin/contrib/test_server/test_server.go
|
||||||
|
}
|
||||||
|
|
||||||
if [[ "$1" == "stack" ]]; then
|
if [[ "$1" == "stack" ]]; then
|
||||||
case "$2" in
|
case "$2" in
|
||||||
install)
|
install)
|
||||||
echo_summary "Installing octavia-tempest-plugin"
|
# Install dev library if
|
||||||
install_octavia_tempest_plugin
|
# - the release is more recent than stein (devstack in stein would
|
||||||
|
# try to install it in a python2 env, but octavia-tempest-plugin is
|
||||||
|
# now a python3-only project)
|
||||||
|
# - or the user explicitly requests it (INSTALL_TEMPEST=True)
|
||||||
|
if [[ "$DEVSTACK_SERIES" != "stein" ]] || [[ "$(trueorfalse False INSTALL_TEMPEST)" == "True" ]]; then
|
||||||
|
echo_summary "Installing octavia-tempest-plugin"
|
||||||
|
install_octavia_tempest_plugin
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
test-config)
|
||||||
|
echo_summary "Building backend test server"
|
||||||
|
build_backend_test_server
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $saveenv =~ e ]]; then
|
||||||
|
set -e
|
||||||
|
else
|
||||||
|
set +e
|
||||||
|
fi
|
||||||
|
|
|
@ -16,14 +16,11 @@ Install dependencies for Ubuntu/Debian:
|
||||||
|
|
||||||
sudo apt-get install -y golang
|
sudo apt-get install -y golang
|
||||||
|
|
||||||
Install dependencies for Centos (use golang 1.10 from go-toolset-7) and launch
|
Install dependencies for Centos:
|
||||||
a shell into the new environment:
|
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo yum install -y centos-release-scl
|
sudo dnf install -y golang
|
||||||
sudo yum install -y go-toolset-7-golang-bin glibc-static openssl-static zlib-static
|
|
||||||
scl enable go-toolset-7 bash
|
|
||||||
|
|
||||||
Build the binary:
|
Build the binary:
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -80,7 +80,6 @@
|
||||||
vars:
|
vars:
|
||||||
configure_swap_size: 8192
|
configure_swap_size: 8192
|
||||||
devstack_localrc:
|
devstack_localrc:
|
||||||
TEMPEST_PLUGINS: /opt/stack/octavia-tempest-plugin
|
|
||||||
USE_PYTHON3: true
|
USE_PYTHON3: true
|
||||||
LIBVIRT_TYPE: kvm
|
LIBVIRT_TYPE: kvm
|
||||||
LIBVIRT_CPU_MODE: host-passthrough
|
LIBVIRT_CPU_MODE: host-passthrough
|
||||||
|
@ -115,6 +114,9 @@
|
||||||
tempest: true
|
tempest: true
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
octavia: https://opendev.org/openstack/octavia.git
|
octavia: https://opendev.org/openstack/octavia.git
|
||||||
|
octavia-tempest-plugin: https://opendev.org/openstack/octavia-tempest-plugin.git
|
||||||
|
tempest_plugins:
|
||||||
|
- octavia-tempest-plugin
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: octavia-dsvm-base-ipv6-only
|
name: octavia-dsvm-base-ipv6-only
|
||||||
|
@ -134,7 +136,6 @@
|
||||||
- ^releasenotes/.*$
|
- ^releasenotes/.*$
|
||||||
vars:
|
vars:
|
||||||
devstack_localrc:
|
devstack_localrc:
|
||||||
TEMPEST_PLUGINS: /opt/stack/octavia-tempest-plugin
|
|
||||||
USE_PYTHON3: true
|
USE_PYTHON3: true
|
||||||
LIBVIRT_TYPE: kvm
|
LIBVIRT_TYPE: kvm
|
||||||
LIBVIRT_CPU_MODE: host-passthrough
|
LIBVIRT_CPU_MODE: host-passthrough
|
||||||
|
@ -169,6 +170,9 @@
|
||||||
tempest: true
|
tempest: true
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
octavia: https://opendev.org/openstack/octavia.git
|
octavia: https://opendev.org/openstack/octavia.git
|
||||||
|
octavia-tempest-plugin: https://opendev.org/openstack/octavia-tempest-plugin.git
|
||||||
|
tempest_plugins:
|
||||||
|
- octavia-tempest-plugin
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: octavia-dsvm-live-base
|
name: octavia-dsvm-live-base
|
||||||
|
@ -270,7 +274,6 @@
|
||||||
MULTI_HOST: 1
|
MULTI_HOST: 1
|
||||||
SERVICE_HOST: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
|
SERVICE_HOST: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
|
||||||
HOST_IP: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
|
HOST_IP: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
|
||||||
TEMPEST_PLUGINS: /opt/stack/octavia-tempest-plugin
|
|
||||||
USE_PYTHON3: true
|
USE_PYTHON3: true
|
||||||
LIBVIRT_TYPE: kvm
|
LIBVIRT_TYPE: kvm
|
||||||
LIBVIRT_CPU_MODE: host-passthrough
|
LIBVIRT_CPU_MODE: host-passthrough
|
||||||
|
@ -283,6 +286,9 @@
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
neutron: https://opendev.org/openstack/neutron.git
|
neutron: https://opendev.org/openstack/neutron.git
|
||||||
octavia: https://opendev.org/openstack/octavia.git
|
octavia: https://opendev.org/openstack/octavia.git
|
||||||
|
octavia-tempest-plugin: https://opendev.org/openstack/octavia-tempest-plugin.git
|
||||||
|
tempest_plugins:
|
||||||
|
- octavia-tempest-plugin
|
||||||
zuul_copy_output:
|
zuul_copy_output:
|
||||||
'/var/log/dib-build' : logs
|
'/var/log/dib-build' : logs
|
||||||
'/var/log/octavia-amphora.log': logs
|
'/var/log/octavia-amphora.log': logs
|
||||||
|
@ -323,6 +329,9 @@
|
||||||
OCTAVIA_MGMT_PORT_IP: 192.168.0.4
|
OCTAVIA_MGMT_PORT_IP: 192.168.0.4
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
octavia: https://opendev.org/openstack/octavia.git
|
octavia: https://opendev.org/openstack/octavia.git
|
||||||
|
octavia-tempest-plugin: https://opendev.org/openstack/octavia-tempest-plugin.git
|
||||||
|
tempest_plugins:
|
||||||
|
- octavia-tempest-plugin
|
||||||
zuul_copy_output:
|
zuul_copy_output:
|
||||||
'/var/log/octavia-amphora.log': logs
|
'/var/log/octavia-amphora.log': logs
|
||||||
'/var/log/octavia-tenant-traffic.log': logs
|
'/var/log/octavia-tenant-traffic.log': logs
|
||||||
|
@ -648,8 +657,9 @@
|
||||||
barbican: true
|
barbican: true
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
barbican: https://opendev.org/openstack/barbican.git
|
barbican: https://opendev.org/openstack/barbican.git
|
||||||
devstack_localrc:
|
tempest_plugins:
|
||||||
TEMPEST_PLUGINS: '"/opt/stack/octavia-tempest-plugin /opt/stack/barbican-tempest-plugin"'
|
- octavia-tempest-plugin
|
||||||
|
- barbican-tempest-plugin
|
||||||
irrelevant-files:
|
irrelevant-files:
|
||||||
- ^.*\.rst$
|
- ^.*\.rst$
|
||||||
- ^api-ref/.*$
|
- ^api-ref/.*$
|
||||||
|
|
Loading…
Reference in New Issue