aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/scripts
diff options
context:
space:
mode:
authorselias <samelias@cisco.com>2017-05-26 14:51:50 +0200
committerSamuel Eliáš <samelias@cisco.com>2017-06-30 11:05:53 +0000
commitd32194f3afb0ec725d178effe6ae589571287602 (patch)
tree285fca263e6208c86b81f1202c99dcd0982b9781 /resources/tools/scripts
parent4a946c16a4935e52b3e9039e4661813c256a8934 (diff)
CSIT-619 HC Test: Honeycomb performance testing - initial commit
- keywords and scripts for HC performance testing setup - basic performance suite: operational data read - traffic script and keywords used in tests Change-Id: Ic0290be73a7c925ea2561f8cd2524c5cb83fcda2 Signed-off-by: selias <samelias@cisco.com>
Diffstat (limited to 'resources/tools/scripts')
-rwxr-xr-xresources/tools/scripts/download_hc_pkgs.sh6
-rwxr-xr-xresources/tools/scripts/topo_installation.py78
2 files changed, 53 insertions, 31 deletions
diff --git a/resources/tools/scripts/download_hc_pkgs.sh b/resources/tools/scripts/download_hc_pkgs.sh
index 23e0be4b16..1bda02505c 100755
--- a/resources/tools/scripts/download_hc_pkgs.sh
+++ b/resources/tools/scripts/download_hc_pkgs.sh
@@ -30,19 +30,19 @@ if [ "${OS}" == "ubuntu1404" ]; then
OS="ubuntu.trusty.main"
PACKAGE="deb deb.md5"
CLASS="deb"
- VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-lib vpp-plugins vpp-api-java"
+ VPP_ARTIFACTS="vpp vpp-dbg vpp-lib vpp-plugins"
DPDK_ARTIFACTS="vpp-dpdk-dkms"
elif [ "${OS}" == "ubuntu1604" ]; then
OS="ubuntu.xenial.main"
PACKAGE="deb deb.md5"
CLASS="deb"
- VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-lib vpp-plugins vpp-api-java"
+ VPP_ARTIFACTS="vpp vpp-dbg vpp-lib vpp-plugins"
DPDK_ARTIFACTS="vpp-dpdk-dkms"
elif [ "${OS}" == "centos7" ]; then
OS="centos7"
PACKAGE="rpm rpm.md5"
CLASS=""
- VPP_ARTIFACTS="vpp vpp-debuginfo vpp-devel vpp-lib vpp-plugins vpp-api-java"
+ VPP_ARTIFACTS="vpp vpp-debuginfo vpp-lib vpp-plugins"
DPDK_ARTIFACTS=""
fi
diff --git a/resources/tools/scripts/topo_installation.py b/resources/tools/scripts/topo_installation.py
index 0488bdae69..5c91abbd0f 100755
--- a/resources/tools/scripts/topo_installation.py
+++ b/resources/tools/scripts/topo_installation.py
@@ -85,15 +85,34 @@ def main():
help="Packages paths to copy")
parser.add_argument("-c", "--cancel", help="Cancel installation",
action="store_true")
+ parser.add_argument("-hc", "--honeycomb", help="Include Honeycomb package.",
+ required=False, default=False)
+
args = parser.parse_args()
topology_file = args.topo
packages = args.packages
install_dir = args.directory
cancel_installation = args.cancel
+ honeycomb = args.honeycomb
work_file = open(topology_file)
topology = load(work_file.read())['nodes']
+ def fix_interrupted(package):
+ """If there are interrupted installations, clean them up."""
+
+ cmd = "dpkg -l | grep {0}".format(package)
+ ret, _, _ = ssh.exec_command(cmd)
+ if ret == 0:
+ # Try to fix interrupted installations
+ cmd = 'dpkg --configure -a'
+ stdout = ssh_no_error(ssh, cmd, sudo=True)
+ print "###TI {}".format(stdout)
+ # Try to remove installed packages
+ cmd = 'apt-get purge -y "{0}.*"'.format(package)
+ stdout = ssh_no_error(ssh, cmd, sudo=True)
+ print "###TI {}".format(stdout)
+
ssh = SSH()
for node in topology:
if topology[node]['type'] == "DUT":
@@ -106,41 +125,44 @@ def main():
stdout = ssh_ignore_error(ssh, cmd)
print "###TI {}".format(stdout)
- cmd = "dpkg -l | grep vpp"
- ret, _, _ = ssh.exec_command(cmd)
- if ret == 0:
- # Try to fix interrupted installations
- cmd = 'dpkg --configure -a'
- stdout = ssh_no_error(ssh, cmd, sudo=True)
- print "###TI {}".format(stdout)
- # Try to remove installed vpp.* packages
- cmd = 'apt-get purge -y "vpp.*"'
- stdout = ssh_no_error(ssh, cmd, sudo=True)
+ if honeycomb:
+ fix_interrupted("honeycomb")
+ # remove HC logs
+ cmd = "rm -rf /var/log/honeycomb"
+ stdout = ssh_ignore_error(ssh, cmd, sudo=True)
print "###TI {}".format(stdout)
+ fix_interrupted("vpp")
+
else:
# Create installation directory on DUT
cmd = "rm -r {0}; mkdir {0}".format(install_dir)
stdout = ssh_no_error(ssh, cmd)
print "###TI {}".format(stdout)
- # Copy packages from local path to installation dir
- for deb in packages:
- print "###TI scp: {}".format(deb)
- ssh.scp(local_path=deb, remote_path=install_dir)
-
- cmd = "dpkg -l | grep vpp"
- ret, _, _ = ssh.exec_command(cmd)
- if ret == 0:
- # Try to fix interrupted installations
- cmd = 'dpkg --configure -a'
- stdout = ssh_no_error(ssh, cmd, sudo=True)
- print "###TI {}".format(stdout)
- # Try to remove installed vpp.* packages
- cmd = 'apt-get purge -y "vpp.*"'
- stdout = ssh_no_error(ssh, cmd, sudo=True)
- print "###TI {}".format(stdout)
-
- # Installation of VPP deb packages
+ if honeycomb:
+ smd = "ls ~/honeycomb | grep .deb"
+ stdout = ssh_ignore_error(ssh, smd)
+ if "honeycomb" in stdout:
+ # If custom honeycomb packages exist, use them
+ cmd = "cp ~/honeycomb/*.deb {0}".format(install_dir)
+ stdout = ssh_no_error(ssh, cmd)
+ print "###TI {}".format(stdout)
+ else:
+ # Copy packages from local path to installation dir
+ for deb in packages:
+ print "###TI scp: {}".format(deb)
+ ssh.scp(local_path=deb, remote_path=install_dir)
+ else:
+ # Copy packages from local path to installation dir
+ for deb in packages:
+ print "###TI scp: {}".format(deb)
+ ssh.scp(local_path=deb, remote_path=install_dir)
+
+ if honeycomb:
+ fix_interrupted("honeycomb")
+ fix_interrupted("vpp")
+
+ # Installation of deb packages
cmd = "dpkg -i --force-all {}/*.deb".format(install_dir)
stdout = ssh_no_error(ssh, cmd, sudo=True)
print "###TI {}".format(stdout)