|
3 | 3 | import com.datastax.oss.driver.api.core.CqlSession; |
4 | 4 | import com.datastax.oss.driver.api.core.cql.ResultSet; |
5 | 5 | import org.junit.Test; |
| 6 | +import org.testcontainers.containers.Container; |
6 | 7 | import org.testcontainers.utility.DockerImageName; |
| 8 | +import org.testcontainers.utility.MountableFile; |
7 | 9 | import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; |
8 | 10 | import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; |
9 | 11 | import software.amazon.awssdk.regions.Region; |
@@ -62,7 +64,7 @@ public void testSimple() { |
62 | 64 |
|
63 | 65 | @Test |
64 | 66 | public void testSimpleSsl() |
65 | | - throws NoSuchAlgorithmException, KeyStoreException, IOException, CertificateException, UnrecoverableKeyException, KeyManagementException { |
| 67 | + throws InterruptedException, NoSuchAlgorithmException, KeyStoreException, IOException, CertificateException, UnrecoverableKeyException, KeyManagementException { |
66 | 68 | try ( |
67 | 69 | // custom_configuration { |
68 | 70 | ScyllaDBContainer scylladb = new ScyllaDBContainer(SCYLLADB_IMAGE) |
@@ -110,6 +112,22 @@ public void testSimpleSsl() |
110 | 112 | } |
111 | 113 | } |
112 | 114 |
|
| 115 | + @Test |
| 116 | + public void testSimpleSslCqlsh() throws InterruptedException, IOException { |
| 117 | + try ( |
| 118 | + ScyllaDBContainer scylladb = new ScyllaDBContainer(SCYLLADB_IMAGE) |
| 119 | + .withConfigurationOverride("scylla-test-ssl") |
| 120 | + ) { |
| 121 | + scylladb.start(); |
| 122 | + |
| 123 | + // sslCqlsh { |
| 124 | + scylladb.execInContainer("mv", "-f", "/etc/scylla/cqlshrc", "/root/.cassandra/cqlshrc"); |
| 125 | + Container.ExecResult execResult = scylladb.execInContainer("cqlsh", "--ssl", "-e", "select * from system_schema.keyspaces;"); |
| 126 | + assertThat(execResult.getStdout()).contains("keyspace_name"); |
| 127 | + // } |
| 128 | + } |
| 129 | + } |
| 130 | + |
113 | 131 | @Test |
114 | 132 | public void testShardAwareness() { |
115 | 133 | try (ScyllaDBContainer scylladb = new ScyllaDBContainer(SCYLLADB_IMAGE)) { |
|
0 commit comments