| | 311 | |
|---|
| | 312 | # Verify the has_inventory? method |
|---|
| | 313 | |
|---|
| | 314 | def test_has_inventory |
|---|
| | 315 | |
|---|
| | 316 | new_device = Device.new |
|---|
| | 317 | assert(!new_device.has_inventory?, "A new device should not have an inventory") |
|---|
| | 318 | |
|---|
| | 319 | device = devices(:test_device_1) |
|---|
| | 320 | assert(device.has_inventory?, "The device 'test_device_1' should have an inventory") |
|---|
| | 321 | |
|---|
| | 322 | end |
|---|
| | 323 | |
|---|
| | 324 | |
|---|
| | 325 | # Verify the get_table method |
|---|
| | 326 | |
|---|
| | 327 | def test_get_table |
|---|
| | 328 | |
|---|
| | 329 | snmp_test_device = devices(:snmp_test_device) |
|---|
| | 330 | iftable = snmp_test_device.get_table('ifTable') |
|---|
| | 331 | |
|---|
| | 332 | # TODO: Check the format of the returned data |
|---|
| | 333 | |
|---|
| | 334 | original_proxy_port = APP_CONFIG['snmpproxy']['port'] |
|---|
| | 335 | APP_CONFIG['snmpproxy']['port'] = 1 |
|---|
| | 336 | |
|---|
| | 337 | # TODO: Check an SNMP proxy request on an invalid port |
|---|
| | 338 | |
|---|
| | 339 | APP_CONFIG['snmpproxy']['port'] = original_proxy_port |
|---|
| | 340 | |
|---|
| | 341 | end |
|---|
| | 342 | |
|---|
| | 343 | |
|---|
| | 344 | # Verify the get_oid method |
|---|
| | 345 | |
|---|
| | 346 | def test_get_oid |
|---|
| | 347 | |
|---|
| | 348 | snmp_test_device = devices(:snmp_test_device) |
|---|
| | 349 | sysname_unformatted = snmp_test_device.get_oid([['sysName.0']], { :format => :no }) |
|---|
| | 350 | |
|---|
| | 351 | # TODO: Check the format of the returned data |
|---|
| | 352 | |
|---|
| | 353 | sysname_formatted = snmp_test_device.get_oid([['sysName.0']], { :format => :yes }) |
|---|
| | 354 | |
|---|
| | 355 | end |
|---|
| | 356 | |
|---|