Merge "Job for testing the ODL logs configuration"
authorDaniel Farrell <dfarrell@redhat.com>
Fri, 24 Aug 2018 17:39:29 +0000 (17:39 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 24 Aug 2018 17:39:29 +0000 (17:39 +0000)
jjb/packaging/ansible.yaml
jjb/packaging/test-odl-logs.sh [new file with mode: 0644]

index 58b08018ce608cda6987bb9b4dd3cfddccf4ed44..3b71487e088af4b77cd6c1230b3498f8be00399d 100644 (file)
@@ -46,6 +46,7 @@
     builders:
       - shell: !include-raw: test-ansible-rpm.sh
       - shell: !include-raw: test-ansible-odl-user.sh
+      - shell: !include-raw: test-odl-logs.sh
 
     triggers:
       - timed: '@daily'
diff --git a/jjb/packaging/test-odl-logs.sh b/jjb/packaging/test-odl-logs.sh
new file mode 100644 (file)
index 0000000..8d28bfc
--- /dev/null
@@ -0,0 +1,28 @@
+#!/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
+
+# Install required packages
+virtualenv rpm_build
+source rpm_build/bin/activate
+rpm_build/bin/python -m pip install --upgrade pip
+
+# Install Ansible
+sudo yum install -y ansible
+
+# Install local version of ansible-opendaylight to path expected by Ansible.
+# Could almost do this by setting ANSIBLE_ROLES_PATH=$WORKSPACE, but Ansible
+# expects the dir containing the role to have the name of role. The JJB project
+# is called "ansible", which causes the cloned repo name to not match the role
+# name "opendaylight". So we need a cp/mv either way and this is simplest.
+sudo cp -R $WORKSPACE/ansible /etc/ansible/roles/opendaylight
+
+# Install OpenDaylight via repo using example Ansible playbook
+sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/examples/rpm_8_devel.yml
+
+# Execute the test ODL logs playbook
+sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/tests/test-odl-logs.yaml -vvv