@Test
@RequirePcap
@Disabled("Disabled as currently we can't seem to be able to get it working on Jenkins")
public void doConnect() throws Exception {

    Channel channel = null;
    final EventLoopGroup workerGroup = new OioEventLoopGroup();
    try {
        Bootstrap bootstrap = new Bootstrap();
        bootstrap.group(workerGroup);
        bootstrap.channel(RawSocketChannel.class);
        // TODO we should use an explicit (configurable?) timeout here
        // bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 1000);
        bootstrap.handler(new ChannelInitializer<RawSocketChannel>() {
            @Override
            protected void initChannel(RawSocketChannel ch) throws Exception {
                System.out.println("Initialize Buffer!");
                ch.pipeline().addLast(new ChannelInboundHandlerAdapter(){
                    @Override
                    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
                        System.out.println(ByteBufUtil.prettyHexDump(((ByteBuf) msg)));
                    }
                });
                ch.pipeline().addLast(new ChannelHandlerAdapter() {
                    @Override
                    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
                        cause.printStackTrace();
                    }
                });
            }
        });
        // Start the client.
        PcapNetworkInterface loopbackDevice = Pcaps.findAllDevs().stream().filter(
            PcapNetworkInterface::isLoopBack).findFirst().orElse(null);
        assertNotNull(loopbackDevice);
        final ChannelFuture f = bootstrap.connect(new RawSocketAddress(loopbackDevice.getName()));
        // Wait for sync
        f.sync();
        // Wait till the session is finished initializing.
        channel = f.channel();
        System.out.println("Channel is connected and ready to use...");
        channel.writeAndFlush(Unpooled.wrappedBuffer("Hallo".getBytes()));
        // Prepare something to read
        Thread.sleep(10_000);
    } finally {
        if (channel != null) {
            channel.close().sync();
        }
        workerGroup.shutdownGracefully().sync();
    }
}