# Integration/Packaging macros
---
+- builder:
+ name: install-rpm
+ builders:
+ - shell: !include-raw: install-rpm.sh
+
+- builder:
+ name: install-repo-cfg-rpm
+ builders:
+ - shell: |
+ # shellcheck disable=SC2154
+ repo_file="${REPO_CFG_FILE_URL##*/}"
+ sudo curl -s -o /etc/yum.repos.d/"$repo_file" "$REPO_CFG_FILE_URL"
+
+- builder:
+ name: start-odl
+ builders:
+ - shell: !include-raw: start-odl.sh
+
+- builder:
+ name: test-odl
+ builders:
+ - shell: |
+ # Install expect to interact with Karaf shell
+ # Install nmap to check status of ODL's SSH port
+ sudo yum install -y expect nmap
+ - shell: !include-raw: test-ports-nofeature.sh
+ - shell: !include-raw: test-karaf-oxygensafe.expect
+ # Disable this test until ODLPARENT-139 is fixed
+ # - shell: !include-raw: test-rest-ok.sh
+
+- builder:
+ name: stop-odl
+ builders:
+ - shell: !include-raw: stop-odl.sh
+
+- builder:
+ name: uninstall-rpm
+ builders:
+ - shell: !include-raw: uninstall-rpm.sh
+
+- builder:
+ name: upgrade-odl
+ builders:
+ - shell: |
+ sudo yum upgrade -y opendaylight
+
+- builder:
+ name: install-start-test-stop-rpm
+ builders:
+ - install-rpm
+ - start-odl
+ - test-odl
+ - stop-odl
+
+- builder:
+ name: install-start-test-stop-uninstall-rpm
+ builders:
+ - install-start-test-stop-rpm
+ - uninstall-rpm
+
+- builder:
+ name: installrepcfg-upgrade-start-test-stop-rpm
+ builders:
+ - install-repo-cfg-rpm
+ - upgrade-odl
+ - start-odl
+ - test-odl
+ - stop-odl
+
- builder:
name: install-test-uninstall-rpm
builders:
branch: '{branch}'
refspec: 'refs/heads/{branch}'
artifacts: '{archive-artifacts}'
- - string:
- name: URL
- # yamllint disable-line rule:line-length
- default: 'https://raw.githubusercontent.com/opendaylight/integration-packaging/master/packages/rpm/example_repo_configs/opendaylight-8-release.repo'
- description: 'Link to .repo or .rpm file'
- - string:
- name: UPGRADE_URL
- # yamllint disable-line rule:line-length
- default: 'https://raw.githubusercontent.com/opendaylight/integration-packaging/master/packages/rpm/example_repo_configs/opendaylight-8-devel.repo'
- description: 'Link to .repo or .rpm file'
scm:
- integration-gerrit-scm:
build-timeout: '{build-timeout}'
builders:
- - shell: !include-raw-escape: 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-oxygensafe.expect
- - shell: !include-raw: stop-odl.sh
- - shell: !include-raw: test-rpm-upgrade.sh
- - shell: !include-raw: start-odl.sh
- - shell: !include-raw: test-karaf-oxygensafe.expect
- - shell: !include-raw: stop-odl.sh
- - shell: !include-raw: uninstall-rpm.sh
+ # Tests (current and future):
+ # * Install latest release, stop/uninstall, install latest CD
+ # * Upgrade from latest release latest CD
+ # * TODO: Upgrade from latest release to proposed packaging/** logic
+ # * TODO: Upgrade from CD to proposed packaging/** logic
+ # * TODO: Upgrade from proposed packaging/** logic (older ODL) to
+ # proposed packaging logic (latest ODL)
+
+ # Test 1: Install latest release, stop/uninstall, install latest CD
+ - inject:
+ # yamllint disable-line rule:line-length
+ properties-content: 'URL=https://raw.githubusercontent.com/opendaylight/integration-packaging/master/packages/rpm/example_repo_configs/opendaylight-90-release.repo'
+ - install-start-test-stop-uninstall-rpm
+ - inject:
+ # yamllint disable-line rule:line-length
+ properties-content: 'URL=https://raw.githubusercontent.com/opendaylight/integration-packaging/master/packages/rpm/example_repo_configs/opendaylight-9-devel.repo'
+ - install-start-test-stop-uninstall-rpm
+
+ # Test 2: Install latest release, stop, upgrade to latest CD
+ - inject:
+ # yamllint disable-line rule:line-length
+ properties-content: 'URL=https://raw.githubusercontent.com/opendaylight/integration-packaging/master/packages/rpm/example_repo_configs/opendaylight-90-release.repo'
+ - install-start-test-stop-rpm
+ - inject:
+ # yamllint disable-line rule:line-length
+ properties-content: 'REPO_CFG_FILE_URL=https://raw.githubusercontent.com/opendaylight/integration-packaging/master/packages/rpm/example_repo_configs/opendaylight-9-devel.repo'
+ - installrepcfg-upgrade-start-test-stop-rpm
+
+ triggers:
+ - gerrit-trigger-patch-submitted:
+ gerrit-server-name: '{gerrit-server-name}'
+ project: '{project}'
+ branch: '{branch}'
+ files: 'packages/**'
+ forbidden-files: ''
publishers:
- lf-infra-publish
exec bash -c "while ! nmap -Pn -p8101 localhost | grep -q open; do sleep 0.1; done"
# SSH into Karaf shell
+send_user "SSH into ODL Karaf shell\n"
spawn ssh -p 8101 -o StrictHostKeyChecking=no karaf@127.0.0.1
# Auth to Karaf shell
send "$password\r"
# Show features to make debugging easier
+# Check for "No features available" error message
expect "$prompt"
send "feature:list\r"
+expect {{
+ timeout {{
+ send_user "\nFeatures seem to be available\n"
+ }}
+ "No features available" {{
+ send_user "\nNo features available, error\n"
+ exit 1
+ }}
+}}
# Verify that a major feature is present
expect "$prompt"
# send_user "\nTest feature installed successfully\n"
# }}
# }}
+
+send_user "End of Karaf shell tests\n"