cyborg/cyborg/tests/unit
chenke c9277285a3 Fix method 'test_discover' assertError in test_driver.py
The error info as follows:

testtools.matchers._impl.MismatchError: !=:
reference = {'cpid_info': '0000:5e:00.0', 'cpid_type': 'pci'}
actual    = {'cpid_info': u'0000:be:00.0', 'cpid_type': u'pci'}

The reason for assertError is that 'intel-fpga-dev.2' is found
earilier than 'intel-fpga-dev.1' randomly because of the module
'glob.glob'.

In cyborg/accelerator/drivers/fpga/intel/sysinfo.py Line 81,
method all_pf_fpgas(), it use glob.glob(..) to find fpga dirvers.
However, this glob module does not guarantee that the file name
obtained is ordered.

For convenience, we can sort the fpgas before assert.

Reference docs:
https://docs.python.org/2.7/library/glob.html?highlight=glob#glob.glob
https://docs.python.org/2.7/library/os.html?highlight=listdir#os.listdir
http://landcareweb.com/questions/34393/an-ri-qi-shun-xu-sou-suo-glob

Change-Id: Ie9de5d7ec06064f557620ec4ee21f7bd776c2add
2019-03-20 11:47:02 +08:00
..
accelerator Fix method 'test_discover' assertError in test_driver.py 2019-03-20 11:47:02 +08:00
agent Add "Report device data to cyborg" 2018-12-16 18:22:49 +08:00
api Add new DB schema: sqlachemy and alembic scripts. 2019-02-11 23:57:01 -05:00
cmd Add cyborg-status upgrade check command framework 2018-10-26 19:42:43 +05:30
db Bug fix: Change object definition according to the newest DB. 2019-02-27 19:01:04 +08:00
objects Modified the Deployable Object 2019-02-24 14:39:38 -05:00
services Fix Deployable get_by_host 2018-06-04 23:50:22 +08:00
__init__.py add api unit test 2017-09-14 13:56:59 +08:00
fake_accelerator.py Added Unit tests for object Accelerator and Deployable 2018-02-04 18:31:50 -05:00
fake_attribute.py Added attribute object and its unit tests 2018-05-08 23:40:17 -05:00
fake_deployable.py Modified the Deployable Object 2019-02-24 14:39:38 -05:00
fake_device.py Modified the Deployable Object 2019-02-24 14:39:38 -05:00
fake_physical_function.py Add "interface_type" field in deployable DB 2018-07-24 03:57:13 -04:00
fake_virtual_function.py Add "interface_type" field in deployable DB 2018-07-24 03:57:13 -04:00
policy_fixture.py Supplementing accelerator CRUD api 2018-01-14 02:03:24 +08:00
test_hacking.py Improve pep8 checking along with hacking 2018-08-16 17:22:33 +07:00