Revision b15d625f test/ganeti.utils_unittest.py
b/test/ganeti.utils_unittest.py | ||
---|---|---|
533 | 533 |
|
534 | 534 |
def testTcpPingToLocalHostAccept(self): |
535 | 535 |
self.assert_(TcpPing(constants.LOCALHOST_IP_ADDRESS, |
536 |
constants.LOCALHOST_IP_ADDRESS, |
|
537 | 536 |
self.listenerport, |
538 | 537 |
timeout=10, |
539 |
live_port_needed=True), |
|
538 |
live_port_needed=True, |
|
539 |
source=constants.LOCALHOST_IP_ADDRESS, |
|
540 |
), |
|
540 | 541 |
"failed to connect to test listener") |
541 | 542 |
|
543 |
self.assert_(TcpPing(constants.LOCALHOST_IP_ADDRESS, |
|
544 |
self.listenerport, |
|
545 |
timeout=10, |
|
546 |
live_port_needed=True, |
|
547 |
), |
|
548 |
"failed to connect to test listener (no source)") |
|
549 |
|
|
542 | 550 |
|
543 | 551 |
class TestTcpPingDeaf(unittest.TestCase): |
544 | 552 |
"""Testcase for TCP version of ping - against non listen(2)ing port""" |
... | ... | |
554 | 562 |
|
555 | 563 |
def testTcpPingToLocalHostAcceptDeaf(self): |
556 | 564 |
self.failIf(TcpPing(constants.LOCALHOST_IP_ADDRESS, |
557 |
constants.LOCALHOST_IP_ADDRESS, |
|
558 | 565 |
self.deaflistenerport, |
559 | 566 |
timeout=constants.TCP_PING_TIMEOUT, |
560 |
live_port_needed=True), # need successful connect(2) |
|
567 |
live_port_needed=True, |
|
568 |
source=constants.LOCALHOST_IP_ADDRESS, |
|
569 |
), # need successful connect(2) |
|
561 | 570 |
"successfully connected to deaf listener") |
562 | 571 |
|
572 |
self.failIf(TcpPing(constants.LOCALHOST_IP_ADDRESS, |
|
573 |
self.deaflistenerport, |
|
574 |
timeout=constants.TCP_PING_TIMEOUT, |
|
575 |
live_port_needed=True, |
|
576 |
), # need successful connect(2) |
|
577 |
"successfully connected to deaf listener (no source addr)") |
|
578 |
|
|
563 | 579 |
def testTcpPingToLocalHostNoAccept(self): |
564 | 580 |
self.assert_(TcpPing(constants.LOCALHOST_IP_ADDRESS, |
565 |
constants.LOCALHOST_IP_ADDRESS, |
|
566 | 581 |
self.deaflistenerport, |
567 | 582 |
timeout=constants.TCP_PING_TIMEOUT, |
568 |
live_port_needed=False), # ECONNREFUSED is OK |
|
583 |
live_port_needed=False, |
|
584 |
source=constants.LOCALHOST_IP_ADDRESS, |
|
585 |
), # ECONNREFUSED is OK |
|
569 | 586 |
"failed to ping alive host on deaf port") |
570 | 587 |
|
588 |
self.assert_(TcpPing(constants.LOCALHOST_IP_ADDRESS, |
|
589 |
self.deaflistenerport, |
|
590 |
timeout=constants.TCP_PING_TIMEOUT, |
|
591 |
live_port_needed=False, |
|
592 |
), # ECONNREFUSED is OK |
|
593 |
"failed to ping alive host on deaf port (no source addr)") |
|
594 |
|
|
571 | 595 |
|
572 | 596 |
class TestListVisibleFiles(unittest.TestCase): |
573 | 597 |
"""Test case for ListVisibleFiles""" |
Also available in: Unified diff