Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Torres <torredil@amazon.com>
  • Loading branch information
torredil committed Oct 26, 2023
1 parent 324a3d8 commit d5620d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 72 deletions.
1 change: 0 additions & 1 deletion hack/e2e/chart-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ function ct_install() {
curl --silent --location "${CHART_TESTING_DOWNLOAD_URL}" | tar xz -C "${INSTALL_PATH}"
chmod +x "${INSTALL_PATH}"/ct
fi
apt-get update && apt-get install -y yamllint
}
73 changes: 2 additions & 71 deletions hack/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ DRIVER_NAME=${DRIVER_NAME:-aws-ebs-csi-driver}
CONTAINER_NAME=${CONTAINER_NAME:-ebs-plugin}

TEST_ID=${TEST_ID:-$RANDOM}
CLUSTER_NAME=test-cluster-${TEST_ID}.k8s.local
CLUSTER_NAME=test-cluster-11094.k8s.local
CLUSTER_TYPE=${CLUSTER_TYPE:-kops}

TEST_DIR=${BASE_DIR}/csi-test-artifacts
Expand Down Expand Up @@ -95,19 +95,6 @@ loudecho "Testing in region ${REGION} and zones ${ZONES}"
mkdir -p "${BIN_DIR}"
export PATH=${PATH}:${BIN_DIR}

if [[ "${CLUSTER_TYPE}" == "kops" ]]; then
loudecho "Installing kops ${KOPS_VERSION} to ${BIN_DIR}"
kops_install "${BIN_DIR}" "${KOPS_VERSION}"
KOPS_BIN=${BIN_DIR}/kops
elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then
loudecho "Installing eksctl ${EKSCTL_VERSION} to ${BIN_DIR}"
eksctl_install "${BIN_DIR}" "${EKSCTL_VERSION}"
EKSCTL_BIN=${BIN_DIR}/eksctl
else
loudecho "${CLUSTER_TYPE} must be kops or eksctl!"
exit 1
fi

loudecho "Installing helm to ${BIN_DIR}"
helm_install "${BIN_DIR}"
HELM_BIN=${BIN_DIR}/helm
Expand All @@ -134,45 +121,6 @@ else
fi
fi

ecr_build_and_push "${REGION}" \
"${AWS_ACCOUNT_ID}" \
"${IMAGE_NAME}" \
"${IMAGE_TAG}"

if [[ "${CLUSTER_TYPE}" == "kops" ]]; then
kops_create_cluster \
"$CLUSTER_NAME" \
"$KOPS_BIN" \
"$ZONES" \
"$NODE_COUNT" \
"$INSTANCE_TYPE" \
"$AMI_ID" \
"$K8S_VERSION_KOPS" \
"$CLUSTER_FILE" \
"$KUBECONFIG" \
"$KOPS_PATCH_FILE" \
"$KOPS_PATCH_NODE_FILE" \
"$KOPS_STATE_FILE"
if [[ $? -ne 0 ]]; then
exit 1
fi
elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then
eksctl_create_cluster \
"$CLUSTER_NAME" \
"$EKSCTL_BIN" \
"$ZONES" \
"$INSTANCE_TYPE" \
"$K8S_VERSION_EKSCTL" \
"$CLUSTER_FILE" \
"$KUBECONFIG" \
"$EKSCTL_PATCH_FILE" \
"$EKSCTL_ADMIN_ROLE" \
"$WINDOWS" \
"$VPC_CONFIGMAP_FILE"
if [[ $? -ne 0 ]]; then
exit 1
fi
fi

if [[ "${EBS_INSTALL_SNAPSHOT}" == true ]]; then
loudecho "Installing snapshot controller and CRDs"
Expand All @@ -196,7 +144,7 @@ if [[ "${HELM_CT_TEST}" == true ]]; then
set -x
set +e
export KUBECONFIG="${KUBECONFIG}"
${CHART_TESTING_BIN} lint-and-install --config ${PWD}/tests/ct-config.yaml --helm-extra-set-args="--set=image.repository=${IMAGE_NAME},image.tag=${IMAGE_TAG}"
${CHART_TESTING_BIN} lint-and-install --config ${PWD}/tests/ct-config.yaml
TEST_PASSED=$?
set -e
set +x
Expand Down Expand Up @@ -229,9 +177,6 @@ else
kubectl --kubeconfig "${KUBECONFIG}" --namespace kube-system wait --timeout 10m0s --for "condition=ready" pod -l "app.kubernetes.io/name=aws-ebs-csi-driver"
fi

endSec=$(date +'%s')
deployTimeSeconds=$(((endSec - startSec) / 1))
loudecho "Driver deployment complete, time used: $deployTimeSeconds seconds"
loudecho "Testing focus ${GINKGO_FOCUS}"

if [[ $TEST_PATH == "./tests/e2e-kubernetes/..." ]]; then
Expand Down Expand Up @@ -303,20 +248,6 @@ if [[ "${CLEAN}" == true ]]; then
fi
fi

if [[ "${CLUSTER_TYPE}" == "kops" ]]; then
kops_delete_cluster \
"${KOPS_BIN}" \
"${CLUSTER_NAME}" \
"${KOPS_STATE_FILE}"
elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then
eksctl_delete_cluster \
"${EKSCTL_BIN}" \
"${CLUSTER_NAME}"
fi
else
loudecho "Not cleaning"
fi

loudecho "OVERALL_TEST_PASSED: ${OVERALL_TEST_PASSED}"
if [[ $OVERALL_TEST_PASSED -ne 0 ]]; then
loudecho "FAIL!"
Expand Down
2 changes: 2 additions & 0 deletions hack/kops-patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,5 @@ spec:
awsEBSCSIDriver:
enabled: true
managed: false
iam:
useServiceAccountExternalPermissions: true

0 comments on commit d5620d8

Please sign in to comment.