Enable overcommit_memory in test server VMs
Enable memory overcommit in server VMs to fix an allocation error when
using static binaries that have been compiled with a recent golang
toolchain (>= 1.11).
Story: 2006346
Task: 36103
Change-Id: I1e5979b4e49492c9a84f936681214deac556d856
diff --git a/octavia_tempest_plugin/tests/test_base.py b/octavia_tempest_plugin/tests/test_base.py
index 2e46812..1633685 100644
--- a/octavia_tempest_plugin/tests/test_base.py
+++ b/octavia_tempest_plugin/tests/test_base.py
@@ -805,6 +805,17 @@
if proc.returncode != 0:
raise exceptions.CommandFailed(proc.returncode, cmd,
stdout, stderr)
+
+ # Enabling memory overcommit allows to run golang static binaries
+ # compiled with a recent golang toolchain (>=1.11). Those binaries
+ # allocate a large amount of virtual memory at init time, and this
+ # allocation fails in tempest's nano flavor (64MB of RAM)
+ # (golang issue reported in https://github.com/golang/go/issues/28114,
+ # follow-up: https://github.com/golang/go/issues/28081)
+ # TODO(gthiemonge): Remove this call when golang issue is resolved.
+ linux_client.exec_command('sudo sh -c "echo 1 > '
+ '/proc/sys/vm/overcommit_memory"')
+
linux_client.exec_command('sudo screen -d -m {0} -port 80 '
'-id {1}'.format(dest_file, start_id))
linux_client.exec_command('sudo screen -d -m {0} -port 81 '