Skip to content

Commit 31e1c29

Browse files
committed
test fixes
1 parent dec101b commit 31e1c29

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

test/extensions/filters/network/ssh/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ envoy_cc_test_library(
438438

439439
envoy_cc_test(
440440
name = "reverse_tunnel_test",
441+
size = "large",
441442
srcs = [
442443
"reverse_tunnel_test.cc",
443444
],

test/extensions/filters/network/ssh/transport_base_test.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,14 @@ TYPED_TEST_P(TransportBaseTest, TestKexInitFailureAfterVersionExchange) {
576576
TYPED_TEST_P(TransportBaseTest, TestDecryptPacketFailure) {
577577
EXPECT_CALL(this->Client(), onKexStarted(true));
578578
EXPECT_CALL(this->Server(), onKexStarted(true));
579-
EXPECT_CALL(this->Client(), onKexCompleted(_, true));
579+
absl::Notification clientKexCompleted;
580+
EXPECT_CALL(this->Client(), onKexCompleted(_, true))
581+
.WillOnce(Invoke([this, &clientKexCompleted](std::shared_ptr<KexResult> result, bool initial) {
582+
this->Client().TransportBase::onKexCompleted(result, initial);
583+
clientKexCompleted.Notify();
584+
}));
580585
EXPECT_CALL(this->Server(), onKexCompleted(_, true))
581-
.WillOnce(Invoke([this](std::shared_ptr<KexResult> result, bool initial) {
586+
.WillOnce(Invoke([this, &clientKexCompleted](std::shared_ptr<KexResult> result, bool initial) {
582587
this->Server().TransportBase::onKexCompleted(result, initial);
583588
if (result->algorithms.server_to_client.cipher == CipherAES128GCM ||
584589
result->algorithms.server_to_client.cipher == CipherAES256GCM ||
@@ -588,6 +593,9 @@ TYPED_TEST_P(TransportBaseTest, TestDecryptPacketFailure) {
588593
// In AES-GCM, the sequence number is implicitly contained in the cipher IV. The number
589594
// we track ourselves is not used when encrypting and decrypting packets, so changing it
590595
// manually here would not have the desired effect.
596+
597+
// Wait for the client's onKexCompleted, otherwise the expectation will fail
598+
clientKexCompleted.WaitForNotificationWithTimeout(defaultTimeout());
591599
this->Client().Exit();
592600
this->Server().Exit();
593601
GTEST_SKIP() << "not applicable for aes-gcm";

0 commit comments

Comments
 (0)