Ejemplo n.º 1
0
    def test_command_for_docker(self, docker_instance):
        real_select_command = subject.command()

        real_select_command.run_for('node-0')

        self.mock_instance.kill.assert_called_with()
        assert self.mock_docker_instance in subject.DOCKER_INSTANCES
Ejemplo n.º 2
0
    def test_command_for_virtualbox(self, vbox_instance):
        real_select_command = subject.command()

        real_select_command.run_for('node-0')

        self.mock_instance.kill.assert_called_with()
        assert self.mock_vbox_instance in subject.VIRTUALBOX_INSTANCES
Ejemplo n.º 3
0
    def test_command_for_compute(self, compute_instance):
        real_select_command = subject.command()

        real_select_command.run_for('node-0')

        self.mock_instance.kill.assert_called_with()
        assert self.mock_compute_instance in subject.COMPUTE_INSTANCES
Ejemplo n.º 4
0
    def test_command_for_ec2(self, ec2_instance):
        real_select_command = subject.command()

        real_select_command.run_for('node-0')

        self.mock_instance.kill.assert_called_with()
        assert self.mock_ec2_instance in subject.EC2_INSTANCES
Ejemplo n.º 5
0
    def test_command_properties(self):
        real_command = subject.command()

        assert real_command.name == 'kill'
        assert real_command.info == 'shuts down'
Ejemplo n.º 6
0
    ),
    'outbound':
    SelectCommand(
        'outbound', lambda instance: instance.outbound(),
        "finds all the sent Gossip, prompts for which to display, and displays a graph representing the Gossip sent from"
    ),
    'stop':
    SelectCommand('stop', lambda instance: instance.stop_node(),
                  "reverts and stops MASQNode on"),
    finish.name():
    finish.command(),  # always "all"
    'shell':
    SelectCommand('shell', lambda instance: instance.shell(),
                  "opens shell(s) on node instance in terminal window"),
    kill.name():
    kill.command(),
    nfo.name():
    nfo.command(),
    help.name():
    help.command(),
    daisy.name():
    daisy.command(),
    cluster.name():
    cluster.command(),
    'set':
    SetCommand(),
    'binaries':
    binaries_command.BinariesCommand(),

    # TODO status command (finds out which instances are running (checks all platforms), for running instances, determines if node is running on them, if they are subverted, etc)
    # it should not load this state into INSTANCES automatically (multiple pairs could be using different cloud instances, so this should enable coordination)