def assert_batch(enode, commands, replace=None, shell=None):
    """
    Execute a batch of return-less template commands in the enode shell.

    :param enode:
    :type: topology.platforms.node.BaseNode
    :param str commands: Multiline docstring template with the return-less
     commnads to execute and assert.
    :param dict replace: Namespace to replace tokens in commands.
    :param str shell: Shell name to execute the batch.
    """
    assert commands
    if replace is not None:
        assert isinstance(replace, dict)
        commands = commands.format(**replace)
    for cmd in commands.splitlines():
        cmd = cmd.strip()
        if not cmd:
            continue
        response = enode(cmd, shell=shell)
        assert not response
