Skip to content

Commit c36d730

Browse files
committed
Reverted redundant test
1 parent e578604 commit c36d730

File tree

2 files changed

+0
-86
lines changed

2 files changed

+0
-86
lines changed

xds/src/test/java/io/grpc/xds/XdsSecurityClientServerTest.java

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@
5151
import io.grpc.Status;
5252
import io.grpc.StatusOr;
5353
import io.grpc.StatusRuntimeException;
54-
import io.grpc.TlsServerCredentials;
5554
import io.grpc.stub.StreamObserver;
5655
import io.grpc.testing.GrpcCleanupRule;
57-
import io.grpc.testing.TlsTesting;
5856
import io.grpc.testing.protobuf.SimpleRequest;
5957
import io.grpc.testing.protobuf.SimpleResponse;
6058
import io.grpc.testing.protobuf.SimpleServiceGrpc;
@@ -515,36 +513,6 @@ public void mtlsClientServer_changeServerContext_expectException()
515513
}
516514
}
517515

518-
@Test
519-
public void mtlsClientServer_withClientAuthentication_withTlsChannelCredsFromBootstrap()
520-
throws Exception {
521-
final String mtlsCertProviderInstanceName = "mtls_channel_creds_identity_certs";
522-
523-
UpstreamTlsContext upstreamTlsContext =
524-
setBootstrapInfoWithMTlsChannelCredsAndBuildUpstreamTlsContext(
525-
mtlsCertProviderInstanceName, CLIENT_KEY_FILE, CLIENT_PEM_FILE, CA_PEM_FILE);
526-
527-
DownstreamTlsContext downstreamTlsContext =
528-
setBootstrapInfoWithMTlsChannelCredsAndBuildDownstreamTlsContext(
529-
mtlsCertProviderInstanceName, SERVER_1_KEY_FILE, SERVER_1_PEM_FILE, CA_PEM_FILE);
530-
531-
ServerCredentials serverCreds = TlsServerCredentials.newBuilder()
532-
.keyManager(TlsTesting.loadCert(SERVER_1_PEM_FILE), TlsTesting.loadCert(SERVER_1_KEY_FILE))
533-
.trustManager(TlsTesting.loadCert(CA_PEM_FILE))
534-
.clientAuth(TlsServerCredentials.ClientAuth.REQUIRE)
535-
.build();
536-
537-
buildServer(
538-
XdsServerBuilder.forPort(0, serverCreds)
539-
.xdsClientPoolFactory(fakePoolFactory)
540-
.addService(new SimpleServiceImpl()),
541-
downstreamTlsContext);
542-
543-
SimpleServiceGrpc.SimpleServiceBlockingStub blockingStub =
544-
getBlockingStub(upstreamTlsContext, OVERRIDE_AUTHORITY);
545-
assertThat(unaryRpc("buddy", blockingStub)).isEqualTo("Hello buddy");
546-
}
547-
548516
private void performMtlsTestAndGetListenerWatcher(
549517
UpstreamTlsContext upstreamTlsContext, String certInstanceName2,
550518
String privateKey2, String cert2, String trustCa2)
@@ -605,22 +573,6 @@ private UpstreamTlsContext setBootstrapInfoAndBuildUpstreamTlsContextForUsingSys
605573
.build());
606574
}
607575

608-
private UpstreamTlsContext setBootstrapInfoWithMTlsChannelCredsAndBuildUpstreamTlsContext(
609-
String instanceName, String clientKeyFile, String clientPemFile, String caCertFile) {
610-
bootstrapInfoForClient = CommonBootstrapperTestUtils
611-
.buildBootstrapInfoForMTlsChannelCredentialServerInfo(
612-
instanceName, clientKeyFile, clientPemFile, caCertFile);
613-
return CommonTlsContextTestsUtil.buildUpstreamTlsContext(instanceName, true);
614-
}
615-
616-
private DownstreamTlsContext setBootstrapInfoWithMTlsChannelCredsAndBuildDownstreamTlsContext(
617-
String instanceName, String serverKeyFile, String serverPemFile, String caCertFile) {
618-
bootstrapInfoForServer = CommonBootstrapperTestUtils
619-
.buildBootstrapInfoForMTlsChannelCredentialServerInfo(
620-
instanceName, serverKeyFile, serverPemFile, caCertFile);
621-
return CommonTlsContextTestsUtil.buildDownstreamTlsContext(instanceName, true, true);
622-
}
623-
624576
private void buildServerWithTlsContext(DownstreamTlsContext downstreamTlsContext)
625577
throws Exception {
626578
buildServerWithTlsContext(downstreamTlsContext, InsecureServerCredentials.create());

xds/src/test/java/io/grpc/xds/client/CommonBootstrapperTestUtils.java

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@
2020
import com.google.common.collect.ImmutableMap;
2121
import io.grpc.ChannelCredentials;
2222
import io.grpc.InsecureChannelCredentials;
23-
import io.grpc.TlsChannelCredentials;
2423
import io.grpc.internal.BackoffPolicy;
2524
import io.grpc.internal.FakeClock;
2625
import io.grpc.internal.JsonParser;
2726
import io.grpc.xds.client.Bootstrapper.ServerInfo;
2827
import io.grpc.xds.internal.security.CommonTlsContextTestsUtil;
2928
import io.grpc.xds.internal.security.TlsContextManagerImpl;
30-
import java.io.File;
3129
import java.io.IOException;
3230
import java.util.ArrayList;
3331
import java.util.HashMap;
@@ -162,42 +160,6 @@ public static Bootstrapper.BootstrapInfo buildBootstrapInfo(
162160
.build();
163161
}
164162

165-
public static Bootstrapper.BootstrapInfo buildBootstrapInfoForMTlsChannelCredentialServerInfo(
166-
String instanceName, String privateKey, String cert, String trustCa) {
167-
try {
168-
privateKey = CommonTlsContextTestsUtil.getTempFileNameForResourcesFile(privateKey);
169-
cert = CommonTlsContextTestsUtil.getTempFileNameForResourcesFile(cert);
170-
trustCa = CommonTlsContextTestsUtil.getTempFileNameForResourcesFile(trustCa);
171-
} catch (IOException ioe) {
172-
throw new RuntimeException(ioe);
173-
}
174-
175-
HashMap<String, String> config = new HashMap<>();
176-
config.put("certificate_file", cert);
177-
config.put("private_key_file", privateKey);
178-
config.put("ca_certificate_file", trustCa);
179-
180-
ChannelCredentials creds;
181-
try {
182-
creds = TlsChannelCredentials.newBuilder()
183-
.customCertificatesConfig(config)
184-
.keyManager(new File(cert), new File(privateKey))
185-
.trustManager(new File(trustCa))
186-
.build();
187-
} catch (IOException ioe) {
188-
throw new RuntimeException(ioe);
189-
}
190-
191-
// config for tls channel credentials and for certificate provider are the same
192-
return Bootstrapper.BootstrapInfo.builder()
193-
.servers(ImmutableList.<ServerInfo>of(ServerInfo.create(SERVER_URI, creds)))
194-
.node(EnvoyProtoData.Node.newBuilder().build())
195-
.certProviders(ImmutableMap.of(
196-
instanceName,
197-
Bootstrapper.CertificateProviderInfo.create("file_watcher", config)))
198-
.build();
199-
}
200-
201163
public static boolean setEnableXdsFallback(boolean target) {
202164
boolean oldValue = BootstrapperImpl.enableXdsFallback;
203165
BootstrapperImpl.enableXdsFallback = target;

0 commit comments

Comments
 (0)