diff --git a/hack/e2e/README.md b/hack/e2e/README.md index d245cd31..9ccedbe1 100644 --- a/hack/e2e/README.md +++ b/hack/e2e/README.md @@ -13,44 +13,13 @@ For more details, see the script itself. For more examples, see the top-level Makefile. ``` -TEST_PATH=./tests/e2e-migration/... \ -EBS_CHECK_MIGRATION=true \ +TEST_PATH=./tests/e2e/... \ TEST_ID=18512 \ CLEAN=false \ KOPS_STATE_FILE=s3://mattwon \ AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a \ -GINKGO_FOCUS=Dynamic.\*xfs.\*should.store.data \ +GINKGO_FOCUS=".*" \ GINKGO_NODES=1 \ ./hack/e2e/run.sh ``` - -# git read-tree - -Reference: https://stackoverflow.com/questions/23937436/add-subdirectory-of-remote-repo-with-git-subtree - -How to consume this directory by read-treeing the ebs repo: - -``` -git remote add ebs git@github.com:kubernetes-sigs/aws-ebs-csi-driver.git -git fetch ebs -git read-tree --prefix=hack/e2e/ -u ebs/master:hack/e2e -``` - -To commit changes and submit them as a PR back to the ebs repo: - -``` -git diff ebs/master:hack/e2e HEAD:hack/e2e > /tmp/hack_e2e.diff -pushd $GOPATH/src/github.com/kubernetes-sigs/aws-ebs-csi-driver -git apply --reject --directory hack/e2e /tmp/hack_e2e.diff -git commit -``` - -To consume newer changes from the ebs repo: - -``` -git fetch ebs -git diff HEAD:hack/e2e ebs/master:hack/e2e > /tmp/hack_e2e.diff -git apply --reject --directory hack/e2e /tmp/hack_e2e.diff -git commit -``` diff --git a/hack/e2e/ebs.sh b/hack/e2e/ebs.sh deleted file mode 100644 index 9a80611d..00000000 --- a/hack/e2e/ebs.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -set -uo pipefail - -BASE_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") -source "${BASE_DIR}"/util.sh - -function ebs_check_migration() { - KUBECONFIG=${1} - - loudecho "Checking migration" - # There should have been no calls to the in-tree driver kubernetes.io/aws-ebs but many calls to ebs.csi.aws.com - # Find the controller-manager log and read its metrics to verify - NODE=$(kubectl get node -l kubernetes.io/role=master -o json --kubeconfig "${KUBECONFIG}" | jq -r ".items[].metadata.name") - kubectl port-forward kube-controller-manager-"${NODE}" 10252:10252 -n kube-system --kubeconfig "${KUBECONFIG}" & - - # Ensure port forwarding succeeded - n=0 - until [ "$n" -ge 30 ]; do - set +e - HEALTHZ=$(curl -s 127.0.0.1:10252/healthz) - set -e - if [[ ${HEALTHZ} == "ok" ]]; then - loudecho "Port forwarding succeeded" - break - else - loudecho "Port forwarding is not yet ready" - fi - n=$((n + 1)) - sleep 1 - done - if [[ "$n" -eq 30 ]]; then - loudecho "Timed out waiting for port forward" - for PROC in $(jobs -p); do - kill "${PROC}" - done - return 1 - fi - - set +e - curl 127.0.0.1:10252/metrics -s | grep -a 'volume_operation_total_seconds_bucket{operation_name="provision",plugin_name="ebs.csi.aws.com"' - CSI_CALLED=${PIPESTATUS[1]} - set -e - - set +e - curl 127.0.0.1:10252/metrics -s | grep -a 'volume_operation_total_seconds_bucket{operation_name="provision",plugin_name="kubernetes.io/aws-ebs"' - INTREE_CALLED=${PIPESTATUS[1]} - set -e - - for PROC in $(jobs -p); do - kill "${PROC}" - done - - loudecho "CSI_CALLED: ${CSI_CALLED}" - loudecho "INTREE_CALLED: ${INTREE_CALLED}" - - # if CSI was called and In-tree was not called, return 0/true/success - if [ "${CSI_CALLED}" == 0 ] && [ "${INTREE_CALLED}" == 1 ]; then - echo 0 - else - echo 1 - fi -} diff --git a/hack/e2e/eksctl.sh b/hack/e2e/eksctl.sh index 59b27c8e..01985450 100644 --- a/hack/e2e/eksctl.sh +++ b/hack/e2e/eksctl.sh @@ -23,7 +23,6 @@ function eksctl_create_cluster() { KUBECONFIG=${8} EKSCTL_PATCH_FILE=${9} EKSCTL_ADMIN_ROLE=${10} - WINDOWS=${11} generate_ssh_key "${SSH_KEY_PATH}" @@ -66,19 +65,6 @@ function eksctl_create_cluster() { ${BIN} create iamidentitymapping --cluster "${CLUSTER_NAME}" --arn "${ADMIN_ARN}" --group system:masters --username admin fi - if [[ "$WINDOWS" == true ]]; then - ${BIN} create nodegroup \ - --managed=false \ - --cluster="${CLUSTER_NAME}" \ - --node-ami-family=WindowsServer2019FullContainer \ - -n ng-windows \ - -m 1 \ - -M 1 \ - --ssh-access \ - --ssh-public-key "${SSH_KEY_PATH}".pub - ${BIN} utils install-vpc-controllers --cluster="${CLUSTER_NAME}" --approve - fi - return $? } diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index 30bd662b..7bf37339 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -17,15 +17,14 @@ set -euo pipefail BASE_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") -source "${BASE_DIR}"/ebs.sh source "${BASE_DIR}"/ecr.sh source "${BASE_DIR}"/eksctl.sh source "${BASE_DIR}"/helm.sh source "${BASE_DIR}"/kops.sh source "${BASE_DIR}"/util.sh -DRIVER_NAME=${DRIVER_NAME:-aws-ebs-csi-driver} -CONTAINER_NAME=${CONTAINER_NAME:-ebs-plugin} +DRIVER_NAME=${DRIVER_NAME:-aws-fsx-csi-driver} +CONTAINER_NAME=${CONTAINER_NAME:-fsx-plugin} DRIVER_START_TIME_THRESHOLD_SECONDS=60 TEST_ID=${TEST_ID:-$RANDOM} @@ -60,23 +59,17 @@ KOPS_PATCH_NODE_FILE=${KOPS_PATCH_NODE_FILE:-./hack/kops-patch-node.yaml} EKSCTL_VERSION=${EKSCTL_VERSION:-0.69.0} EKSCTL_PATCH_FILE=${EKSCTL_PATCH_FILE:-./hack/eksctl-patch.yaml} EKSCTL_ADMIN_ROLE=${EKSCTL_ADMIN_ROLE:-} -# Creates a windows node group. The windows ami doesn't (yet) install csi-proxy -# so that has to be done separately. -WINDOWS=${WINDOWS:-"false"} HELM_VALUES_FILE=${HELM_VALUES_FILE:-./hack/values.yaml} HELM_EXTRA_FLAGS=${HELM_EXTRA_FLAGS:-} TEST_PATH=${TEST_PATH:-"./tests/e2e"} ARTIFACTS=${ARTIFACTS:-"${TEST_DIR}/artifacts"} -GINKGO_FOCUS=${GINKGO_FOCUS:-"\[ebs-csi-e2e\]"} +GINKGO_FOCUS=${GINKGO_FOCUS:-"\[fsx-csi-e2e\]"} GINKGO_SKIP=${GINKGO_SKIP:-"\[Disruptive\]"} GINKGO_NODES=${GINKGO_NODES:-4} TEST_EXTRA_FLAGS=${TEST_EXTRA_FLAGS:-} -EBS_INSTALL_SNAPSHOT=${EBS_INSTALL_SNAPSHOT:-"false"} -EBS_INSTALL_SNAPSHOT_VERSION=${EBS_INSTALL_SNAPSHOT_VERSION:-"v4.1.1"} -EBS_CHECK_MIGRATION=${EBS_CHECK_MIGRATION:-"false"} CLEAN=${CLEAN:-"true"} @@ -142,22 +135,12 @@ elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then "$CLUSTER_FILE" \ "$KUBECONFIG" \ "$EKSCTL_PATCH_FILE" \ - "$EKSCTL_ADMIN_ROLE" \ - "$WINDOWS" + "$EKSCTL_ADMIN_ROLE" if [[ $? -ne 0 ]]; then exit 1 fi fi -if [[ "${EBS_INSTALL_SNAPSHOT}" == true ]]; then - loudecho "Installing snapshot controller and CRDs" - kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml - kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml - kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml - kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml - kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml -fi - loudecho "Deploying driver" startSec=$(date +'%s') @@ -201,19 +184,6 @@ loudecho "TEST_PASSED: ${TEST_PASSED}" popd OVERALL_TEST_PASSED="${TEST_PASSED}" -if [[ "${EBS_CHECK_MIGRATION}" == true ]]; then - exec 5>&1 - OUTPUT=$(ebs_check_migration "${KUBECONFIG}" | tee /dev/fd/5) - MIGRATION_PASSED=$(echo "${OUTPUT}" | tail -1) - loudecho "MIGRATION_PASSED: ${MIGRATION_PASSED}" - if [ "${TEST_PASSED}" == 0 ] && [ "${MIGRATION_PASSED}" == 0 ]; then - loudecho "Both test and migration passed" - OVERALL_TEST_PASSED=0 - else - loudecho "One of test or migration failed" - OVERALL_TEST_PASSED=1 - fi -fi PODS=$(kubectl get pod -n kube-system -l "app.kubernetes.io/name=${DRIVER_NAME},app.kubernetes.io/instance=${DRIVER_NAME}" -o json --kubeconfig "${KUBECONFIG}" | jq -r .items[].metadata.name)