-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #465 from askervin/5Z8_e2e_topology_aware_nrt
e2e: test topology-aware policy nodeResourceTopology exporting
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
test/e2e/policies.test-suite/topology-aware/n6-hbm-cxl/test04-nrt/code.var.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
18 changes: 18 additions & 0 deletions
18
test/e2e/policies.test-suite/topology-aware/n6-hbm-cxl/test04-nrt/topology-aware-nrt.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |