With the split of tests I started to put testware outside
of the main autotest tree. Noticed that when using
test_impiorter in that case it will add a test with wrong
path and fixed that by using absolute path.

Signed-off-by: Julius Gawlas <[email protected]>
---
 utils/test_importer.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/utils/test_importer.py b/utils/test_importer.py
index e8a530b..db800ef 100755
--- a/utils/test_importer.py
+++ b/utils/test_importer.py
@@ -221,8 +221,13 @@ def update_tests_in_db(tests, dry_run=False, 
add_experimental=False,
         __file__, 'autotest.utils.site_test_importer_attributes')
 
     for test in tests:
+        # if test is located outside of autotest tree just use abs path to it
+        if test.find(autotest_dir) == -1:
+            test_path = os.path.abspath(test)
+        else:
+            test_path = test.replace(autotest_dir, '').lstrip('/')
         new_test = models.Test.objects.get_or_create(
-                path=test.replace(autotest_dir, '').lstrip('/'))[0]
+                path=test_path)[0]
         logging.info("Processing %s", new_test.path)
 
         # Set the test's attributes
-- 
1.7.7.6

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to