ansible/test/units
Adrian Likins 7bd57acda4 Linux mount/fs (lsblk) facts fixes and tests. (#17036)
Fixes #10779

Refactor some of the block device, mount point, and
mtab/fstab facts collection for linux for better
performance on systems with lots of block devices.

Instead of invoking 'lsblk' for every entry in mtab,
invoke it once, then map the results to mtab entries.

Change the args used for invoking 'findmnt' since the
previous combination of args conflicts, so this would
always fail on some systems depending on version.

Add test cases for facts Hardware()/Network()/Virtual() classes
__new__ method and verify they create the proper subclass based
on the platform.system() results.

Split out all the 'invoke some command and grab it's output'
bits related to linux mount paths into their own methods so
it is easier to mock them in unit tests.

Fix the DragonFly* classes that did not defined a 'platform'
class attribute. This caused FreeBSD systems to potentially
get the DragonFly* subclasses incorrectly. In practice it
didnt matter much since the DragonFly* subclasses duplicated
the FreeBSD ones. Actual DragonFly systems would end up with
the generic Hardware() etc instead of the DragonFly* classes.

Fix Hardware.__new__() on PY3, passing args to __new__
would cause "object() takes no parameters" errors. So
check for PY3 and just call __new__ without the args

See
https://hg.python.org/cpython/file/44ed0cd3dc6d/Objects/typeobject.c#l2818
for some explaination.
2016-08-17 17:58:51 -07:00
..
cli Test GalaxyCLI when no actions are provided 2016-07-22 14:39:01 -04:00
contrib Add a new vmware inventory script backed by pyvmomi (#15967) 2016-05-30 20:41:48 -04:00
errors Relocate use of ERROR to display class, to avoid doubling up 2016-01-19 12:10:39 -05:00
executor Cache tasks by uuid in PlayIterator for O(1) lookups 2016-08-10 12:49:19 -05:00
inventory Changing up how host (in)equality is checked 2015-12-04 12:57:46 -05:00
inventory_test_data/group_vars Merge branch 'v2_final' into devel_switch_v2 2015-05-28 15:26:03 -05:00
mock A little unittest refactoring (#16704) 2016-07-14 09:22:54 -07:00
module_utils Linux mount/fs (lsblk) facts fixes and tests. (#17036) 2016-08-17 17:58:51 -07:00
modules docker was deprecated, test now reflects new name 2016-05-26 09:12:23 -04:00
parsing New unit tests for #13630 fix 2016-03-28 15:54:07 -04:00
playbook Fix mock loader for osx /etc symlinks (#16074) 2016-05-31 18:02:39 -04:00
plugins fixed tests to accoutn for new parameter 2016-08-16 13:11:58 -04:00
template Cleaning up FIXMEs 2015-10-22 16:03:50 -04:00
utils FEATURE: adding variable serial batches 2016-08-04 15:04:10 -05:00
vars Adding unit tests for role variable precedence 2016-07-20 10:14:44 -04:00
__init__.py Making the switch to v2 2015-05-03 21:47:26 -05:00