class PutObjects {
public AwsCredentials creds;
- public URI http_uri, ssl_uri;
- static S3Client client, ssl_client;
+ public URI http_uri;
+ static S3Client client;
void generateFile(String in_file_path, String out_file_path, long length) {
try {
}
} /* generateFile */
- void readEnvironmentVars() {
- jcksum.access_key = System.getProperty("AWS_ACCESS_KEY_ID", "0555b35654ad1656d804");
- jcksum.secret_key = System.getProperty("AWS_SECRET_ACCESS_KEY", "h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==");
- jcksum.http_endpoint = System.getProperty("RGW_HTTP_ENDPOINT_URL", "http://192.168.111.1:8000");
- jcksum.http_endpoint = System.getProperty("RGW_HTTPS_ENDPOINT_URL", "https://192.168.111.1:8443");
+ String get_envvar(String key, String defstr) {
+ String var = System.getenv(key);
+ if (var == null) {
+ return defstr;
+ }
+ return var;
+ }
+
+ void readEnvironmentVars() {
+ jcksum.access_key = get_envvar("AWS_ACCESS_KEY_ID", "0555b35654ad1656d804");
+ jcksum.secret_key = get_envvar("AWS_SECRET_ACCESS_KEY", "h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==");
+ jcksum.http_endpoint = get_envvar("RGW_HTTP_ENDPOINT_URL", "");
} /* readEnvironmentVArs */
void generateBigFiles() {
@BeforeAll
void setup() throws URISyntaxException {
+ readEnvironmentVars();
+
+ System.out.println("PutObjects.java: starting test run:");
+ System.out.println("\tAccessKey=" + jcksum.access_key);
+ System.out.println("\tSecretKey=" + jcksum.secret_key);
+ System.out.println("\tEndpointUrl=" + jcksum.http_endpoint);
+
creds = AwsBasicCredentials.create(jcksum.access_key, jcksum.secret_key);
http_uri = new URI(jcksum.http_endpoint);
/* https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/S3Client.html */
client = S3Client.builder()
- .endpointOverride(http_uri)
- .credentialsProvider(StaticCredentialsProvider.create(creds))
- .region(jcksum.region)
- .build();
+ .endpointOverride(http_uri)
+ .credentialsProvider(StaticCredentialsProvider.create(creds))
+ .region(jcksum.region)
+ .forcePathStyle(true)
+ .build();
- ssl_uri = new URI(jcksum.ssl_endpoint);
- ssl_client = S3Client.builder()
- .httpClient(apacheHttpClient)
- .endpointOverride(ssl_uri)
- .credentialsProvider(StaticCredentialsProvider.create(creds))
- .region(jcksum.region)
- .build();
-
generateBigFiles();
- readEnvironmentVars();
/* create test bucket if it doesn't exist yet */
try {
rslt = mpuAndVerifyNoCksum(client, in_file_path);
assertTrue(rslt);
}
-
- /* SSL */
- @ParameterizedTest
- @MethodSource("io.ceph.jcksum.jcksum#inputFileNames")
- void putObjectFromFileCksumSSL(String in_file_path) {
- boolean rslt = false;
- System.out.println("putObjectFromFileCksumSSL called with " + in_file_path);
- rslt = putAndVerifyCksum(ssl_client, in_file_path);
- assertTrue(rslt);
- }
-
- @ParameterizedTest
- @MethodSource("io.ceph.jcksum.jcksum#inputFileNames")
- void putObjectFromFileNoCksumSSL(String in_file_path) {
- boolean rslt = false;
- System.out.println("putObjectFromFileNoCksumSSL called with " + in_file_path);
- rslt = putAndVerifyNoCksum(ssl_client, in_file_path);
- assertTrue(rslt);
- }
-
- @ParameterizedTest
- @MethodSource("io.ceph.jcksum.jcksum#mpuFileNames")
- void mpuObjectFromFileCksumSSL(String in_file_path) {
- boolean rslt = false;
- System.out.println("mpuObjectFromFileCksumSSL called with " + in_file_path);
- rslt = mpuAndVerifyCksum(ssl_client, in_file_path);
- assertTrue(rslt);
- }
-
- @ParameterizedTest
- @MethodSource("io.ceph.jcksum.jcksum#mpuFileNames")
- void mpuObjectFromFileNoCksumSSL(String in_file_path) {
- boolean rslt = false;
- System.out.println("mpuObjectFromFileNoCksumSSL called with " + in_file_path);
- rslt = mpuAndVerifyNoCksum(ssl_client, in_file_path);
- assertTrue(rslt);
- }
} /* class PutObjects */
# $KEYRING need to be set as the path for a vstart clusters Ceph keyring.
#
# Example when ceph source is cloned into $HOME and a vstart cluster is already running with a radosgw:
-# $ PATH=~/ceph/build/bin/:$PATH KEYRING=~/ceph/build/keyring ~/ceph/qa/workunits/rgw/test_librgw_file.sh
+# $ PATH=~/ceph/build/bin/:$PATH KEYRING=~/ceph/build/keyring ~/ceph/qa/workunits/rgw/test_awssdkv4_sig.sh
if [ -z ${AWS_ACCESS_KEY_ID} ]
then
export AWS_ACCESS_KEY_ID=`openssl rand -base64 20`
export AWS_SECRET_ACCESS_KEY=`openssl rand -base64 40`
- radosgw-admin user create --uid ceph-test-librgw-file \
+ radosgw-admin user create --uid ceph-test-maven \
--access-key $AWS_ACCESS_KEY_ID \
--secret $AWS_SECRET_ACCESS_KEY \
--display-name "maven test user" \
- --email librgw@example.com || echo "maven user exists"
+ --email sigv4@example.com || echo "sigv4 maven user exists"
# keyring override for teuthology env
if [ -z ${KEYRING} ]
# the required S3 access_key and secret_key are already exported above, but
# we need to hook up the S3 endpoints
-# the following are taken from
+# the following are taken from
+
+# XXXX ok, so I think there should be only RGW_HTTP_ENDPOINT_URL and that
+# it may already be set before this script runs, though if we can figure it
+# out, it's ok if we set it...
+
export RGW_HTTP_ENDPOINT_URL="http://localhost:80"
-export RGW_HTTPS_ENDPOINT_URL="https://localhost:443"
+#export RGW_HTTPS_ENDPOINT_URL="https://localhost:443"
# rgw/test_awssdkv4_sig.sh
pushd jcksum