Skip to content

Commit

Permalink
Update test cases and mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavani-Panakanti committed Aug 22, 2024
1 parent a4f0d90 commit c24daf7
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 4 deletions.
21 changes: 21 additions & 0 deletions templates/test/cases/max-pods-cni-1-18-0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail

echo "-> Should calc max-pods successfully for c6in.32xlarge VPC CNI 1.18.0"
exit_code=0
out=$(/etc/eks/max-pods-calculator.sh \
--instance-type c6in.32xlarge \
--cni-version 1.18.0 \
--show-max-allowed || exit_code=$?)
echo $out

if [[ ${exit_code} -ne 0 ]]; then
echo "❌ Test Failed: expected a non-zero exit code but got '${exit_code}'"
exit 1
fi
expected_max_pods="394"
actual_max_pods=$(grep -o '[0-9]\+' <<< ${out})
if [[ ${actual_max_pods} -ne ${expected_max_pods} ]]; then
echo "❌ Test Failed: expected max-pods for c6in.32xlarge w/ CNI 1.18.5 to be '${expected_max_pods}', but got '${actual_max_pods}'"
exit 1
fi
36 changes: 36 additions & 0 deletions templates/test/mocks/describe-instance-types/c6in-32xlarge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"Hypervisor": "nitro",
"NetworkInfo": {
"NetworkPerformance": "200 Gigabit",
"MaximumNetworkInterfaces": 16,
"MaximumNetworkCards": 2,
"DefaultNetworkCardIndex": 0,
"NetworkCards": [
{
"NetworkCardIndex": 0,
"NetworkPerformance": "Up to 170 Gigabit",
"MaximumNetworkInterfaces": 8,
"BaselineBandwidthInGbps": 200.0,
"PeakBandwidthInGbps": 200.0
},
{
"NetworkCardIndex": 1,
"NetworkPerformance": "Up to 170 Gigabit",
"MaximumNetworkInterfaces": 8,
"BaselineBandwidthInGbps": 200.0,
"PeakBandwidthInGbps": 200.0
}
],
"Ipv4AddressesPerInterface": 50,
"Ipv6AddressesPerInterface": 50,
"Ipv6Supported": true,
"EnaSupport": "required",
"EfaSupported": true,
"EfaInfo": {
"MaximumEfaInterfaces": 2
},
"EncryptionInTransitSupported": true,
"EnaSrdSupported": false
},
"CpuCount": 128
}
24 changes: 22 additions & 2 deletions templates/test/mocks/describe-instance-types/m4-xlarge.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
{
"Hypervisor": "xen",
"EniCount": 4,
"PodsPerEniCount": 15,
"NetworkInfo": {
"NetworkPerformance": "High",
"MaximumNetworkInterfaces": 4,
"MaximumNetworkCards": 1,
"DefaultNetworkCardIndex": 0,
"NetworkCards": [
{
"NetworkCardIndex": 0,
"NetworkPerformance": "High",
"MaximumNetworkInterfaces": 4,
"BaselineBandwidthInGbps": 0.75,
"PeakBandwidthInGbps": 2.8
}
],
"Ipv4AddressesPerInterface": 15,
"Ipv6AddressesPerInterface": 15,
"Ipv6Supported": true,
"EnaSupport": "unsupported",
"EfaSupported": false,
"EncryptionInTransitSupported": false,
"EnaSrdSupported": false
},
"CpuCount": 4
}
24 changes: 22 additions & 2 deletions templates/test/mocks/describe-instance-types/m5-8xlarge.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
{
"Hypervisor": "nitro",
"EniCount": 8,
"PodsPerEniCount": 30,
"NetworkInfo": {
"NetworkPerformance": "10 Gigabit",
"MaximumNetworkInterfaces": 8,
"MaximumNetworkCards": 1,
"DefaultNetworkCardIndex": 0,
"NetworkCards": [
{
"NetworkCardIndex": 0,
"NetworkPerformance": "10 Gigabit",
"MaximumNetworkInterfaces": 8,
"BaselineBandwidthInGbps": 10.0,
"PeakBandwidthInGbps": 10.0
}
],
"Ipv4AddressesPerInterface": 30,
"Ipv6AddressesPerInterface": 30,
"Ipv6Supported": true,
"EnaSupport": "required",
"EfaSupported": false,
"EncryptionInTransitSupported": false,
"EnaSrdSupported": false
},
"CpuCount": 32
}

0 comments on commit c24daf7

Please sign in to comment.