diff --git a/src/kvm_websocket_test.cpp b/src/kvm_websocket_test.cpp
deleted file mode 100644
index c01b7e5..0000000
--- a/src/kvm_websocket_test.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-#include "crow.h"
-
-#include "gzip_helper.hpp"
-#include "web_kvm.hpp"
-
-#include <iostream>
-#include <sstream>
-#include <vector>
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-using namespace crow;
-using namespace testing;
-
-// Tests static files are loaded correctly
-TEST(Kvm, BasicRfb)
-{
-    return; // TODO(ed) Make the code below work again
-    SimpleApp app;
-
-    crow::kvm::requestRoutes(app);
-    app.bindaddr("127.0.0.1").port(45451);
-    BMCWEB_ROUTE(app, "/")([]() { return boost::beast::http::status::ok; });
-    auto _ = async(std::launch::async, [&] { app.run(); });
-    auto routes = app.getRoutes();
-    asio::io_context is;
-
-    {
-        // Retry a couple of times waiting for the server to come up
-        // TODO(ed)  This is really unfortunate, and should use some form of
-        // mock
-        asio::ip::tcp::socket c(is);
-        for (int i = 0; i < 200; i++)
-        {
-            try
-            {
-                c.connect(asio::ip::tcp::endpoint(
-                    asio::ip::address::from_string("127.0.0.1"), 45451));
-                c.close();
-                break;
-            }
-            catch (const std::exception& e)
-            {
-                // do nothing.  We expect this to fail while the server is
-                // starting up
-            }
-        }
-    }
-
-    // Get the websocket
-    std::string sendmsg = ("GET /kvmws HTTP/1.1\r\n"
-                           "Host: localhost:45451\r\n"
-                           "Connection: Upgrade\r\n"
-                           "Upgrade: websocket\r\n"
-                           "Sec-WebSocket-Version: 13\r\n"
-                           "Sec-WebSocket-Key: aLeGkmLPZmdv5tTyEpJ3jQ==\r\n"
-                           "Sec-WebSocket-Extensions: permessage-deflate; "
-                           "client_max_window_bits\r\n"
-                           "Sec-WebSocket-Protocol: binary\r\n"
-                           "\r\n");
-
-    asio::ip::tcp::socket socket(is);
-    socket.connect(asio::ip::tcp::endpoint(
-        asio::ip::address::from_string("127.0.0.1"), 45451));
-    socket.send(asio::buffer(sendmsg));
-
-    // Read the Response status line. The Response streambuf will automatically
-    // grow to accommodate the entire line. The growth may be limited by passing
-    // a maximum size to the streambuf constructor.
-    boost::asio::streambuf response;
-    boost::asio::read_until(socket, response, "\r\n");
-
-    // Check that Response is OK.
-    std::istream response_stream(&response);
-    std::string http_response;
-    std::getline(response_stream, http_response);
-
-    EXPECT_EQ(http_response, "HTTP/1.1 101 Switching Protocols\r");
-
-    // Read the Response headers, which are terminated by a blank line.
-    boost::asio::read_until(socket, response, "\r\n\r\n");
-
-    // Process the Response headers.
-    std::string header;
-    std::vector<std::string> headers;
-    while (std::getline(response_stream, header) && header != "\r")
-    {
-        headers.push_back(header);
-    }
-
-    EXPECT_THAT(headers, Contains("Upgrade: websocket\r"));
-    EXPECT_THAT(headers, Contains("Connection: Upgrade\r"));
-    EXPECT_THAT(headers, Contains("Sec-WebSocket-Protocol: binary\r"));
-    // TODO(ed) This is the result that it gives today.  Need to check websocket
-    // docs and make
-    // sure that this calclution is actually being done to spec
-    EXPECT_THAT(
-        headers,
-        Contains("Sec-WebSocket-Accept: /CnDM3l79rIxniLNyxMryXbtLEU=\r"));
-    std::array<char, 13> rfb_open_string;
-
-    //
-    // socket.receive(rfb_open_string.data(), rfb_open_string.size());
-    boost::asio::read(socket, boost::asio::buffer(rfb_open_string));
-    auto open_string =
-        std::string(std::begin(rfb_open_string), std::end(rfb_open_string));
-    // Todo(ed) find out what the two characters at the end of the websocket
-    // stream are
-    open_string = open_string.substr(2);
-    EXPECT_EQ(open_string, "RFB 003.008");
-
-    app.stop();
-}
