Add tweakability features for ODL in apex job 83/78883/3
authorJamo Luhrsen <jluhrsen@redhat.com>
Wed, 19 Dec 2018 22:53:37 +0000 (14:53 -0800)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 21 Dec 2018 17:06:30 +0000 (09:06 -0800)
apex gets deployed with puppet and is already in
place, so need to write out the features to install
in that hieradata json file

Change-Id: I1293777835b5c78e09647107de0fd8ed03b47f98
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
jjb/integration/common-functions.sh
jjb/integration/integration-apex-run-tests.sh
jjb/netvirt/netvirt-csit-multi-apex.yaml

index 5866c72fe4c8c28f5f1ed066f4a854a59e79b4a6..7082b2a5ba2e6bafff28b628f97d2977319696a2 100644 (file)
@@ -21,6 +21,7 @@ function print_common_env() {
     cat << EOF
 common-functions environment:
 MAVENCONF: ${MAVENCONF}
+ACTUALFEATURES: ${ACTUALFEATURES}
 FEATURESCONF: ${FEATURESCONF}
 CUSTOMPROP: ${CUSTOMPROP}
 LOGCONF: ${LOGCONF}
@@ -158,6 +159,34 @@ function configure_karaf_log_for_apex() {
     fi
 } # function configure_karaf_log_for_apex()
 
+function configure_odl_features_for_apex() {
+
+    # if the environment variable $ACTUALFEATURES is not null, then rewrite
+    # the puppet config file with the features given in that variable, otherwise
+    # this function is a noop
+
+    local -r controller_ip=$1
+    local -r config_file=/etc/puppet/hieradata/service_configs.json
+
+cat > /tmp/set_odl_features.sh << EOF
+sudo jq '.["opendaylight::extra_features"] |= []' $config_file > tmp.json && mv tmp.json $config_file
+for feature in $(echo $ACTUALFEATURES | sed "s/,/ /g"); do
+    sudo jq --arg jq_arg \$feature '.["opendaylight::extra_features"] |= . + [\$jq_arg]' $config_file > tmp && mv tmp $config_file;
+done
+echo "Modified puppet-opendaylight service_configs.json..."
+cat $config_file
+EOF
+
+    echo "Feature configuration script..."
+    cat /tmp/set_odl_features.sh
+
+    if [ -n "${ACTUALFEATURES}" ]; then
+        scp /tmp/set_odl_features.sh $controller_ip:/tmp/set_odl_features.sh
+        ssh $controller_ip "sudo bash /tmp/set_odl_features.sh"
+    fi
+
+} # function configure_odl_features_for_apex()
+
 function get_os_deploy() {
     local -r num_systems=${1:-$NUM_OPENSTACK_SYSTEM}
     case ${num_systems} in
index 4c7692b9d356749867b594043702d8854bc3b597..14f9f4a8a613d4c3adbcd7aaf631709e52c04edf 100644 (file)
@@ -13,6 +13,8 @@ print_job_parameters
 get_os_deploy
 
 configure_karaf_log_for_apex $OPENSTACK_CONTROL_NODE_1_IP
+get_features
+configure_odl_features_for_apex $OPENSTACK_CONTROL_NODE_1_IP
 
 # Swap out the ODL distribution
 DISTRO_UNDER_TEST=/tmp/odl.tar.gz
index 9647cc22f8b64797498eb80d70600d4d60690d9d..d10c691496f5aad17d6c313d87634ac486921862 100644 (file)
@@ -19,6 +19,8 @@
 
     topology: '1node'
 
+    install-features: 'odl-netvirt-openstack, decanter-collector-jmx, decanter-appender-elasticsearch'
+
     public-bridge: 'br-datacentre'
     public-physical-network: 'datacentre'
     odl-snat-mode: 'conntrack'