Ticket #3505 (closed defect: Fixed)

Opened 5 months ago

Last modified 4 weeks ago

Three unit tests in testDevice.TestDevice fail

Reported by: ian Owned by: ian
Priority: 2 - High Milestone: Blue Crab
Component: ZenModel Version: 2.2.3
Keywords: zenoss-2.2.4-verified Cc:
Community Patch Attached: Deployed @ Customer:
Installer: Any/All Maintenance Target:
Specific ZenPack: Maintenance Status:
Documentation Note?: Not required Regression:

Description

The problem is in checkDeviceExists, which should only do findDevice(ip) if ip exists. Since ip is empty, it returns the first device in the index.

======================================================================
ERROR: testManage_createDeviceDup (tests.testDevice.TestDevice)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Users/ian/zenoss/lib/python/Testing/ZopeTestCase/profiler.py", line 98, in __call__
  File "/Users/ian/src/zenoss/trunk/Products/ZenModel/tests/testDevice.py", line 56, in testManage_createDeviceDup
    dev = manage_createDevice(self.dmd, 'mydevice', '/', manageIp='1.1.1.1')
  File "/Users/ian/zenoss/Products/ZenModel/Device.py", line 102, in manage_createDevice
    checkDeviceExists(context, deviceName, manageIp, performanceMonitor)
  File "/Users/ian/zenoss/Products/ZenModel/Device.py", line 81, in checkDeviceExists
    raise DeviceExistsError("Manage IP %s already exists" % deviceName,ip)
DeviceExistsError: Manage IP mydevice already exists

----------------------------------------------------------------------
Ran 42 tests in 227.024s

FAILED (errors=2)

Attachments

3505.patch (0.9 kB) - added by ian 5 months ago.
Proposed fix

Change History

Changed 5 months ago by ian

Proposed fix

Changed 5 months ago by ian

  • status changed from new to closed
  • resolution set to fixed

(In [9761]) * Fixes #3505. Approved by ECN.

Changed 5 months ago by bbibeault

  • reviewed changed from 0 to 1

Changed 5 months ago by ian

(In [9787]) * Refs #3505: Cleaned up previous code a bit.

Changed 5 months ago by ian

(In [9788]) * Refs #3505: Backporting 9761 9787 to the zenoss-2.2.x branch

Changed 5 months ago by ian

  • keywords zenoss-2.2.4-patched added; zenoss-2.2.4-proposed removed

Changed 5 months ago by ian

(In [9789]) * Refs #3505: Stupid typo, I am dumb

Changed 5 months ago by ian

(In [9790]) * Refs #3505: Backporting 9789 into the zenoss-2.2.x branch

Changed 4 months ago by bedwards

  • keywords zenoss-2.2.4-verified added; zenoss-2.2.4-patched removed

Changed 4 weeks ago by bbibeault

  • installer set to Any/All
  • milestone changed from zenoss-2.3 to Blue Crab
Note: See TracTickets for help on using tickets.