Hi guys,

I had to fix a few things that I decided not to propose as patches since I wanted your opinions about them first. For once, I wasn't sure about the intent behind them so a bit more information about it could be useful.

I was wondering by the way the virt tests are extracted whether the idea of having virt tests on a custom directory still exists? Since our test suite is in a custom directory and therefore its tests have their own directory, I used a hack in the past to allow this. For my "other_tests_dirs", I used an absolute path and as a result the os.path.join() did the rest of the job. However, later changes made me do something like this:

diff --git a/virt.py b/virt.py
index fe536f6..dcddf8c 100644
--- a/virt.py
+++ b/virt.py
@@ -86,8 +86,8 @@ class virt(test.test):
                     bin_dir = self.bindir

                     for d in other_subtests_dirs.split():
-                        # Replace split char.
-                        d = os.path.join(*d.split("/"))
+ # If d starts with a "/" an absolute path will be assumed + # else the relative path will be searched in the bin_dir
                         subtestdir = os.path.join(bin_dir, d, "tests")
                         if not os.path.isdir(subtestdir):
                             raise error.TestError("Directory %s not"
--

which shows that all the directories in the list of "other_tests_dirs" are expected to be inside bin_dir or somewhere relative to it. Was this really the intend because for sure the lines

                        # Replace split char.
                        d = os.path.join(*d.split("/"))

had some intent. As we all know using hacks is not the most preferred way to achieve what we want so in the long run I would prefer to find a way to do this which conforms better with the design of the virt tests.

Best,
Plamen Dimitrov

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to