aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--resources/libraries/python/honeycomb/HoneycombSetup.py65
-rwxr-xr-xresources/tools/download_hc_build_pkgs.sh37
-rwxr-xr-xresources/tools/download_hc_pkgs.sh2
-rw-r--r--tests/func/honeycomb/__init__.robot1
-rw-r--r--tests/func/honeycomb/mgmt-cfg-nsh-apihc-apivat-func.robot3
5 files changed, 60 insertions, 48 deletions
diff --git a/resources/libraries/python/honeycomb/HoneycombSetup.py b/resources/libraries/python/honeycomb/HoneycombSetup.py
index bee27ab095..89e62079cd 100644
--- a/resources/libraries/python/honeycomb/HoneycombSetup.py
+++ b/resources/libraries/python/honeycomb/HoneycombSetup.py
@@ -298,14 +298,16 @@ class HoneycombSetup(object):
"node {0}, {1}".format(node, stderr))
@staticmethod
- def enable_module_features(node):
+ def enable_module_features(node, *features):
"""Configure Honeycomb to use VPP modules that are disabled by default.
- Note: If the module is not enabled in VPP, Honeycomb will
+ ..Note:: If the module is not enabled in VPP, Honeycomb will
be unable to establish VPP connection.
:param node: Honeycomb node.
+ :param features: Features to enable.
:type node: dict
+ :type features: string
:raises HoneycombError: If the configuration could not be changed.
"""
@@ -316,16 +318,57 @@ class HoneycombSetup(object):
ssh = SSH()
ssh.connect(node)
- for feature in disabled_features.keys():
- # uncomment by replacing the entire line
- find = replace = "{0}".format(disabled_features[feature])
+ for feature in features:
+ if feature in disabled_features.keys():
+ # uncomment by replacing the entire line
+ find = replace = "{0}".format(disabled_features[feature])
- argument = '"/{0}/c\\ {1}"'.format(find, replace)
- path = "{0}/modules/*module-config"\
- .format(Const.REMOTE_HC_DIR)
- command = "sed -i {0} {1}".format(argument, path)
+ argument = '"/{0}/c\\ {1}"'.format(find, replace)
+ path = "{0}/modules/*module-config"\
+ .format(Const.REMOTE_HC_DIR)
+ command = "sed -i {0} {1}".format(argument, path)
- (ret_code, _, stderr) = ssh.exec_command_sudo(command)
+ (ret_code, _, stderr) = ssh.exec_command_sudo(command)
+ if ret_code != 0:
+ raise HoneycombError("Failed to modify configuration on "
+ "node {0}, {1}".format(node, stderr))
+ else:
+ raise HoneycombError(
+ "Unrecognized feature {0}.".format(feature))
+
+ @staticmethod
+ def copy_java_libraries(node):
+ """Copy Java libraries installed by vpp-api-java package to honeycomb
+ lib folder.
+
+ This is a (temporary?) workaround for jvpp version mismatches.
+
+ :param node: Honeycomb node
+ :type node: dict
+ """
+
+ ssh = SSH()
+ ssh.connect(node)
+ (_, stdout, _) = ssh.exec_command_sudo(
+ "ls /usr/share/java | grep ^jvpp-*")
+
+ files = stdout.split("\n")[:-1]
+ for item in files:
+ # example filenames:
+ # jvpp-registry-17.04.jar
+ # jvpp-core-17.04.jar
+
+ parts = item.split("-")
+ version = "{0}-SNAPSHOT".format(parts[2][:5])
+ artifact_id = "{0}-{1}".format(parts[0], parts[1])
+
+ directory = "{0}/lib/io/fd/vpp/{1}/{2}".format(
+ Const.REMOTE_HC_DIR, artifact_id, version)
+ cmd = "sudo mkdir -p {0}; " \
+ "sudo cp /usr/share/java/{0} {1}/{2}-{3}.jar".format(
+ item, directory, artifact_id, version)
+
+ (ret_code, _, stderr) = ssh.exec_command(cmd)
if ret_code != 0:
- raise HoneycombError("Failed to modify configuration on "
+ raise HoneycombError("Failed to copy JVPP libraries on "
"node {0}, {1}".format(node, stderr))
diff --git a/resources/tools/download_hc_build_pkgs.sh b/resources/tools/download_hc_build_pkgs.sh
index 4dc49f9d82..71a2efea24 100755
--- a/resources/tools/download_hc_build_pkgs.sh
+++ b/resources/tools/download_hc_build_pkgs.sh
@@ -18,20 +18,15 @@ set -ex
trap 'rm -f *.deb.md5; exit' EXIT
trap 'rm -f *.deb.md5;rm -f *.deb; exit' ERR
-# Download the latest VPP .deb packages, their matching JVPP .jar and VPP plugin .deb packages
+# Download the latest VPP and VPP plugin .deb packages
URL="https://nexus.fd.io/service/local/artifact/maven/content"
VER="LATEST"
REPO='fd.io.master.ubuntu.trusty.main'
-JVPP_REPO='fd.io.snapshot'
VPP_GROUP="io.fd.vpp"
-HC_GROUP="io.fd.hc2vpp"
NSH_GROUP="io.fd.nsh_sfc"
-VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-dpdk-dev vpp-dpdk-dkms vpp-lib vpp-plugins"
-JVPP_ARTIFACTS="jvpp-core jvpp-registry jvpp-acl jvpp-snat jvpp-ioam-pot jvpp-ioam-trace"
-HC_ARTIFACTS="honeycomb"
+VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-dpdk-dev vpp-dpdk-dkms vpp-lib vpp-plugins vpp-api-java"
NSH_ARTIFACTS="vpp-nsh-plugin"
PACKAGE="deb deb.md5"
-JVPP_PACKAGE="jar jar.md5"
CLASS="deb"
for ART in ${VPP_ARTIFACTS}; do
@@ -40,18 +35,6 @@ for ART in ${VPP_ARTIFACTS}; do
done
done
-for ART in ${JVPP_ARTIFACTS}; do
- for PAC in $JVPP_PACKAGE; do
- curl "${URL}?r=${JVPP_REPO}&g=${VPP_GROUP}&a=${ART}&p=${PAC}&v=${VER}" -O -J || exit
- done
-done
-
-for ART in ${HC_ARTIFACTS}; do
- for PAC in $PACKAGE; do
- curl "${URL}?r=${REPO}&g=${HC_GROUP}&a=${ART}&p=${PAC}&v=${VER}&c=${CLASS}" -O -J || exit
- done
-done
-
for ART in ${NSH_ARTIFACTS}; do
for PAC in $PACKAGE; do
curl "${URL}?r=${REPO}&g=${NSH_GROUP}&a=${ART}&p=${PAC}&v=${VER}&c=${CLASS}" -O -J || exit
@@ -62,22 +45,6 @@ for FILE in *.deb; do
echo " "${FILE} >> ${FILE}.md5
done
-for FILE in *.jar; do
- echo " "${FILE} >> ${FILE}.md5
-done
-
for MD5FILE in *.md5; do
md5sum -c ${MD5FILE} || exit
done
-
-# Install JVPP to maven local repo, to be used in HC2VPP build
-JVPP_JARS=$(find . -type f -iname '*.jar')
-for item in jvpp*.jar; do
- # Example filename: jvpp-registry-17.01-20161206.125556-1.jar
- # ArtifactId = jvpp-registry
- # Version = 17.01
- basefile=$(basename -s .jar "$item")
- artifactId=$(echo "$basefile" | cut -d '-' -f 1-2)
- version=$(echo "$basefile" | cut -d '-' -f 3)
- mvn install:install-file -Dfile=${item} -DgroupId=io.fd.vpp -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
-done
diff --git a/resources/tools/download_hc_pkgs.sh b/resources/tools/download_hc_pkgs.sh
index 8533db0283..d52e2469e0 100755
--- a/resources/tools/download_hc_pkgs.sh
+++ b/resources/tools/download_hc_pkgs.sh
@@ -24,7 +24,7 @@ REPO='fd.io.master.ubuntu.trusty.main'
GROUP="io.fd.vpp"
HC_GROUP="io.fd.hc2vpp"
NSH_GROUP="io.fd.nsh_sfc"
-VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-dpdk-dev vpp-dpdk-dkms vpp-lib vpp-plugins"
+VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-dpdk-dev vpp-dpdk-dkms vpp-lib vpp-plugins vpp-api-java"
HC_ARTIFACTS="honeycomb"
NSH_ARTIFACTS="vpp-nsh-plugin"
PACKAGE="deb deb.md5"
diff --git a/tests/func/honeycomb/__init__.robot b/tests/func/honeycomb/__init__.robot
index 701ccc2971..1b129d9c86 100644
--- a/tests/func/honeycomb/__init__.robot
+++ b/tests/func/honeycomb/__init__.robot
@@ -21,6 +21,7 @@
| Resource | resources/libraries/robot/honeycomb/honeycomb.robot
| Suite Setup | Run Keywords | Setup All DUTs Before Test | AND
| ... | Clear Persisted Honeycomb Configuration | ${node} | AND
+| ... | Copy Java Libraries | ${node} | AND
| ... | Configure Unsecured Access | ${node} | AND
| ... | Enable Module Features | ${node} | AND
| ... | Configure Log Level | ${node} | TRACE | AND
diff --git a/tests/func/honeycomb/mgmt-cfg-nsh-apihc-apivat-func.robot b/tests/func/honeycomb/mgmt-cfg-nsh-apihc-apivat-func.robot
index f7e262234a..aade075a7a 100644
--- a/tests/func/honeycomb/mgmt-cfg-nsh-apihc-apivat-func.robot
+++ b/tests/func/honeycomb/mgmt-cfg-nsh-apihc-apivat-func.robot
@@ -24,7 +24,8 @@
| Documentation | *Honeycomb NSH test suite.*
| Suite Teardown | Run Keyword If Any Tests Failed
| ... | Restart Honeycomb And VPP And Clear Persisted Configuration | ${node}
-| Force Tags | honeycomb_sanity
+# disabled pending NSH version 17.04
+#| Force Tags | honeycomb_sanity
*** Test Cases ***
| TC01: Honeycomb can configure NSH entry