Skip to content

Commit

Permalink
Merge pull request #465 from askervin/5Z8_e2e_topology_aware_nrt
Browse files Browse the repository at this point in the history
e2e: test topology-aware policy nodeResourceTopology exporting
  • Loading branch information
fmuyassarov authored Jan 29, 2025
2 parents e1a82ce + 6fb3007 commit 6660f9a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
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

0 comments on commit 6660f9a

Please sign in to comment.