コード例 #1
0
ファイル: test_network_utils.py プロジェクト: vanyell/monkey
 def test_get_host_from_network_location(self):
     assert get_host_from_network_location("127.0.0.1:12345") == "127.0.0.1"
     assert get_host_from_network_location("127.0.0.1:12345") == "127.0.0.1"
     assert get_host_from_network_location("127.0.0.1") == "127.0.0.1"
     assert get_host_from_network_location(
         "www.google.com:8080") == "www.google.com"
     assert get_host_from_network_location(
         "user:password@host:8080") == "host"
コード例 #2
0
ファイル: monkey.py プロジェクト: zkbupt/monkey
 def is_started_on_island(self):
     island_ip = get_host_from_network_location(self._default_server)
     return is_running_on_server(
         island_ip
     ) and WormConfiguration.depth == WormConfiguration.max_depth
コード例 #3
0
def is_running_on_island():
    current_server_without_port = get_host_from_network_location(WormConfiguration.current_server)
    running_on_island = is_running_on_server(current_server_without_port)
    return running_on_island and WormConfiguration.depth == WormConfiguration.max_depth