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

e2e: test topology-aware policy nodeResourceTopology exporting #465

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cleanup() {
vm-command "kubectl delete pods --all --now"
helm-terminate
}

cleanup
helm_config=${TEST_DIR}/topology-aware-nrt.cfg helm-launch topology-aware

get_nrt="kubectl get noderesourcetopologies.topology.node.k8s.io \$(hostname)"

verify-zone-attribute() {
local zone_name=$1
local attribute_name=$2
local expected_value=$3
vm-command "$get_nrt -o json | jq -r '.zones[] | select (.name == \"$zone_name\").attributes[] | select(.name == \"$attribute_name\").value'"
[[ "$COMMAND_OUTPUT" == "$expected_value" ]] ||
command-error "expected zone $zone_name attribute $attribute_name value $expected_value, got: $COMMAND_OUTPUT"
}

# Print full NRT yaml for debugging
vm-command "$get_nrt -o yaml"

# Verify selected zone attributes
verify-zone-attribute "socket #0" "memory set" "0,2,4"
verify-zone-attribute "socket #0" "shared cpuset" "0-2"
verify-zone-attribute "socket #0" "reserved cpuset" "3"

verify-zone-attribute "socket #1" "memory set" "1,3,5"
verify-zone-attribute "socket #1" "shared cpuset" "4-7"

# TODO: Perhaps IDSet.String() or maybe some other method could print
# ranges so that "memory set" below would be just "0-5".
verify-zone-attribute "root" "memory set" "0,1,2,3,4,5"
verify-zone-attribute "root" "shared cpuset" "0-2,4-7"
verify-zone-attribute "root" "reserved cpuset" "3"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
config:
pinCPU: true
pinMemory: true
reservedResources:
cpu: cpuset:3
agent:
nodeResourceTopology: true
log:
debug:
- resource-manager
- policy
- cache
source: true
klog:
skip_headers: true
instrumentation:
reportPeriod: 60s
samplingRatePerMillion: 1000000
Loading