Install test_server.bin in well known location

This patch installs and uses test_server.bin from
/opt/octavia-tempest-plugin as a well known location on the
filesystem. This way tests, like grenade, that run the devstack
plugins once in /old paths, can find the binary when running from
/new paths.

Change-Id: Ia78f16fde026269dec01f4dceb202842ad12a557
This commit is contained in:
Michael Johnson 2020-11-13 13:55:09 -08:00
parent d5efbb16f7
commit 2735735e64
3 changed files with 9 additions and 5 deletions

View File

@ -16,9 +16,11 @@ function build_backend_test_server {
fi
go_path=$(find $DEST/tempest/.tox/tempest/ -name test_server.go)
bin_path=${go_path%.go}.bin
sudo mkdir -m755 -p /opt/octavia-tempest-plugin
sudo chown $STACK_USER /opt/octavia-tempest-plugin
CGO_ENABLED=0 GOOS=linux go build \
-a -ldflags '-s -w -extldflags -static' -o $bin_path \
-a -ldflags '-s -w -extldflags -static' \
-o /opt/octavia-tempest-plugin/test_server.bin \
${DEST}/octavia-tempest-plugin/octavia_tempest_plugin/contrib/test_server/test_server.go
}

View File

@ -213,6 +213,10 @@ OctaviaGroup = [
default='/var/log/octavia-amphora.log',
help='File path, on the tempest system, to the amphora admin '
'log file.'),
cfg.StrOpt('test_server_path',
default='/opt/octavia-tempest-plugin/test_server.bin',
help='Filesystem path to the test web server that will be '
'installed in the web server VMs.'),
]
lb_feature_enabled_group = cfg.OptGroup(name='loadbalancer-feature-enabled',

View File

@ -13,7 +13,6 @@
# under the License.
import ipaddress
import pkg_resources
import random
import shlex
import string
@ -849,8 +848,7 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
@classmethod
def _install_start_webserver(cls, ip_address, ssh_key, start_id):
local_file = pkg_resources.resource_filename(
'octavia_tempest_plugin.contrib.test_server', 'test_server.bin')
local_file = CONF.load_balancer.test_server_path
dest_file = '/dev/shm/test_server.bin'
linux_client = remote_client.RemoteClient(