Merge "Do RPM tests in RPM build job to gate publish"
authorJamo Luhrsen <jluhrsen@redhat.com>
Wed, 13 Dec 2017 17:43:05 +0000 (17:43 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 13 Dec 2017 17:43:05 +0000 (17:43 +0000)
jjb/packaging/install-rpm.sh
jjb/packaging/packaging.yaml

index 7f72f0683a67badeff0f5b8f625e138b7bf3c888..2ccc50078f18452dfe42bc5aabf50aa3d3c1d9a7 100644 (file)
@@ -9,12 +9,15 @@ set -ex -o pipefail
 # Update mirror list to avoid slow/hung one
 sudo yum update -y yum-plugin-fastestmirror
 
-# Install ODL from .rpm link or .repo url
-if [[ $URL == *.rpm ]]
-then
+# Install ODL from RPM path, RPM URL or .repo file url
+# NB: Paths must be anchored at root
+if [[ $URL == /*  ]]; then
+  # If path is globbed (/path/to/*.rpm), expand it
+  path=$(sudo find / -wholename $URL)
+  sudo yum install -y "$path"
+elif [[ $URL == *.rpm ]]; then
   sudo yum install -y "$URL"
-elif [[ $URL == *.repo ]]
-then
+elif [[ $URL == *.repo ]]; then
   # shellcheck disable=SC2154
   repo_file="${{URL##*/}}"
   sudo curl --silent -o /etc/yum.repos.d/"$repo_file" "$URL"
index c16c8ae51e06c7472cf8f78b69e00db55e60408f..2d1ae85f45335c2c35b454872c90ec7d2ab24250 100644 (file)
     builders:
       - shell: !include-raw: build-rpm.sh
       - shell: !include-raw: test-rpm-deps.sh
+      - inject:
+          properties-content: 'URL=/home/$USER/rpmbuild/RPMS/noarch/*.rpm'
+      - shell: !include-raw: install-rpm.sh
+      - shell: !include-raw: start-odl.sh
+      - shell: |
+          # Install expect to interact with Karaf shell
+          sudo yum install -y expect
+          # Install nmap to check status of ODL's SSH port
+          sudo yum install -y nmap
+      - shell: !include-raw: test-karaf.expect
+      - shell: !include-raw: stop-odl.sh
       - lf-infra-deploy-maven-file:
           global-settings-file: 'global-settings'
           settings-file: 'packaging-settings'