From 6e308d434937c47fdc3a607c99ca6d7c7155d7a3 Mon Sep 17 00:00:00 2001 From: Jamo Luhrsen Date: Wed, 19 Dec 2018 14:53:37 -0800 Subject: [PATCH] Add tweakability features for ODL in apex job 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 --- jjb/integration/common-functions.sh | 29 +++++++++++++++++++ jjb/integration/integration-apex-run-tests.sh | 2 ++ jjb/netvirt/netvirt-csit-multi-apex.yaml | 2 ++ 3 files changed, 33 insertions(+) diff --git a/jjb/integration/common-functions.sh b/jjb/integration/common-functions.sh index 5866c72fe..7082b2a5b 100644 --- a/jjb/integration/common-functions.sh +++ b/jjb/integration/common-functions.sh @@ -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 diff --git a/jjb/integration/integration-apex-run-tests.sh b/jjb/integration/integration-apex-run-tests.sh index 4c7692b9d..14f9f4a8a 100644 --- a/jjb/integration/integration-apex-run-tests.sh +++ b/jjb/integration/integration-apex-run-tests.sh @@ -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 diff --git a/jjb/netvirt/netvirt-csit-multi-apex.yaml b/jjb/netvirt/netvirt-csit-multi-apex.yaml index 9647cc22f..d10c69149 100644 --- a/jjb/netvirt/netvirt-csit-multi-apex.yaml +++ b/jjb/netvirt/netvirt-csit-multi-apex.yaml @@ -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' -- 2.36.6