Added VM2VM test between different routers in 2 projects
Added the test:
VM to VM test in different projects, different networks,
different routers, measure by Floating IPs (common floating net):
* a separate project is created, admin user is added to it
* VMs are in separate projects (admin and newly created),
separate networks, each project has its own router.
VMs have access to each other only by the common floating net.
* VMs are created on the same and different compute nodes.
* Verification is done via Floating IPs in 1 and multiple threads.
Other enhancements:
* renamed "tenant" variables and values to "project"
* more detailed logging (e.g. in which project resource is created)
* some refactoring
* fixed picking existing spt flavor if any
* check the project is empty before deleting it
* added stderr, stdout in case Internet is absent at VM and iperf
was not installed
Related-PROD: PROD-36943
Change-Id: I165ed41259336e586ad16ed9eb27ea59619db4c8
diff --git a/utils/ssh.py b/utils/ssh.py
index abbd89f..e9e5f3a 100644
--- a/utils/ssh.py
+++ b/utils/ssh.py
@@ -204,13 +204,14 @@
home_ubuntu = "/home/ubuntu/"
transport.put_iperf3_deb_packages_at_vms(path_to_iperf_deb,
home_ubuntu)
- transport.exec_command('sudo dpkg -i {}*.deb'.format(home_ubuntu))
+ exit_status, stdout, stderr = transport.exec_sync(
+ 'sudo dpkg -i {}*.deb'.format(home_ubuntu))
else:
logger.info("Installing iperf, iperf3 using apt")
preparation_cmd = config.get('iperf_prep_string') or ['']
transport.exec_command(preparation_cmd)
- transport.exec_command('sudo apt-get update;'
- 'sudo apt-get install -y iperf3 iperf')
+ exit_status, stdout, stderr = transport.exec_sync(
+ 'sudo apt-get update && sudo apt-get install -y iperf3 iperf')
# Log whether iperf is installed with version
check = transport.exec_command('dpkg -l | grep ii | grep iperf3')
@@ -221,8 +222,9 @@
else:
info = "Could not put offline iperf packages from {} to the " \
"VM.".format(path_to_iperf_deb)
- raise BaseException("iperf3 is not installed at VM with FIP {}. {}"
- "".format(fip, info))
+ raise BaseException("iperf3 is not installed at VM with FIP {}. "
+ "{}.\nStdout, stderr at VM:\n{}\n{}"
+ "".format(fip, info, stdout, stderr))
# Staring iperf server
transport.exec_command('nohup iperf3 -s > file 2>&1 &')
transport.exec_command('nohup iperf -s > file 2>&1 &')