Add tests to test-deb jjb 81/69281/10
authorDimitrios Markou <mardim@intracom-telecom.com>
Thu, 8 Mar 2018 15:09:30 +0000 (17:09 +0200)
committerDimitrios Markou <mardim@intracom-telecom.com>
Thu, 15 Mar 2018 10:58:05 +0000 (12:58 +0200)
Change-Id: I55c2a3d27d27dfcc1555a945fe09593e596c6e0c
Signed-off-by: Dimitrios Markou <mardim@intracom-telecom.com>
jjb/packaging/packaging.yaml
jjb/packaging/uninstall-deb.sh [new file with mode: 0644]

index 0684fba9d407e3e357b8e4fe33ba5039481014b8..0bf16eeea24f279d8d68b612bb0cf8655a848803 100644 (file)
     builders:
       - shell: !include-raw: install-deb.sh
       - shell: !include-raw: start-odl.sh
+      - shell: !include-raw-escape: test-ports-nofeature.sh
       - shell: |
           # Install expect to interact with Karaf shell
-          sudo apt-get install -y expect
           # Install nmap to check status of ODL's SSH port
-          sudo apt-get install -y nmap
+          sudo apt-get install -y expect nmap
       - shell: !include-raw: test-karaf-oxygensafe.expect
+      # Disable this test until ODLPARENT-139 is fixed
+      # - shell: !include-raw-escape: test-rest-ok.sh
       - shell: !include-raw: stop-odl.sh
+      - shell: !include-raw: uninstall-deb.sh
 
     publishers:
       - lf-infra-publish
diff --git a/jjb/packaging/uninstall-deb.sh b/jjb/packaging/uninstall-deb.sh
new file mode 100644 (file)
index 0000000..7630144
--- /dev/null
@@ -0,0 +1,19 @@
+#!/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
+
+# Uninstall ODL
+sudo dpkg --purge opendaylight
+
+# Verify ODL not installed
+if dpkg -s opendaylight; then
+    # Fail if exit code 0, ie ODL is still installed
+    echo "OpenDaylight unexpectedly still installed"
+    exit 1
+else
+    echo "OpenDaylight not installed, as expected"
+fi