Add jenkins job to test deb 08/53708/3
authorAkshita Jha <zenith158@gmail.com>
Thu, 23 Mar 2017 09:28:48 +0000 (14:58 +0530)
committerDaniel Farrell <dfarrell@redhat.com>
Fri, 24 Mar 2017 20:38:43 +0000 (20:38 +0000)
Change-Id: I33896dc3cfae5a05733bb6adab85307f914f538a
Signed-off-by: Akshita Jha <zenith158@gmail.com>
jjb/packaging/include-raw-test-deb.sh [new file with mode: 0644]
jjb/packaging/packaging.yaml

diff --git a/jjb/packaging/include-raw-test-deb.sh b/jjb/packaging/include-raw-test-deb.sh
new file mode 100644 (file)
index 0000000..22930fa
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# Options:
+#   -x: Echo commands
+#   -e: Fail on errors
+#   -o pipefail: Fail on errors in scripts this calls, give stacktrace
+set -ex -o pipefail
+
+# Install ODL from .deb link or .repo url
+if [[ $URL == *.deb ]]
+then
+  sudo apt-get install -y "$URL"
+elif [[ $URL == ppa:* ]]
+then
+  sudo add-apt-repository "$REPO_FILE"
+  sudo apt-get update
+  sudo apt-get install -y opendaylight
+else
+  echo "URL is not a link to a PPA repo or .deb"
+fi
+
+# Install expect to interact with karaf shell
+sudo apt-get install -y expect
+
+# Start OpenDaylight
+sudo systemctl start opendaylight
+
+# Check status of OpenDaylight
+sudo systemctl status opendaylight
+
+# Get process id of Java
+pgrep java
index 36dcb35336bbbf45ac5d9fef657e865409cf068a..9be194a7bbe5bd0ce0cdb4ecca195c9827be3fa4 100644 (file)
@@ -9,6 +9,7 @@
       - 'packaging-build-rpm-snap-{stream}'
       - 'packaging-build-deb-{stream}'
       - 'packaging-test-rpm-{stream}'
+      - 'packaging-test-deb-{stream}'
       - 'packaging-test-puppet-{stream}'
       - 'packaging-test-ansible-rpm-{stream}'
       - 'packaging-test-ansible-deb-{stream}'
       - archive-artifacts:
           artifacts: '**'
 
+- job-template:
+    name: 'packaging-test-deb-{stream}'
+
+    node: ubuntu1604-mininet-ovs-25-2c-4g
+
+    parameters:
+      - opendaylight-infra-parameters:
+          project: '{project}'
+          branch: '{branch}'
+          refspec: 'refs/heads/{branch}'
+          artifacts: '{archive-artifacts}'
+      - string:
+          name: URL
+          # yamllint disable-line rule:line-length
+          default: 'http://download.opensuse.org/repositories/home:/akshitajha/xUbuntu_16.04/all/opendaylight_5.0.0-1_all.deb'
+          description: 'Link to .deb file'
+      - string:
+          name: REPO_FILE
+          default: 'ppa:odl-team/boron'
+          description: 'Name of the PPA repository'
+
+    scm:
+      - integration-gerrit-scm:
+          basedir: 'packaging'
+          refspec: '$GERRIT_REFSPEC'
+          branch: 'master'
+
+    wrappers:
+      - opendaylight-infra-wrappers:
+          build-timeout: '{build-timeout}'
+
+    builders:
+      - shell: !include-raw: include-raw-test-deb.sh
+      - shell: !include-raw: include-raw-test-karaf.expect
+
+    publishers:
+      - archive-artifacts:
+          artifacts: '**'
+
 - job-template:
     name: 'packaging-test-ansible-rpm-{stream}'