Fix, refactor RPM upgrade tests
[releng/builder.git] / jjb / packaging / packaging.yaml
index 8191744d3ba6a900eba3cea21e1f55c080a99f49..fb6c335cc879a7ccdc45e8207054984c77197ddd 100644 (file)
           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