[ABRT PATCH] testsuite: added test for python wrapper for notify_new_path() - related #677

Jiri Moskovcak jmoskovc at redhat.com
Tue Aug 13 11:57:41 UTC 2013


Signed-off-by: Jiri Moskovcak <jmoskovc at redhat.com>
---
 tests/runtests/python-bindings/PURPOSE            |  3 ++
 tests/runtests/python-bindings/notify_new_path.py |  6 +++
 tests/runtests/python-bindings/runtest.sh         | 56 +++++++++++++++++++++++
 3 files changed, 65 insertions(+)
 create mode 100644 tests/runtests/python-bindings/PURPOSE
 create mode 100755 tests/runtests/python-bindings/notify_new_path.py
 create mode 100755 tests/runtests/python-bindings/runtest.sh

diff --git a/tests/runtests/python-bindings/PURPOSE b/tests/runtests/python-bindings/PURPOSE
new file mode 100644
index 0000000..9427238
--- /dev/null
+++ b/tests/runtests/python-bindings/PURPOSE
@@ -0,0 +1,3 @@
+PURPOSE of python-bindings
+Description: Tests the python-bindings for ABRT API
+Author: Jiri Moskovcak <jmoskovc at redhat.com>
diff --git a/tests/runtests/python-bindings/notify_new_path.py b/tests/runtests/python-bindings/notify_new_path.py
new file mode 100755
index 0000000..25008d3
--- /dev/null
+++ b/tests/runtests/python-bindings/notify_new_path.py
@@ -0,0 +1,6 @@
+#!/usr/bin/python
+
+import problem
+import sys
+
+problem.notify_new_path(sys.argv[1])
diff --git a/tests/runtests/python-bindings/runtest.sh b/tests/runtests/python-bindings/runtest.sh
new file mode 100755
index 0000000..73c06d6
--- /dev/null
+++ b/tests/runtests/python-bindings/runtest.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#   runtest.sh of abrt-make-check
+#   Description: Clone latest abrt, build and run make check
+#   Author: Michal Nowak <mnowak at redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#   Copyright (c) 2011 Red Hat, Inc. All rights reserved.
+#
+#   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, either version 3 of
+#   the License, or (at your option) any later version.
+#
+#   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, see http://www.gnu.org/licenses/.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Include rhts environment
+. /usr/share/beakerlib/beakerlib.sh
+. ../aux/lib.sh
+
+TEST="python-bindings"
+PACKAGE="abrt"
+
+rlJournalStart
+    rlPhaseStartSetup
+        TmpDir=$(mktemp -d)
+        cp notify_new_path.py $TmpDir
+        pushd $TmpDir
+
+    rlPhaseEnd
+
+    rlPhaseStartTest
+        newpath="/this/is/the/testing/problem/path"
+        rlRun "./notify_new_path.py $newpath" 0 "Testing notification over socket"
+        sleep 1  # give abrt-server a while to print the message to syslog
+        rlAssertGrep "Bad problem directory name '$newpath', should start with: '/var/tmp/abrt'" /var/log/messages
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+        popd # abrt/
+        popd # TmpDir
+        rm -rf $TmpDir
+    rlPhaseEnd
+    rlJournalPrintText
+rlJournalEnd
-- 
1.8.3.1



More information about the Crash-catcher mailing list