Пример #1
0
def machines_started_at_the_same_time_can_access_each_other_directly_by_name():
    requests = [
        peachtree.request_machine("first", image_name=_IMAGE_NAME),
        peachtree.request_machine("second", image_name=_IMAGE_NAME),
    ]
    with provider_with_user_networking() as provider:
        with provider.start_many(requests) as machines:
            first_machine, second_machine = machines[0], machines[1]
            first_machine.shell().run(["ping", "second", "-c1"])
Пример #2
0
def windows_machines_can_join_virtual_network():
    requests = [
        peachtree.request_machine("linux", image_name=_IMAGE_NAME),
        peachtree.request_machine("windows", image_name=_WINDOWS_IMAGE_NAME),
    ]
    with provider_with_user_networking() as provider:
        with provider.start_many(requests) as machines:
            # TODO: change to machines["windows"]
            windows_machine = machines[1]
            windows_machine.shell().run(["ping", "linux", "-n", "1"])
Пример #3
0
def can_start_multiple_machines(provider):
    requests = [
        peachtree.request_machine("first", image_name=_IMAGE_NAME),
        peachtree.request_machine("second", image_name=_IMAGE_NAME),
    ]
    with provider.start_many(requests) as machines:
        _assert_can_run_commands_on_machine(machines[0])
        _assert_can_run_commands_on_machine(machines[1])
        _assert_can_run_commands_on_machine(machines["first"])
        _assert_can_run_commands_on_machine(machines["second"])