This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/quic-latest by this push:
new 8c157d7 Remove test_QUICHandshake
8c157d7 is described below
commit 8c157d759b5db530d15a342e7b234c33e961d5fb
Author: Masaori Koshiba <[email protected]>
AuthorDate: Thu Mar 7 10:38:28 2019 +0900
Remove test_QUICHandshake
---
iocore/net/quic/Makefile.am | 8 ---
iocore/net/quic/Mock.h | 48 ---------------
iocore/net/quic/test/test_QUICHandshake.cc | 95 ------------------------------
3 files changed, 151 deletions(-)
diff --git a/iocore/net/quic/Makefile.am b/iocore/net/quic/Makefile.am
index a480ecb..b5b571e 100644
--- a/iocore/net/quic/Makefile.am
+++ b/iocore/net/quic/Makefile.am
@@ -181,14 +181,6 @@ test_QUICLossDetector_SOURCES = \
$(test_event_main_SOURCES) \
./test/test_QUICLossDetector.cc
-# TODO: fix unit test using QUICCryptoStream
-# test_QUICHandshake_CPPFLAGS = $(test_CPPFLAGS)
-# test_QUICHandshake_LDFLAGS = @AM_LDFLAGS@
-# test_QUICHandshake_LDADD = $(test_LDADD)
-# test_QUICHandshake_SOURCES = \
-# $(test_event_main_SOURCES) \
-# ./test/test_QUICHandshake.cc
-
test_QUICHandshakeProtocol_CPPFLAGS = $(test_CPPFLAGS)
test_QUICHandshakeProtocol_LDFLAGS = @AM_LDFLAGS@
test_QUICHandshakeProtocol_LDADD = $(test_LDADD)
diff --git a/iocore/net/quic/Mock.h b/iocore/net/quic/Mock.h
index 7cabff5..6d66dfa 100644
--- a/iocore/net/quic/Mock.h
+++ b/iocore/net/quic/Mock.h
@@ -425,54 +425,6 @@ public:
}
};
-class MockQUICStream : public QUICStream
-{
-public:
- MockQUICStream(QUICRTTProvider *rtt_provider, QUICConnectionInfoProvider
*info, QUICStreamId sid, uint64_t recv_max_stream_data,
- uint64_t send_max_stream_data)
- : QUICStream(info, sid)
- {
- }
-
-private:
- int64_t
- _process_read_vio() override
- {
- return 0;
- }
-
- int64_t
- _process_write_vio() override
- {
- return 0;
- }
-};
-
-class MockQUICStreamIO : public QUICStreamIO
-{
-public:
- MockQUICStreamIO(QUICApplication *app, QUICStream *stream) :
QUICStreamIO(app, stream) {}
- ~MockQUICStreamIO() {}
- int64_t
- transfer()
- {
- int64_t n = this->_write_buffer_reader->read_avail();
- this->_read_buffer->write(this->_write_buffer_reader, n);
- this->_write_buffer_reader->consume(n);
- return n;
- }
-
-private:
- void
- read_reenable() override
- {
- }
- void
- write_reenable() override
- {
- }
-};
-
class MockQUICPacketProtectionKeyInfo : public QUICPacketProtectionKeyInfo
{
public:
diff --git a/iocore/net/quic/test/test_QUICHandshake.cc
b/iocore/net/quic/test/test_QUICHandshake.cc
deleted file mode 100644
index 2043ce2..0000000
--- a/iocore/net/quic/test/test_QUICHandshake.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/** @file
- *
- * A brief file description
- *
- * @section license License
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "catch.hpp"
-
-#include "Mock.h"
-#include "QUICHandshake.h"
-
-#include "./server_cert.h"
-
-TEST_CASE("1-RTT handshake ", "[quic]")
-{
- // setup client
- QUICConnection *client_qc = new MockQUICConnection(NET_VCONNECTION_OUT);
-
- SSL_CTX *client_ssl_ctx = SSL_CTX_new(TLS_method());
- SSL_CTX_set_min_proto_version(client_ssl_ctx, TLS1_3_VERSION);
- SSL_CTX_set_max_proto_version(client_ssl_ctx, TLS1_3_VERSION);
- SSL_CTX_clear_options(client_ssl_ctx, SSL_OP_ENABLE_MIDDLEBOX_COMPAT);
-
- QUICConnectionId client_conn_id = {reinterpret_cast<const uint8_t
*>("\x01\x23\x45"), 3};
-
- QUICHandshake *client = new QUICHandshake(client_qc, client_ssl_ctx);
-
- // setup server
- QUICConnection *server_qc = new MockQUICConnection(NET_VCONNECTION_IN);
-
- SSL_CTX *server_ssl_ctx = SSL_CTX_new(TLS_method());
- SSL_CTX_set_min_proto_version(server_ssl_ctx, TLS1_3_VERSION);
- SSL_CTX_set_max_proto_version(server_ssl_ctx, TLS1_3_VERSION);
- SSL_CTX_clear_options(server_ssl_ctx, SSL_OP_ENABLE_MIDDLEBOX_COMPAT);
- BIO *crt_bio(BIO_new_mem_buf(server_crt, sizeof(server_crt)));
- SSL_CTX_use_certificate(server_ssl_ctx, PEM_read_bio_X509(crt_bio, nullptr,
nullptr, nullptr));
- BIO *key_bio(BIO_new_mem_buf(server_key, sizeof(server_key)));
- SSL_CTX_use_PrivateKey(server_ssl_ctx, PEM_read_bio_PrivateKey(key_bio,
nullptr, nullptr, nullptr));
-
- QUICConnectionId conn_id = QUICConnectionId::ZERO();
- QUICStatelessResetToken server_token;
- server_token.generate(conn_id, 0);
-
- QUICHandshake *server = new QUICHandshake(server_qc, server_ssl_ctx,
server_token, false);
-
- // setup stream 0
- MockQUICRTTProvider rtt;
- MockQUICConnectionInfoProvider info;
- QUICStream *stream = new MockQUICStream(&rtt, &info, 0, UINT64_MAX,
UINT64_MAX);
- MockQUICStreamIO *stream_io = new MockQUICStreamIO(nullptr, stream);
-
- client->set_stream(stream, stream_io);
- server->set_stream(stream, stream_io);
-
- SECTION("Basic Full Handshake")
- {
- // ClientHello
- client->handleEvent(VC_EVENT_WRITE_READY, nullptr);
- CHECK(stream_io->transfer() > 0);
- client->handleEvent(QUIC_EVENT_HANDSHAKE_PACKET_WRITE_COMPLETE, nullptr);
-
- // ServerHello
- server->handleEvent(VC_EVENT_READ_READY, nullptr);
- CHECK(stream_io->transfer() > 0);
-
- client->handleEvent(VC_EVENT_READ_READY, nullptr);
- CHECK(stream_io->transfer() > 0);
- client->handleEvent(QUIC_EVENT_HANDSHAKE_PACKET_WRITE_COMPLETE, nullptr);
-
- // Finished
- server->handleEvent(VC_EVENT_READ_READY, nullptr);
-
- CHECK(client->is_completed());
- CHECK(server->is_completed());
- }
-
- delete stream_io;
-}