Comment 0 for bug 1833634

norman shen (jshen28) wrote :

tests under tests/unit/netmiko failed to run by itself.

root@:~/networking-generic-switch# stestr run --test-path networking_generic_switch/tests/unit/netmiko/

=========================
Failures during discovery
=========================
--- import errors ---
Failed to import test module: networking_generic_switch.tests.unit.netmiko.test_arista_eos
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "networking_generic_switch/tests/unit/netmiko/test_arista_eos.py", line 17, in <module>
    from networking_generic_switch.devices.netmiko_devices import arista
  File "networking_generic_switch/devices/netmiko_devices/__init__.py", line 19, in <module>
    import netmiko
ImportError: No module named netmiko

Failed to import test module: networking_generic_switch.tests.unit.netmiko.test_brocade_fastiron
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "networking_generic_switch/tests/unit/netmiko/test_brocade_fastiron.py", line 19, in <module>
    from networking_generic_switch.devices.netmiko_devices import brocade
  File "networking_generic_switch/devices/netmiko_devices/__init__.py", line 19, in <module>
    import netmiko
ImportError: No module named netmiko

Failed to import test module: networking_generic_switch.tests.unit.netmiko.test_cisco_300
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "networking_generic_switch/tests/unit/netmiko/test_cisco_300.py", line 17, in <module>
    from networking_generic_switch.devices.netmiko_devices import cisco300 as cisco
  File "networking_generic_switch/devices/netmiko_devices/__init__.py", line 19, in <module>
    import netmiko
ImportError: No module named netmiko

Failed to import test module: networking_generic_switch.tests.unit.netmiko.test_cisco_ios
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "networking_generic_switch/tests/unit/netmiko/test_cisco_ios.py", line 17, in <module>
    from networking_generic_switch.devices.netmiko_devices import cisco
  File "networking_generic_switch/devices/netmiko_devices/__init__.py", line 19, in <module>
    import netmiko
ImportError: No module named netmiko

Failed to import test module: networking_generic_switch.tests.unit.netmiko.test_dell
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "networking_generic_switch/tests/unit/netmiko/test_dell.py", line 17, in <module>
    from networking_generic_switch.devices.netmiko_devices import dell
  File "networking_generic_switch/devices/netmiko_devices/__init__.py", line 19, in <module>
    import netmiko
ImportError: No module named netmiko

Failed to import test module: networking_generic_switch.tests.unit.netmiko.test_huawei
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "networking_generic_switch/tests/unit/netmiko/test_huawei.py", line 17, in <module>
    from networking_generic_switch.devices.netmiko_devices import huawei
  File "networking_generic_switch/devices/netmiko_devices/__init__.py", line 19, in <module>
    import netmiko
ImportError: No module named netmiko

Failed to import test module: networking_generic_switch.tests.unit.netmiko.test_huawei_vrpv8
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "networking_generic_switch/tests/unit/netmiko/test_huawei_vrpv8.py", line 17, in <module>
    from networking_generic_switch.devices.netmiko_devices import huawei_vrpv8
  File "networking_generic_switch/devices/netmiko_devices/__init__.py", line 19, in <module>
    import netmiko
ImportError: No module named netmiko

Failed to import test module: networking_generic_switch.tests.unit.netmiko.test_netmiko_base
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "networking_generic_switch/tests/unit/netmiko/test_netmiko_base.py", line 17, in <module>
    import netmiko
ImportError: No module named netmiko

Failed to import test module: networking_generic_switch.tests.unit.netmiko.test_ovs_linux
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "networking_generic_switch/tests/unit/netmiko/test_ovs_linux.py", line 17, in <module>
    from networking_generic_switch.devices.netmiko_devices import ovs
  File "networking_generic_switch/devices/netmiko_devices/__init__.py", line 19, in <module>
    import netmiko
ImportError: No module named netmiko

================================================================================
The above traceback was encountered during test discovery which imports all the found test modules in the specified test_path.
root@ecs-2019616124656:~/networking-generic-switch# stestr run --test-path networking_generic_switch/tests/unit/netmiko/test_cisco_300.py
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, 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/local/lib/python2.7/dist-packages/subunit/run.py", line 149, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/subunit/run.py", line 145, in main
    stdout=stdout, exit=False)
  File "/usr/local/lib/python2.7/dist-packages/testtools/run.py", line 171, in __init__
    self.parseArgs(argv)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/main.py", line 113, in parseArgs
    self._do_discovery(argv[2:])
  File "/usr/local/lib/python2.7/dist-packages/testtools/run.py", line 211, in _do_discovery
    super(TestProgram, self)._do_discovery(argv, Loader=Loader)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/main.py", line 223, in _do_discovery
    self.test = loader.discover(self.start, self.pattern, self.top)
  File "/usr/local/lib/python2.7/dist-packages/unittest2/loader.py", line 364, in discover
    raise ImportError('Start directory is not importable: %r' % start_dir)
ImportError: Start directory is not importable: 'networking_generic_switch/tests/unit/netmiko/test_cisco_300.py'

=========================
Failures during discovery
=========================