CSIT-1407 FIX vpp install after VPP changes 80/16980/14
authorPeter Mikus <pmikus@cisco.com>
Tue, 22 Jan 2019 15:31:56 +0000 (15:31 +0000)
committerJan Gelety <jgelety@cisco.com>
Thu, 24 Jan 2019 15:50:56 +0000 (16:50 +0100)
Change-Id: I9148f6de75c3100f827eedec48c4c0ccb343bc54
Signed-off-by: Peter Mikus <pmikus@cisco.com>
VPP_STABLE_VER_CENTOS
VPP_STABLE_VER_UBUNTU
VPP_STABLE_VER_UBUNTU_BIONIC
bootstrap.sh
resources/libraries/bash/dut_setup.sh
resources/libraries/bash/function/artifacts.sh
resources/libraries/python/DUTSetup.py
resources/tools/papi/vpp_papi_provider.py
tests/vpp/device/__init__.robot
tests/vpp/func/__init__.robot
tests/vpp/perf/__init__.robot

index 494ee6e..e2c6beb 100644 (file)
@@ -1 +1 @@
-19.04-rc0~21_g36eb7c2~b5964
\ No newline at end of file
+19.04-rc0~67_g72de626~b6010
\ No newline at end of file
index 49e0227..e8d6983 100644 (file)
@@ -1 +1 @@
-19.04-rc0~21-g36eb7c2~b6151
\ No newline at end of file
+19.04-rc0~67-g72de626~b6198
\ No newline at end of file
index f78175b..f38b93c 100644 (file)
@@ -1 +1 @@
-19.04-rc0~21-g36eb7c21~b1904
\ No newline at end of file
+19.04-rc0~67-g72de626d~b1950
\ No newline at end of file
index 2d26bcc..62ca6d8 100755 (executable)
@@ -53,7 +53,7 @@ else
 fi
 
 VIRL_DIR_LOC="/tmp/"
 fi
 
 VIRL_DIR_LOC="/tmp/"
-VPP_PKGS=(vpp*.$PACKAGE)
+VPP_PKGS=(*vpp*.$PACKAGE)
 VPP_PKGS_FULL=("${VPP_PKGS[@]/#/${VIRL_DIR_LOC}}")
 echo ${VPP_PKGS[@]}
 
 VPP_PKGS_FULL=("${VPP_PKGS[@]/#/${VIRL_DIR_LOC}}")
 echo ${VPP_PKGS[@]}
 
index aee6386..d0b2fab 100755 (executable)
@@ -24,9 +24,9 @@ echo
 echo "[Command_desc] Starting ${0}"
 
 if [ -f "/etc/redhat-release" ]; then
 echo "[Command_desc] Starting ${0}"
 
 if [ -f "/etc/redhat-release" ]; then
-    cmd 'rpm -qai vpp*'
+    cmd 'rpm -qai *vpp*'
 else
 else
-    cmd 'dpkg -l vpp\*'
+    cmd 'dpkg -l | grep vpp'
 fi
 
 cmd 'ps aux | grep vpp'
 fi
 
 cmd 'ps aux | grep vpp'
index 6695b4d..b6b5bc5 100644 (file)
@@ -64,7 +64,8 @@ function download_ubuntu_artifacts () {
     }
     # If version is set we will add suffix.
     artifacts=()
     }
     # If version is set we will add suffix.
     artifacts=()
-    vpp=(vpp vpp-dbg vpp-dev vpp-lib vpp-plugins vpp-api-python)
+    vpp=(vpp vpp-dbg vpp-dev vpp-api-python libvppinfra libvppinfra-dev
+         vpp-plugin-core vpp-plugin-dpdk)
     if [ -z "${VPP_VERSION-}" ]; then
         artifacts+=(${vpp[@]})
     else
     if [ -z "${VPP_VERSION-}" ]; then
         artifacts+=(${vpp[@]})
     else
index 4fc0e6f..7a28e09 100644 (file)
@@ -33,7 +33,8 @@ class DUTSetup(object):
         :type service: str
         """
         if DUTSetup.running_in_container(node):
         :type service: str
         """
         if DUTSetup.running_in_container(node):
