From 2a3ce0bb7550e37079029e43f1a92e1f17f0d147 Mon Sep 17 00:00:00 2001 From: Rabi Panda Date: Fri, 9 Apr 2021 17:51:27 -0700 Subject: [PATCH] Fix rename issues and failing repository-hdfs tests. (#518) This commit fixes some partial rename issues and as a result fixes the failing secure repository-hdfs tests. Signed-off-by: Rabi Panda --- plugins/repository-hdfs/build.gradle | 2 +- .../src/main/resources/env.properties | 6 ++++++ .../src/main/resources/provision/hdfs.sh | 12 +++++++++++- .../src/main/resources/provision/installkdc.sh | 18 +++++++++++++++--- .../resources/provision/krb5.conf.template | 17 +++++++++++++++-- 5 files changed, 48 insertions(+), 7 deletions(-) diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index 0fcf5173bc4..528713bfa49 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -114,7 +114,7 @@ testClusters.integTest { plugin(project.tasks.bundlePlugin.archiveFile) } -String realm = "BUILD.ELASTIC.CO" +String realm = "BUILD.OPENSEARCH.ORG" String krb5conf = project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("hdfs") // Create HDFS File System Testing Fixtures for HA/Secure combinations diff --git a/test/fixtures/krb5kdc-fixture/src/main/resources/env.properties b/test/fixtures/krb5kdc-fixture/src/main/resources/env.properties index a9b3d026902..216e1095da4 100644 --- a/test/fixtures/krb5kdc-fixture/src/main/resources/env.properties +++ b/test/fixtures/krb5kdc-fixture/src/main/resources/env.properties @@ -26,6 +26,12 @@ # specific language governing permissions and limitations # under the License. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. +# + + realm=BUILD.OPENSEARCH.ORG kdc=kerberos.build.opensearch.org zone=build.opensearch.org diff --git a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/hdfs.sh b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/hdfs.sh index ea14cfb751d..269b4246a9e 100644 --- a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/hdfs.sh +++ b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/hdfs.sh @@ -1,10 +1,20 @@ #!/bin/bash +# +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. +# set -e addprinc.sh "opensearch" #TODO(OpenSearch): fix username -addprinc.sh "hdfs/hdfs.build.opensearch.co" +addprinc.sh "hdfs/hdfs.build.opensearch.org" # Use this as a signal that setup is complete python3 -m http.server 4444 & diff --git a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/installkdc.sh b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/installkdc.sh index 5c8e4abbc63..081625d1ea1 100755 --- a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/installkdc.sh +++ b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/installkdc.sh @@ -1,4 +1,11 @@ #!/bin/bash +# +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +# # Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with @@ -17,6 +24,11 @@ # specific language governing permissions and limitations # under the License. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. +# + set -e # KDC installation steps and considerations based on https://web.mit.edu/kerberos/krb5-latest/doc/admin/install_kdc.html @@ -35,14 +47,14 @@ MARKER_FILE=/etc/marker REALM_NAME=$(cat $ENVPROP_FILE | grep realm= | cut -d '=' -f 2) KDC_NAME=$(cat $ENVPROP_FILE | grep kdc= | cut -d '=' -f 2) BUILD_ZONE=$(cat $ENVPROP_FILE | grep zone= | cut -d '=' -f 2) -ELASTIC_ZONE=$(echo $BUILD_ZONE | cut -d '.' -f 1,2) +OPENSEARCH_ZONE=$(echo $BUILD_ZONE | cut -d '.' -f 1,2) # Transfer and interpolate krb5.conf cp $PROV_DIR/krb5.conf.template $LOCALSTATEDIR/krb5.conf sed -i 's/${REALM_NAME}/'$REALM_NAME'/g' $LOCALSTATEDIR/krb5.conf sed -i 's/${KDC_NAME}/'$KDC_NAME'/g' $LOCALSTATEDIR/krb5.conf sed -i 's/${BUILD_ZONE}/'$BUILD_ZONE'/g' $LOCALSTATEDIR/krb5.conf -sed -i 's/${ELASTIC_ZONE}/'$ELASTIC_ZONE'/g' $LOCALSTATEDIR/krb5.conf +sed -i 's/${OPENSEARCH_ZONE}/'$OPENSEARCH_ZONE'/g' $LOCALSTATEDIR/krb5.conf # Transfer and interpolate the kdc.conf @@ -51,7 +63,7 @@ cp $PROV_DIR/kdc.conf.template $LOCALSTATEDIR/krb5kdc/kdc.conf sed -i 's/${REALM_NAME}/'$REALM_NAME'/g' $LOCALSTATEDIR/krb5kdc/kdc.conf sed -i 's/${KDC_NAME}/'$KDC_NAME'/g' $LOCALSTATEDIR/krb5kdc/kdc.conf sed -i 's/${BUILD_ZONE}/'$BUILD_ZONE'/g' $LOCALSTATEDIR/krb5kdc/kdc.conf -sed -i 's/${ELASTIC_ZONE}/'$ELASTIC_ZONE'/g' $LOCALSTATEDIR/krb5.conf +sed -i 's/${OPENSEARCH_ZONE}/'$OPENSEARCH_ZONE'/g' $LOCALSTATEDIR/krb5.conf # Touch logging locations mkdir -p $LOGDIR diff --git a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/krb5.conf.template b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/krb5.conf.template index e09c8fc1ab7..57fd8ac8497 100644 --- a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/krb5.conf.template +++ b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/krb5.conf.template @@ -1,3 +1,11 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +# + # Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright @@ -15,6 +23,11 @@ # specific language governing permissions and limitations # under the License. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. +# + [libdefaults] default_realm = ${REALM_NAME} dns_canonicalize_hostname = false @@ -42,6 +55,6 @@ [domain_realm] ${BUILD_ZONE} = ${REALM_NAME} .${BUILD_ZONE} = ${REALM_NAME} - ${ELASTIC_ZONE} = ${REALM_NAME} - .${ELASTIC_ZONE} = ${REALM_NAME} + ${OPENSEARCH_ZONE} = ${REALM_NAME} + .${OPENSEARCH_ZONE} = ${REALM_NAME}