Add jenkins option to set custom debug levels 84/62384/9
authorSam Hague <shague@redhat.com>
Mon, 28 Aug 2017 23:23:41 +0000 (19:23 -0400)
committerSam Hague <shague@redhat.com>
Wed, 30 Aug 2017 12:16:59 +0000 (08:16 -0400)
Change-Id: I35b28f971683cbaf35e7b3fe910b4e9c6044f81d
Signed-off-by: Sam Hague <shague@redhat.com>
jjb/integration/integration-deploy-controller-run-test.sh
jjb/integration/integration-macros.yaml
jjb/integration/integration-templates.yaml
jjb/releng-defaults.yaml

index 7e3a7beb6b3ae297e445d39a50d4bfea3a5f3636..04a4c8f597fef8c4b9e3cbd5e8a3148346682a63 100644 (file)
@@ -69,6 +69,19 @@ sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupInde
 # FIXME: Make log size limit configurable from build parameter.
 sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=30GB/g' \${LOGCONF}
 echo "log4j.logger.org.opendaylight.yangtools.yang.parser.repo.YangTextSchemaContextResolver = WARN" >> \${LOGCONF}
+# Add custom logging levels
+# CONTROLLERDEBUGMAP is expected to be a key:value map of space separated values like "module:level module2:level2"
+# where module is abbreviated and does not include org.opendaylight
+unset IFS
+if [ -n "${CONTROLLERDEBUGMAP}" ]; then
+    for kv in ${CONTROLLERDEBUGMAP}; do
+        module=\${kv%%:*}
+        level=\${kv#*:}
+        if [ -n \${module} ] && [ -n \${level} ]; then
+            echo "log4j.logger.org.opendaylight.\${module} = \${level}" >> \${LOGCONF}
+        fi
+    done
+fi
 cat \${LOGCONF}
 
 echo "Configure java home and max memory..."
index 5b1dad87199fedd92cefe00370211015511dbd07..a7bea22a49013158ff19fdd150c254bab716f4a1 100644 (file)
           default: '{controller-features}'
           description: 'Features to install in the controller separated by comma'
 
+- parameter:
+    name: integration-controller-debug-map
+    parameters:
+      - string:
+          name: CONTROLLERDEBUGMAP
+          default: '{controller-debug-map}'
+          description: |
+              Key:Value map of debugs to enable on the controller separated by spaces.
+              The module should not include org.opendaylight.
+              The levels must be one of: ERROR, WARN, INFO, DEBUG, TRACE.
+              (ex. ovsdb.lib:ERROR netvirt.vpnservice:INFO)
+
 - parameter:
     name: integration-distribution-stream
     parameters:
index 89e41122f3e980c6bdd90a6e26c1d7537367e3bc..cf0525e290eb2d45517e014c0f928aca447d6ae5 100644 (file)
           bundle-url: '{bundle-url}'
       - integration-controller-features:
           controller-features: '{install-features}'
+      - integration-controller-debug-map:
+          controller-debug-map: '{debug-map}'
       - integration-test-options:
           test-options: '{robot-options}'
       - integration-test-plan:
           bundle-url: '{bundle-url}'
       - integration-controller-features:
           controller-features: '{install-features}'
+      - integration-controller-debug-map:
+          controller-debug-map: '{debug-map}'
       - integration-test-options:
           test-options: '{robot-options}'
       - integration-test-plan:
index 811782701b5516282bf73394900f06da36466114..d9cea002fdab5e4d1827a74fe891da0b9bbf9cf2 100644 (file)
@@ -76,6 +76,7 @@
     # Default Robot framework options
     robot-options: ''
     trigger-jobs: ''
+    debug-map: ''
 
     # Data for csit-verify jobs
     # Branch for "last" version detection