-            command = 'echo $(< /var/log/supervisord.log)'
+            command = ('echo $(< /var/log/supervisord.log);'
+                       'echo $(< /tmp/*supervisor*.log)')
         else:
             command = ('journalctl --no-pager --unit={name} '
                        '--since="$(echo `systemctl show -p '
         else:
             command = ('journalctl --no-pager --unit={name} '
                        '--since="$(echo `systemctl show -p '
@@ -595,73 +596,35 @@ class DUTSetup(object):
         exec_cmd_no_error(node, command, timeout=30, sudo=True, message=message)
 
     @staticmethod
         exec_cmd_no_error(node, command, timeout=30, sudo=True, message=message)
 
     @staticmethod
-    def install_vpp_on_all_duts(nodes, vpp_pkg_dir, vpp_rpm_pkgs, vpp_deb_pkgs):
+    def install_vpp_on_all_duts(nodes, vpp_pkg_dir):
         """Install VPP on all DUT nodes.
 
         :param nodes: Nodes in the topology.
         :param vpp_pkg_dir: Path to directory where VPP packages are stored.
         """Install VPP on all DUT nodes.
 
         :param nodes: Nodes in the topology.
         :param vpp_pkg_dir: Path to directory where VPP packages are stored.
-        :param vpp_rpm_pkgs: List of VPP rpm packages to be installed.
-        :param vpp_deb_pkgs: List of VPP deb packages to be installed.
         :type nodes: dict
         :type vpp_pkg_dir: str
         :type nodes: dict
         :type vpp_pkg_dir: str
-        :type vpp_rpm_pkgs: list
-        :type vpp_deb_pkgs: list
         :raises RuntimeError: If failed to remove or install VPP.
         """
         for node in nodes.values():
         :raises RuntimeError: If failed to remove or install VPP.
         """
         for node in nodes.values():
+            message='Failed to install VPP on {host}!'.format(host=node['host'])
             if node['type'] == NodeType.DUT:
             if node['type'] == NodeType.DUT:
-                logger.debug("Installing VPP on node {0}".format(node['host']))
-
-                ssh = SSH()
-                ssh.connect(node)
-
-                cmd = "[[ -f /etc/redhat-release ]]"
-                return_code, _, _ = ssh.exec_command(cmd)
-                if not int(return_code):
-                    # workaroud - uninstall existing vpp installation until
-                    # start-testcase script is updated on all virl servers
-                    rpm_pkgs_remove = "vpp*"
-                    cmd_u = 'yum -y remove "{0}"'.format(rpm_pkgs_remove)
-                    r_rcode, _, r_err = ssh.exec_command_sudo(cmd_u, timeout=90)
-                    if int(r_rcode):
-                        raise RuntimeError('Failed to remove previous VPP'
-                                           'installation on host {0}:\n{1}'
-                                           .format(node['host'], r_err))
-
-                    rpm_pkgs = "*.rpm ".join(str(vpp_pkg_dir + pkg)
-                                             for pkg in vpp_rpm_pkgs) + "*.rpm"
-                    cmd_i = "rpm -ivh {0}".format(rpm_pkgs)
-                    ret_code, _, err = ssh.exec_command_sudo(cmd_i, timeout=90)
-                    if int(ret_code):
-                        raise RuntimeError('Failed to install VPP on host {0}:'
-                                           '\n{1}'.format(node['host'], err))
-                    else:
-                        ssh.exec_command_sudo("rpm -qai vpp*")
-                        logger.info("VPP installed on node {0}".
-                                    format(node['host']))
+                command = '. /etc/lsb-release; echo "${DISTRIB_ID}"'
+                stdout, _ = exec_cmd_no_error(node, command)
+
+                if stdout.strip() == 'Ubuntu':
+                    exec_cmd_no_error(node, 'apt-get purge -y "*vpp*" || true',
+                                      timeout=120, sudo=True)
+                    exec_cmd_no_error(node, 'dpkg -i --force-all {dir}*.deb'.
+                        format(dir=vpp_pkg_dir), timeout=120, sudo=True,
+                        message=message)
+                    exec_cmd_no_error(node, 'dpkg -l | grep vpp', sudo=True)
                 else:
                 else:
-                    # workaroud - uninstall existing vpp installation until
-                    # start-testcase script is updated on all virl servers
-                    deb_pkgs_remove = "vpp*"
-                    cmd_u = 'apt-get purge -y "{0}"'.format(deb_pkgs_remove)
-                    r_rcode, _, r_err = ssh.exec_command_sudo(cmd_u, timeout=90)
-                    if int(r_rcode):
-                        raise RuntimeError('Failed to remove previous VPP'
-                                           'installation on host {0}:\n{1}'
-                                           .format(node['host'], r_err))
-                    deb_pkgs = "*.deb ".join(str(vpp_pkg_dir + pkg)
-                                             for pkg in vpp_deb_pkgs) + "*.deb"
-                    cmd_i = "dpkg -i --force-all {0}".format(deb_pkgs)
-                    ret_code, _, err = ssh.exec_command_sudo(cmd_i, timeout=90)
-                    if int(ret_code):
-                        raise RuntimeError('Failed to install VPP on host {0}:'
-                                           '\n{1}'.format(node['host'], err))
-                    else:
-                        ssh.exec_command_sudo("dpkg -l | grep vpp")
-                        logger.info("VPP installed on node {0}".
-                                    format(node['host']))
-
-                ssh.disconnect(node)
+                    exec_cmd_no_error(node, 'yum -y remove "*vpp*" || true',
+                                      timeout=120, sudo=True)
+                    exec_cmd_no_error(node, 'rpm -ivh {dir}*.rpm'.\
+                        format(dir=vpp_pkg_dir), timeout=120, sudo=True,
+                        message=message)
+                    exec_cmd_no_error(node, 'rpm -qai *vpp*', sudo=True)
 
     @staticmethod
     def running_in_container(node):
 
     @staticmethod
     def running_in_container(node):
index 69b1968..845cc93 100644 (file)
@@ -60,7 +60,7 @@ if do_import:
 CLIENT_NAME = 'csit_papi'
 
 
 CLIENT_NAME = 'csit_papi'
 
 
-def papi_init(vpp_json_dir='/usr/share/vpp/api/'):
+def papi_init():
     """Construct a VPP instance from VPP JSON API files.
 
     :param vpp_json_dir: Directory containing all the JSON API files. If VPP is
     """Construct a VPP instance from VPP JSON API files.
 
     :param vpp_json_dir: Directory containing all the JSON API files. If VPP is
@@ -71,18 +71,8 @@ def papi_init(vpp_json_dir='/usr/share/vpp/api/'):
     :raises PapiJsonFileError: If no api.json file found.
     :raises PapiInitError: If PAPI initialization failed.
     """
     :raises PapiJsonFileError: If no api.json file found.
     :raises PapiInitError: If PAPI initialization failed.
     """
-    # construct a list of all the json api files
-    jsonfiles = []
-    for root, dirnames, filenames in os.walk(vpp_json_dir):
-        for filename in fnmatch.filter(filenames, '*.api.json'):
-            jsonfiles.append(os.path.join(vpp_json_dir, filename))
-    if not jsonfiles:
-        raise PapiJsonFileError(
-            'No json api files found in location {dir}'.format(
-                dir=vpp_json_dir))
-
     try:
     try:
-        vpp = VPP(jsonfiles)
+        vpp = VPP()
         return vpp
     except Exception as err:
         raise PapiInitError('PAPI init failed:\n{exc}'.format(exc=repr(err)))
         return vpp
     except Exception as err:
         raise PapiInitError('PAPI init failed:\n{exc}'.format(exc=repr(err)))
@@ -191,9 +181,8 @@ def main():
                         help="Directory containing all vpp json api files.")
     args = parser.parse_args()
     json_string = args.json_data
                         help="Directory containing all vpp json api files.")
     args = parser.parse_args()
     json_string = args.json_data
