aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests/topology-manager.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kud/tests/topology-manager.sh')
-rwxr-xr-xkud/tests/topology-manager.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/kud/tests/topology-manager.sh b/kud/tests/topology-manager.sh
index 77656d39..772dcfed 100755
--- a/kud/tests/topology-manager.sh
+++ b/kud/tests/topology-manager.sh
@@ -76,15 +76,15 @@ while [[ $status_phase != "Running" ]]; do
fi
done
-container_id=$(kubectl describe pod $pod_name | grep "Container ID" | awk '{print $3}' )
-container_id=${container_id#docker://}
-container_id=${container_id:0:12}
+uid=$(kubectl get pod pod-topology-manager -o jsonpath='{.metadata.uid}')
+node_name=$(kubectl get pod $pod_name -o jsonpath='{.spec.nodeName}')
+node_ip=$(kubectl get node $node_name -o jsonpath='{.status.addresses[].address}')
apt-get install -y jq
-cpu_core=$(cat /var/lib/kubelet/cpu_manager_state | jq -r .| grep ${container_id} | awk -F ':' '{print $2}'| awk -F '"' '{print $2}')
-numa_node_number=$(lscpu | grep "NUMA node(s)" | awk -F ':' '{print $2}')
+cpu_core=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $node_ip -- cat /var/lib/kubelet/cpu_manager_state | jq -r --arg UID "${uid}" --arg POD_NAME "${pod_name}" '.entries[$UID][$POD_NAME]')
+numa_node_number=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $node_ip -- lscpu | grep "NUMA node(s)" | awk -F ':' '{print $2}')
for (( node=0; node<$numa_node_number; node++ )); do
- ranges=$(lscpu | grep "NUMA node"$node | awk -F ':' '{print $2}')
+ ranges=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $node_ip -- lscpu | grep "NUMA node"$node | awk -F ':' '{print $2}')
ranges=(${ranges//,/ })
for range in ${ranges[@]}; do
min=$(echo $range | awk -F '-' '{print $1}')
@@ -95,8 +95,8 @@ for (( node=0; node<$numa_node_number; node++ )); do
done
done
-vf_pci=$(kubectl exec -it $pod_name env | grep PCIDEVICE_INTEL_COM_INTEL_SRIOV_700 | awk -F '=' '{print $2}' | sed 's/\r//g')
-vf_numa_node=$(cat /sys/bus/pci/devices/$vf_pci/numa_node)
+vf_pci=$(kubectl exec -it $pod_name -- env | grep PCIDEVICE_INTEL_COM_INTEL_SRIOV_700 | awk -F '=' '{print $2}' | sed 's/\r//g')
+vf_numa_node=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $node_ip -- cat /sys/bus/pci/devices/$vf_pci/numa_node)
echo "The allocated cpu core is:" $cpu_core
echo "The numa node of the allocated cpu core is:" $cpu_numa_node