summaryrefslogtreecommitdiffstats
path: root/src/journald/test
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2013-09-30 16:43:23 +0200
committerTomas Bzatek <tbzatek@redhat.com>2013-10-15 15:23:49 +0200
commite7bfacbef050fed058444725156fe1b262843efe (patch)
tree0bd322c317a235e48d946d98267cd96edd817dca /src/journald/test
parent4bc2a81c75ec3625d72bbe5374a8b102dd3f97f1 (diff)
downloadopenlmi-providers-e7bfacbef050fed058444725156fe1b262843efe.tar.gz
openlmi-providers-e7bfacbef050fed058444725156fe1b262843efe.tar.xz
openlmi-providers-e7bfacbef050fed058444725156fe1b262843efe.zip
journald: Add tests for new records writing
Diffstat (limited to 'src/journald/test')
-rw-r--r--src/journald/test/TestWriting.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/journald/test/TestWriting.py b/src/journald/test/TestWriting.py
new file mode 100644
index 0000000..f6b439c
--- /dev/null
+++ b/src/journald/test/TestWriting.py
@@ -0,0 +1,43 @@
+# Copyright (C) 2013 Red Hat, Inc. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Authors: Tomas Bzatek <tbzatek@redhat.com>
+#
+
+from common import JournalBase
+import time
+import pywbem
+
+class TestWriting(JournalBase):
+ """
+ Class for testing LMI_JournalLogRecord record writing
+ """
+
+ def test_create_instance(self):
+ """
+ Journal: Test new record writeout using CreateInstance()
+ """
+ new_msg = "== LMI_Journald test message for CreateInstance() mark %d ==" % (time.time() * 1000)
+ inst = pywbem.CIMInstance('LMI_JournalLogRecord',
+ properties = { "CreationClassName": "LMI_JournalLogRecord",
+ "LogCreationClassName": "LMI_JournalMessageLog",
+ "LogName": "Journal",
+ "DataFormat": new_msg })
+ iname = self.wbemconnection.CreateInstance(NewInstance = inst)
+ new_inst = self.wbemconnection.GetInstance(iname)
+ self.assertIsNotNone(iname.keybindings['RecordID'])
+ self.assertIsNotNone(iname.keybindings['MessageTimestamp'])
+ self.assertIn(new_msg, new_inst['DataFormat'])