-    vpp_json_dir = args.json_dir
 
 
-    vpp = papi_init(vpp_json_dir=vpp_json_dir)
+    vpp = papi_init()
 
     reply = list()
     json_data = json.loads(json_string)
 
     reply = list()
     json_data = json.loads(json_string)
index 8b0788c..bc13441 100644 (file)
@@ -21,7 +21,6 @@
 | Suite Setup | Run Keywords | Setup Global Variables
 | ... | AND | Setup Framework | ${nodes}
 | ... | AND | Install Vpp On All Duts | ${nodes} | ${packages_dir}
 | Suite Setup | Run Keywords | Setup Global Variables
 | ... | AND | Setup Framework | ${nodes}
 | ... | AND | Install Vpp On All Duts | ${nodes} | ${packages_dir}
-| ... | ${vpp_rpm_pkgs} | ${vpp_deb_pkgs}
 | ... | AND | Verify Vpp On All Duts | ${nodes}
 | ... | AND | Get CPU Layout from all nodes | ${nodes}
 | ... | AND | Update All Interface Data On All Nodes | ${nodes}
 | ... | AND | Verify Vpp On All Duts | ${nodes}
 | ... | AND | Get CPU Layout from all nodes | ${nodes}
 | ... | AND | Update All Interface Data On All Nodes | ${nodes}
@@ -46,9 +45,3 @@
 | | Set Global Variable | ${dut_stats} | ${True}
 | | Set Global Variable | ${vm_image} | /var/lib/vm/csit-nested-1.7.img
 | | Set Global Variable | ${packages_dir} | /tmp/openvpp-testing/download_dir/
 | | Set Global Variable | ${dut_stats} | ${True}
 | | Set Global Variable | ${vm_image} | /var/lib/vm/csit-nested-1.7.img
 | | Set Global Variable | ${packages_dir} | /tmp/openvpp-testing/download_dir/
