Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPC CNI Integration Test Fixes #2105

Merged
merged 5 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions scripts/run-cni-release-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,14 @@ function run_integration_test() {
echo "Integration tests completed successfully!"
}

function run_calico_tests(){
# get version from run-integration-tests.sh
: "${CALICO_VERSION:=v3.23.0}"
echo "Running calico tests, version $CALICO_VERSION"
START=$SECONDS
TEST_RESULT=success
ginkgo -v --no-color $CALICO_TEST_DIR -- --cluster-kubeconfig=$KUBE_CONFIG_PATH --cluster-name=$CLUSTER_NAME --aws-region=$REGION --aws-vpc-id=$VPC_ID --calico-version=$CALICO_VERSION || TEST_RESULT=fail
if [[ "$TEST_RESULT" == fail ]]; then
echo "Calico tests failed."
exit 1
fi
echo "Calico tests completed successfully!"
}

if [[ -n "${ENDPOINT}" ]]; then
ENDPOINT_FLAG="--endpoint $ENDPOINT"
fi


echo "Running release tests on cluster: $CLUSTER_NAME in region: $REGION"

load_cluster_details
START=$SECONDS
run_integration_test
run_calico_tests

echo "Completed running all tests in $((SECONDS - START)) seconds."
14 changes: 14 additions & 0 deletions test/integration/cni/host_networking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,27 @@ const (
NEW_VETH_PREFIX = "veth"
DEFAULT_MTU_VAL = "9001"
DEFAULT_VETH_PREFIX = "eni"
WARM_IP_TARGET = "WARM_IP_TARGET"
jdn5126 marked this conversation as resolved.
Show resolved Hide resolved
DEFAULT_WARM_IP_TARGET = "3"
jdn5126 marked this conversation as resolved.
Show resolved Hide resolved
)

var _ = Describe("test host networking", func() {
var err error
var podLabelKey = "app"
var podLabelVal = "host-networking-test"

// For host networking tests, increase WARM_IP_TARGET to prevent long IPAMD warmup.
BeforeEach(func() {
k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, utils.AwsNodeName, utils.AwsNodeNamespace, utils.AwsNodeName, map[string]string{
WARM_IP_TARGET: strconv.Itoa(maxIPPerInterface - 1),
})
})
AfterEach(func() {
k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, utils.AwsNodeName, utils.AwsNodeNamespace, utils.AwsNodeName, map[string]string{
WARM_IP_TARGET: DEFAULT_WARM_IP_TARGET,
})
})

Context("when pods using IP from primary and secondary ENI are created", func() {
AfterEach(func() {
k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, utils.AwsNodeName, utils.AwsNodeNamespace, utils.AwsNodeName, map[string]string{
Expand Down
5 changes: 4 additions & 1 deletion test/integration/cni/pod_networking_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ var _ = BeforeSuite(func() {

// Set the WARM_ENI_TARGET to 0 to prevent all pods being scheduled on secondary ENI
k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, "aws-node", "kube-system",
"aws-node", map[string]string{"WARM_IP_TARGET": "3", "WARM_ENI_TARGET": "0"})
"aws-node", map[string]string{
"WARM_IP_TARGET": "3",
"WARM_ENI_TARGET": "0",
})
})

var _ = AfterSuite(func() {
Expand Down