Re: [Kimchi-devel] Unable run unit test cases

1) If you don't run the tests as root some test cases will be bypassed. 2) What I think that happened to you was that you run at least once Kimchi as root and it created the database. In the second time, when running without root permission it was not able to open the database. 3) You can use tests/run_tests.sh to run the tests cases. On 08/09/2015 07:47, Harshal Patil wrote:
so if I run this as a root with, export PYTHONPATH=../src && python -m unittest test_host It works for test_host.py test cases. Should we try to improve our tests such that no root is required? Harshal
----- Original message ----- From: Harshal Patil/India/IBM To: kimchi-devel@ovirt.org Cc: Subject: Unable run unit test cases Date: Tue, Sep 8, 2015 3:59 PM Hi, Trying to run unit tests on kimchi master branch, but getting following error. Am I missing something obvious? harshal@harshal-ThinkPad-T420:~/git/kimchi/tests$ ./run_tests.sh -v Plugin configuration file /home/harshal/git/kimchi/plugins/kimchi/kimchi.conf doesn't exist. Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/lib/python2.7/unittest/__main__.py", line 12, in <module> main(module=None) File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__ self.parseArgs(argv) File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs self.createTests() File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests self.module) File "/usr/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName module = __import__('.'.join(parts_copy)) File "test_yumparser.py", line 96, in <module> @unittest.skipIf(not _is_yum_distro(), 'Skipping: YUM exclusive test') File "test_yumparser.py", line 36, in _is_yum_distro inst = model.Model('test:///default') File "/home/harshal/git/kimchi/src/kimchi/model/model.py", line 32, in __init__ self.objstore = ObjectStore(objstore_loc) File "/home/harshal/git/kimchi/src/kimchi/objectstore.py", line 90, in __init__ self._init_db() File "/home/harshal/git/kimchi/src/kimchi/objectstore.py", line 93, in _init_db conn = self._get_conn() File "/home/harshal/git/kimchi/src/kimchi/objectstore.py", line 116, in _get_conn timeout=10) sqlite3.OperationalError: unable to open database file
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
participants (2)
-
Aline Manera
-
Harshal Patil