All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Asleson <tasleson@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - lvmdbustest: Add test for passing log file in options
Date: Mon, 19 Sep 2022 15:58:02 +0000 (GMT)	[thread overview]
Message-ID: <20220919155802.683A03858406@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4a202c11fffb30ae786e69cebe11186dd4166c88
Commit:        4a202c11fffb30ae786e69cebe11186dd4166c88
Parent:        60e4ba36e0843c9536278ff33ce6dfda9cfd8079
Author:        Tony Asleson <tasleson@redhat.com>
AuthorDate:    Wed Aug 17 12:11:07 2022 -0500
Committer:     Tony Asleson <tasleson@redhat.com>
CommitterDate: Fri Sep 16 10:49:37 2022 -0500

lvmdbustest: Add test for passing log file in options

---
 test/dbus/lvmdbustest.py | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index 4977021b1..c03e96c08 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -340,11 +340,14 @@ class TestDbusService(unittest.TestCase):
 		self.assertTrue(rc is not None and len(rc) > 0)
 		self._check_consistency()
 
-	def _vg_create(self, pv_paths=None, vg_prefix=None):
+	def _vg_create(self, pv_paths=None, vg_prefix=None, options=None):
 
 		if not pv_paths:
 			pv_paths = self._all_pv_object_paths()
 
+		if options is None:
+			options = EOD
+
 		vg_name = vg_n(prefix=vg_prefix)
 
 		vg_path = self.handle_return(
@@ -352,7 +355,7 @@ class TestDbusService(unittest.TestCase):
 				dbus.String(vg_name),
 				dbus.Array(pv_paths, signature=dbus.Signature('o')),
 				dbus.Int32(g_tmo),
-				EOD))
+				options))
 
 		self._validate_lookup(vg_name, vg_path)
 		self.assertTrue(vg_path is not None and len(vg_path) > 0)
@@ -2077,6 +2080,20 @@ class TestDbusService(unittest.TestCase):
 		self._test_lv_method_interface_sequence(
 			self._vdo_pool_lv(), test_ss=False)
 
+	def _log_file_option(self):
+		fn = "/tmp/%s" % rs(8, "_lvm.log")
+		try:
+			options = dbus.Dictionary({}, signature=dbus.Signature('sv'))
+			option_str = "log { level=7 file=%s syslog=0 }" % fn
+			options["config"] = dbus.String(option_str)
+			self._vg_create(None, None, options)
+			self.assertTrue(os.path.exists(fn))
+		finally:
+			if os.path.exists(fn):
+				os.unlink(fn)
+
+	def test_log_file_option(self):
+		self._log_file_option()
 
 class AggregateResults(object):
 


                 reply	other threads:[~2022-09-19 15:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220919155802.683A03858406@sourceware.org \
    --to=tasleson@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.