Skip to content

Commit 826813f

Browse files
committed
Reverted redundant test
1 parent 8cbe32d commit 826813f

File tree

2 files changed

+0
-87
lines changed

2 files changed

+0
-87
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 & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@
1818

1919
import com.google.common.collect.ImmutableList;
2020
import com.google.common.collect.ImmutableMap;
21-
import io.grpc.ChannelCredentials;
22-
import io.grpc.TlsChannelCredentials;
2321
import io.grpc.internal.BackoffPolicy;
2422
import io.grpc.internal.FakeClock;
2523
import io.grpc.internal.JsonParser;
2624
import io.grpc.xds.client.Bootstrapper.ServerInfo;
2725
import io.grpc.xds.internal.security.CommonTlsContextTestsUtil;
2826
import io.grpc.xds.internal.security.TlsContextManagerImpl;
29-
import java.io.File;
3027
import java.io.IOException;
3128
import java.util.ArrayList;
3229
import java.util.HashMap;
@@ -160,42 +157,6 @@ public static Bootstrapper.BootstrapInfo buildBootstrapInfo(
160157
.build();
161158
}
162159

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

0 commit comments

Comments
 (0)