summaryrefslogtreecommitdiffstats
path: root/.travis_run_ipa_task.sh
diff options
context:
space:
mode:
authorDinesh Prasanth M K <dmoluguw@redhat.com>2017-06-19 17:39:55 -0400
committerDinesh Prasanth M K <dmoluguw@redhat.com>2017-06-20 15:10:34 -0400
commita0146a3eb316dde1deabbfaded12b20bf0bec064 (patch)
tree903625faf58d3d7a18f5cb750422c01356b6f19e /.travis_run_ipa_task.sh
parent4aa28a72c7deea46f8c7bc407153fd50030bb311 (diff)
downloadpki-a0146a3eb316dde1deabbfaded12b20bf0bec064.tar.gz
pki-a0146a3eb316dde1deabbfaded12b20bf0bec064.tar.xz
pki-a0146a3eb316dde1deabbfaded12b20bf0bec064.zip
Smoke test with FreeIPA
Travis CI is configured to build dogtag RPMs, test CA and KRA and finally do a smoke test with stable FreeIPA. Smoke test runs cert related tests: - test_caacl_plugin - test_caacl_profile_enforcement - test_cert_plugin - test_certprofile_plugin - test_vault_plugin https://pagure.io/dogtagpki/issue/2743 Change-Id: I894133f585772673932d1e8d8420c5c4c5ed6b7e
Diffstat (limited to '.travis_run_ipa_task.sh')
-rwxr-xr-x.travis_run_ipa_task.sh65
1 files changed, 65 insertions, 0 deletions
diff --git a/.travis_run_ipa_task.sh b/.travis_run_ipa_task.sh
new file mode 100755
index 000000000..9fb647295
--- /dev/null
+++ b/.travis_run_ipa_task.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+#
+# Authors:
+# Dinesh Prasanth M K <dmoluguw@redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2017 Red Hat, Inc.
+# All rights reserved.
+#
+
+PYTHON="/usr/bin/python${TRAVIS_PYTHON_VERSION}"
+TEST_RUNNER_CONFIG=".test_runner_config.yaml"
+TASK_TO_RUN=run-tests
+
+test_set="test_caacl_plugin.py test_caacl_profile_enforcement.py test_cert_plugin.py test_certprofile_plugin.py test_vault_plugin.py"
+developer_mode_opt="--developer-mode"
+cert_test_file_loc=""
+
+
+function truncate_log_to_test_failures() {
+ # chop off everything in the CI_RESULTS_LOG preceding pytest error output
+ # if there are pytest errors in the log
+ error_fail_regexp='\(=== ERRORS ===\)\|\(=== FAILURES ===\)'
+
+ if grep -e "$error_fail_regexp" $CI_RESULTS_LOG > /dev/null
+ then
+ sed -i "/$error_fail_regexp/,\$!d" $CI_RESULTS_LOG
+ fi
+}
+
+for test_files in ${test_set}; do
+ cert_test_file_loc="${cert_test_file_loc} test_xmlrpc/${test_files}"
+done
+
+echo ${cert_test_file_loc}
+
+ipa-docker-test-runner -l ${CI_RESULTS_LOG} \
+ -c ${TEST_RUNNER_CONFIG} \
+ $developer_mode_opt \
+ --container-environment "PYTHON=$PYTHON" \
+ --container-image ${IPA_TEST_RUNNER_IMAGE} \
+ --git-repo ${TRAVIS_BUILD_DIR} \
+ ${TASK_TO_RUN} ${cert_test_file_loc}
+
+
+exit_status="$?"
+
+if [[ "$exit_status" -ne 0 ]]
+then
+ truncate_log_to_test_failures
+fi
+
+exit $exit_status \ No newline at end of file