Merge "Increase test coverage for DEB env"
authorDaniel Farrell <dfarrell@redhat.com>
Tue, 23 Oct 2018 21:58:46 +0000 (21:58 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 23 Oct 2018 21:58:46 +0000 (21:58 +0000)
jjb/packaging/ansible.yaml
jjb/packaging/test-ansible-deb-custom-config.sh [new file with mode: 0644]
jjb/packaging/test-ansible-deb-default-config.sh [new file with mode: 0644]
jjb/packaging/test-ansible-deb.sh [deleted file]

index 78023e0f50b4e6ed516ccc3ea31093b8861a615a..c3dca13bce26ee8e5fedcdfb90b44102c12a9f42 100644 (file)
@@ -92,9 +92,8 @@
 
     builders:
       - shell: !include-raw: setup-ansible-deb.sh
-      - shell: !include-raw: test-ansible-deb.sh
-      - shell: !include-raw: test-ansible-odl-user.sh
-      - shell: !include-raw: test-odl-logs.sh
+      - shell: !include-raw: test-ansible-deb-default-config.sh
+      - shell: !include-raw: test-ansible-deb-custom-config.sh
 
     triggers:
       - timed: '@daily'
diff --git a/jjb/packaging/test-ansible-deb-custom-config.sh b/jjb/packaging/test-ansible-deb-custom-config.sh
new file mode 100644 (file)
index 0000000..0418c41
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Uninstall any previous installation
+sudo apt-get remove opendaylight && sudo apt-get purge opendaylight
+
+# Delete the ODL directory to ensure a clean working enviroment
+sudo rm -rf /opt/opendaylight
+
+# Install OpenDaylight via repo using example Ansible playbook
+sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/examples/deb_repo_api.yml --extra-vars "@$WORKSPACE/ansible/examples/log_vars.json"
+
+# Create Ansible custom module directories
+sudo mkdir -p /usr/share/ansible/plugins/modules
+
+# Copy the custom module to the directory above
+sudo cp $WORKSPACE/ansible/library/odl_usermod.py /usr/share/ansible/plugins/modules/
+
+# Execute the odl-user-test playbook
+sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/tests/test-odl-users.yaml -v
+
+# Test the custom log configurations
+sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/tests/test-odl-logs.yaml -e test_log_level=DEBUG -e test_log_mechanism=console -v
diff --git a/jjb/packaging/test-ansible-deb-default-config.sh b/jjb/packaging/test-ansible-deb-default-config.sh
new file mode 100644 (file)
index 0000000..031a306
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Uninstall any previous installation
+sudo apt-get remove opendaylight && sudo apt-get purge opendaylight
+
+# Delete the ODL directory to ensure a clean working enviroment
+sudo rm -rf /opt/opendaylight
+
+# Install OpenDaylight via repo using example Ansible playbook
+sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/examples/deb_repo_api.yml
+
+# Create Ansible custom module directories
+sudo mkdir -p /usr/share/ansible/plugins/modules
+
+# Copy the custom module to the directory above
+sudo cp $WORKSPACE/ansible/library/odl_usermod.py /usr/share/ansible/plugins/modules/
+
+# Execute the odl-user-test playbook
+sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/tests/test-odl-users.yaml -v
+
+# Test the custom log configurations
+sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/tests/test-odl-logs.yaml -e test_log_level=INFO -e test_log_mechanism=file -v
diff --git a/jjb/packaging/test-ansible-deb.sh b/jjb/packaging/test-ansible-deb.sh
deleted file mode 100644 (file)
index 99d0f80..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-# Install OpenDaylight via repo using example Ansible playbook
-sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/examples/deb_repo_api.yml --extra-vars "@$WORKSPACE/ansible/examples/log_vars.json"