KVM-VMI / nitro

GNU General Public License v3.0
46 stars 11 forks source link

#28 Unit tests #35

Closed Soft closed 6 years ago

Soft commented 7 years ago

This pull requests contains some basic unit tests for the Linux backend. This should fix #28. I was thinking that I could setup a Travis job for running these. Is that something we would like to have?

Soft commented 7 years ago

Travis integration added! Build Status

Wenzel commented 7 years ago

Hi Soft,

Yes a Travis integration would be great. And actually, you already did it :)

Wenzel commented 6 years ago

I have still one test which not passing:

$ cd nitro/test/unittests
$ nose2-3
..E...
======================================================================
ERROR: test_check_caches_flushed (test_linux.TestLinux)
Check that libvmi caches are flushed.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wenzel/kvm-vmi/nitro/tests/unittests/test_linux.py", line 134, in test_check_caches_flushed
    libvmi.v2pcache_flush.assert_called_once()
  File "/usr/lib/python3.5/unittest/mock.py", line 583, in __getattr__
    raise AttributeError(name)
AttributeError: assert_called_once

----------------------------------------------------------------------
Ran 6 tests in 0.004s

FAILED (errors=1)
Wenzel commented 6 years ago

@Soft Can you reproduce the test which is failing on my environment ? Are all the tests passing for you ?

Soft commented 6 years ago

@Wenzel: Hmm, weird, the test is working fine for me

Soft commented 6 years ago

Maybe now, I seems assert_called_once was added in 3.6

Wenzel commented 6 years ago

Ok, now it works for me also. I will check the tests and the code.

Wenzel commented 6 years ago

There is a conflict with travis.yml, could you rebase on master please ?