-| | @{vpp_rpm_pkgs}= | Create List | vpp | vpp-devel | vpp-lib | vpp-plugins
-| | ... | vpp-api-python
-| | Set Global Variable | ${vpp_rpm_pkgs}
-| | @{vpp_deb_pkgs}= | Create List | vpp | vpp-dbg | vpp-dev | vpp-lib
-| | ... | vpp-plugins | vpp-api-python
-| | Set Global Variable | ${vpp_deb_pkgs}
\ No newline at end of file
index b074d0d..563d1ea 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2019 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -19,7 +19,6 @@
 | Suite Setup | Run Keywords | Setup Functional Global Variables
 | ... | AND | Setup Framework | ${nodes}
 | ... | AND | Install Vpp On All Duts | ${nodes} | ${VPP_PKG_DIR}
 | Suite Setup | Run Keywords | Setup Functional Global Variables
 | ... | AND | Setup Framework | ${nodes}
 | ... | AND | Install Vpp On All Duts | ${nodes} | ${VPP_PKG_DIR}
-| ... | ${VPP_RPM_PKGS} | ${VPP_DEB_PKGS}
 | ... | AND | Verify Vpp On All Duts | ${nodes}
 | ... | AND | Setup All DUTs | ${nodes}
 | ... | AND | Update All Interface Data On All Nodes | ${nodes}
 | ... | AND | Verify Vpp On All Duts | ${nodes}
 | ... | AND | Setup All DUTs | ${nodes}
 | ... | AND | Update All Interface Data On All Nodes | ${nodes}
@@ -34,9 +33,3 @@
 | | ... | - vpp_pkg_dir - Path to directory where VPP packages are stored.
 | | ...
 | | Set Global Variable | ${VPP_PKG_DIR} | /scratch/vpp/
 | | ... | - vpp_pkg_dir - Path to directory where VPP packages are stored.
 | | ...
 | | Set Global Variable | ${VPP_PKG_DIR} | /scratch/vpp/
-| | @{VPP_RPM_PKGS}= | Create List | vpp | vpp-devel | vpp-lib | vpp-plugins
-| | ... | vpp-api-python
-| | Set Global Variable | ${VPP_RPM_PKGS}
-| | @{VPP_DEB_PKGS}= | Create List | vpp | vpp-dbg | vpp-dev | vpp-lib
-| | ... | vpp-plugins | vpp-api-python
-| | Set Global Variable | ${VPP_DEB_PKGS}
index 0e24ecd..0fb4401 100644 (file)
@@ -20,7 +20,7 @@
 | Suite Setup | Run Keywords | Setup performance global Variables
 | ...         | AND          | Setup Framework | ${nodes}
 | ...         | AND          | Install Vpp On All Duts | ${nodes}
 | Suite Setup | Run Keywords | Setup performance global Variables
 | ...         | AND          | Setup Framework | ${nodes}
 | ...         | AND          | Install Vpp On All Duts | ${nodes}
-| ...         | ${packages_dir} | ${vpp_rpm_pkgs} | ${vpp_deb_pkgs}
+| ...         | ${packages_dir}
 | ...         | AND          | Verify Vpp On All Duts | ${nodes}
 | ...         | AND          | Verify UIO Driver on all DUTs | ${nodes}
 | ...         | AND          | Setup All DUTs | ${nodes}
 | ...         | AND          | Verify Vpp On All Duts | ${nodes}
 | ...         | AND          | Verify UIO Driver on all DUTs | ${nodes}
 | ...         | AND          | Setup All DUTs | ${nodes}
@@ -57,8 +57,3 @@
 | | @{plugins_to_enable}= | Create List | dpdk_plugin.so
 | | Set Global Variable | @{plugins_to_enable}
 | | Set Global Variable | ${packages_dir} | /tmp/openvpp-testing/download_dir/
 | | @{plugins_to_enable}= | Create List | dpdk_plugin.so
 | | Set Global Variable | @{plugins_to_enable}
 | | Set Global Variable | ${packages_dir} | /tmp/openvpp-testing/download_dir/
-| | @{vpp_rpm_pkgs}= | Create List | vpp | vpp-devel | vpp-lib | vpp-plugins
-| | Set Global Variable | ${vpp_rpm_pkgs}
-| | @{vpp_deb_pkgs}= | Create List | vpp | vpp-dbg | vpp-dev | vpp-lib
-| | ... | vpp-plugins | vpp-api-python
-| | Set Global Variable | ${vpp_deb_pkgs}