diff options
-rwxr-xr-x | bootstrap/vagrant-onap/lib/robot | 49 | ||||
-rw-r--r-- | bootstrap/vagrant-onap/tests/test_robot | 48 | ||||
-rw-r--r-- | documentation/api-dependencies/onapapidependencies.dot | 9 | ||||
-rw-r--r-- | test/csit/scripts/holmes/engine-management/startup.sh | 2 | ||||
-rw-r--r-- | test/csit/scripts/holmes/rule-management/startup.sh | 2 | ||||
-rw-r--r-- | version-manifest/pom.xml | 2 | ||||
-rw-r--r-- | version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java | 46 |
7 files changed, 136 insertions, 22 deletions
diff --git a/bootstrap/vagrant-onap/lib/robot b/bootstrap/vagrant-onap/lib/robot index 4102680ef..34b431a54 100755 --- a/bootstrap/vagrant-onap/lib/robot +++ b/bootstrap/vagrant-onap/lib/robot @@ -2,12 +2,34 @@ set -o xtrace -# install_testsuite_properties() - Download and install testsuite properties -function install_testsuite_properties { +source /var/onap/functions + +robot_src_folder=$git_src_folder/testsuite +robot_repos=("heatbridge" "properties" "python-testing-utils") + +# clone_robot_repos() - Function that clones Robot source repo. +function clone_robot_repos { + clone_repo testsuite $robot_src_folder + + for dirc in ${robot_repos[@]}; do + clone_repo testsuite/$dirc $robot_src_folder/$dirc + done +} + +# compile_robot_repos() - Function that compile Robot source repo. +function compile_robot_repos { + install_python_package tox + compile_src $robot_src_folder + + for dirc in ${robot_repos[@]}; do + compile_src $robot_src_folder/$dirc + done +} + +# _setup_ete_folder() - Create and copy ete folder structure +function _setup_ete_folder { mkdir -p /opt/eteshare/config - local src_folder=/opt/testsuite/properties - clone_repo testsuite/properties $src_folder cp $src_folder/integration_* /opt/eteshare/config cp $src_folder/vm_config2robot.sh /opt/eteshare/config cp $src_folder/ete.sh /opt @@ -17,15 +39,26 @@ function install_testsuite_properties { chmod +x /opt/demo.sh } -# run_testsuite_image() - Pull and run testsuite docker image -function run_testsuite_image { +# get_robot_images() - Pull or build the Robot Docker images +function get_robot_images { pull_openecomp_image testsuite +} + +# install_robot() - Run Robot services +function install_robot { docker rm -f openecompete_container docker run -d --name openecompete_container -v /opt/eteshare:/share -p 88:88 $nexus_docker_repo/openecomp/testsuite:$docker_version } # init_robot() - Function that initialize Robot services function init_robot { - install_testsuite_properties - run_testsuite_image + if [[ "$clone_repo" == "True" ]]; then + clone_robot_repos + _setup_ete_folder + if [[ "$compile_repo" == "True" ]]; then + compile_robot_repos + fi + fi + get_robot_images + install_robot } diff --git a/bootstrap/vagrant-onap/tests/test_robot b/bootstrap/vagrant-onap/tests/test_robot new file mode 100644 index 000000000..702401e2a --- /dev/null +++ b/bootstrap/vagrant-onap/tests/test_robot @@ -0,0 +1,48 @@ +#!/bin/bash + +source /var/onap_tests/_test_base +source /var/onap/robot + +covered_functions=( +"clone_robot_repos" "compile_robot_repos" "get_robot_images" "install_robot" +) + +# test_clone_robot_repos() - Verify that Robot repositories are cloned properly +function test_clone_robot_repos { + clone_robot_repos + + asserts_file_exist $robot_src_folder/LICENSE.TXT + asserts_file_exist $robot_src_folder/heatbridge/pom.xml + asserts_file_exist $robot_src_folder/properties/LICENSE.TXT + asserts_file_exist $robot_src_folder/python-testing-utils/LICENSE.TXT +} + +# test_compile_robot_repos() - Verify that Robot source code can be compiled properly +function test_compile_robot_repos { + clone_robot_repos + compile_robot_repos + + asserts_file_exist $robot_src_folder/heatbridge/target/maven-python/dist/heatbridge-0.3.0.dev0-py2-none-any.whl +} + +# test_get_robot_images() - Verify that Robot Docker images are retrieved +function test_get_mr_images { + get_robot_images + + asserts_image testsuite +} + +# test_install_robot() - Verify the built and start of Robot services +function test_install_message_router { + clone_robot_repos + get_robot_images + install_robot + + asserts_image_running testsuite +} + +if [ "$1" != '*' ]; then + unset covered_functions + covered_functions=$1 +fi +main "${covered_functions[@]}" diff --git a/documentation/api-dependencies/onapapidependencies.dot b/documentation/api-dependencies/onapapidependencies.dot index 99efa941e..aa66b3c01 100644 --- a/documentation/api-dependencies/onapapidependencies.dot +++ b/documentation/api-dependencies/onapapidependencies.dot @@ -15,7 +15,7 @@ */ /* -Usage: dot -T png -O onapapidependecies.dot This cmd will generate a png graph dependency file. +Usage: dot -T png -O onapapidependencies.dot This cmd will generate a png graph dependency file. Graphiz is the open source tool used to generate the graph. Graphiz is available and documented at http://www.graphviz.org This text file represents the API dependencies between ONAP projects @@ -61,6 +61,8 @@ aai -> msb; appc -> aai; //https://wiki.onap.org/pages/viewpage.action?pageId=6593279#APPCM1ReleasePlanning(AmsterdamRelease)-APIIncomingDependencies appc -> multicloud; appc -> sdc; +appc -> ccsdk; +appc -> dmaap; ccsdk -> aai; //https://wiki.onap.org/display/DW/Release+Planning+Template+%3A+CCSDK+Amsterdam+Release#ReleasePlanningTemplate:CCSDKAmsterdamRelease-APIIncomingDependencies ccsdk -> sdc; clamp -> dcaegen2; //https://wiki.onap.org/display/DW/CLAMP+Release+Planning+M1#CLAMPReleasePlanningM1-APIIncomingDependencies @@ -72,7 +74,8 @@ cli -> msb; dcaegen2 -> dmaap; //https://wiki.onap.org/display/DW/DCAE+R1+Release+Planning#DCAER1ReleasePlanning-APIIncomingDependencies dcaegen2 -> multicloud; dcaegen2 -> policy; -dcaegen2 -> sdc; +dcaegen2 -> sdc; +dmaap -> aaf; //https://wiki.onap.org/display/DW/DMaaP+Amsterdam+M1+Release#DMaaPAmsterdamM1Release-APIIncomingDependencies extapi -> so; //https://wiki.onap.org/pages/viewpage.action?pageId=8227006#ExternalAPIFrameworkM1ReleasePlanning(AmsterdamRelease)-APIIncomingDependencies extapi -> sdc; holmes -> aai; //https://wiki.onap.org/pages/viewpage.action?pageId=6593583#HolmesReleasePlanningforAmsterdam-APIIncomingDependencies @@ -85,11 +88,13 @@ oom -> msb; //https://wiki.onap.org/display/DW/OOM+M1+Release+Planning+Templa policy -> aai; //https://wiki.onap.org/display/DW/Policy+Framework+R1+-+M1+Release+Planning+Template#PolicyFrameworkR1-M1ReleasePlanningTemplate-APIIncomingDependencies policy -> appc; policy -> dcaegen2; +policy -> dmaap; policy -> vfc; policy -> so; portal -> aaf; //https://wiki.onap.org/pages/viewpage.action?pageId=8227559#PortalPlatformM1ReleasePlanning(AmsterdamRelease)-APIIncomingDependencies sdnc -> aai; //https://wiki.onap.org/display/DW/Release+Planning+Template+%3A+SDNC+Amsterdam+Release#ReleasePlanningTemplate:SDNCAmsterdamRelease-APIIncomingDependencies sdnc -> sdc; +sdnc -> dmaap; so -> aai; //https://wiki.onap.org/display/DW/Service+Orchestrator+Release+Planning#ServiceOrchestratorReleasePlanning-APIIncomingDependencies so -> appc; so -> multicloud; diff --git a/test/csit/scripts/holmes/engine-management/startup.sh b/test/csit/scripts/holmes/engine-management/startup.sh index 7d6ec241d..59af9cac6 100644 --- a/test/csit/scripts/holmes/engine-management/startup.sh +++ b/test/csit/scripts/holmes/engine-management/startup.sh @@ -20,4 +20,4 @@ docker login -u docker -p docker nexus3.onap.org:10001 -run-instance.sh nexus3.onap.org:10001/onap/holmes/engine-management:latest $1 "-e URL_JDBC=$2:5432 -e MSB_ADDR=$3 -e MSB_PORT=$4" +run-instance.sh nexus3.onap.org:10001/onap/holmes/engine-management:latest $1 "-e URL_JDBC=$2:5432 -e MSB_ADDR=$3 -e MSB_PORT=$4 -p 9102:9102" diff --git a/test/csit/scripts/holmes/rule-management/startup.sh b/test/csit/scripts/holmes/rule-management/startup.sh index a4cc0a806..e3bcdaa8e 100644 --- a/test/csit/scripts/holmes/rule-management/startup.sh +++ b/test/csit/scripts/holmes/rule-management/startup.sh @@ -19,4 +19,4 @@ docker login -u docker -p docker nexus3.onap.org:10001 -run-instance.sh nexus3.onap.org:10001/onap/holmes/rule-management:latest $1 "-e URL_JDBC=$2:5432 -e MSB_ADDR=$3 -e MSB_PORT=$4"
\ No newline at end of file +run-instance.sh nexus3.onap.org:10001/onap/holmes/rule-management:latest $1 "-e URL_JDBC=$2:5432 -e MSB_ADDR=$3 -e MSB_PORT=$4 -p 9101:9101"
\ No newline at end of file diff --git a/version-manifest/pom.xml b/version-manifest/pom.xml index 5d3f56983..884199e6f 100644 --- a/version-manifest/pom.xml +++ b/version-manifest/pom.xml @@ -48,7 +48,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> - <version>3.2</version> + <version>3.4</version> <configuration> <goalPrefix>version-manifest</goalPrefix> <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> diff --git a/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java b/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java index b26c1cdac..5d4e9a8fa 100644 --- a/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java +++ b/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java @@ -20,7 +20,9 @@ import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -58,8 +60,11 @@ public class VersionCheckMojo extends AbstractMojo { final Log log = getLog(); log.info("Checking version manifest " + manifest); + log.info(""); - Map<String, String> expectedVersions = new HashMap<>(); + final List<String> groupIdPrefixes = Arrays.asList("org.onap", "org.openecomp", "org.openo"); + + final Map<String, String> expectedVersions = new HashMap<>(); try (InputStreamReader in = new InputStreamReader(getClass().getResourceAsStream(manifest), StandardCharsets.ISO_8859_1)) { @@ -79,8 +84,8 @@ public class VersionCheckMojo extends AbstractMojo { throw new MojoExecutionException(e.getMessage()); } - Map<String, String> actualVersions = new HashMap<>(); - MavenProject parent = project.getParent(); + final Map<String, String> actualVersions = new HashMap<>(); + final MavenProject parent = project.getParent(); if (parent != null) { log.debug("Parent: " + parent); actualVersions.put(parent.getGroupId() + ":" + parent.getArtifactId(), parent.getVersion()); @@ -93,16 +98,28 @@ public class VersionCheckMojo extends AbstractMojo { actualVersions.put(dep.getGroupId() + ":" + dep.getArtifactId(), dep.getVersion()); } - Set<String> mismatches = new TreeSet<>(); - for (Entry<String, String> expected : expectedVersions.entrySet()) { - String artifact = expected.getKey(); + final Set<String> mismatches = new TreeSet<>(); + final Set<String> missingArtifacts = new TreeSet<>(); + + for (Entry<String, String> actualVersion : actualVersions.entrySet()) { + String artifact = actualVersion.getKey(); String expectedVersion = expectedVersions.get(artifact); - String actualVersion = actualVersions.get(artifact); - if (actualVersion != null && !actualVersion.equals(expectedVersion)) { + if (expectedVersion == null) { + if (artifact.startsWith("org.onap") || artifact.startsWith("org.openecomp")) { + missingArtifacts.add(artifact); + } + } else if (!expectedVersion.equals(actualVersion)) { mismatches.add(artifact); } } + // used for formatting + int[] columnWidths = new int[10]; + columnWidths[0] = actualVersions.keySet().stream().mapToInt(String::length).max().orElse(1); + columnWidths[1] = actualVersions.values().stream().mapToInt(String::length).max().orElse(1); + columnWidths[2] = expectedVersions.values().stream().mapToInt(String::length).max().orElse(1); + String format = " %-" + columnWidths[0] + "s" + " %" + columnWidths[1] + "s -> %" + columnWidths[2] + "s"; + if (mismatches.isEmpty()) { log.debug("No version mismatches found"); } else { @@ -110,11 +127,22 @@ public class VersionCheckMojo extends AbstractMojo { for (String artifact : mismatches) { String expectedVersion = expectedVersions.get(artifact); String actualVersion = actualVersions.get(artifact); + if (actualVersion != null && !actualVersion.equals(expectedVersion)) { - log.warn(" " + artifact + " " + actualVersion + " -> " + expectedVersion); + log.warn(String.format(format, artifact, actualVersion, expectedVersion)); } } } + log.info(""); + + if (!missingArtifacts.isEmpty()) { + log.warn("The following dependencies are missing in the version manifest:"); + for (String artifact : missingArtifacts) { + String actualVersion = actualVersions.get(artifact); + log.warn(String.format(format, artifact, actualVersion, "?")); + } + } + log.info(""); } } |