Skip to content

Commit 877c726

Browse files
committed
qa/suites/nvmeof: add more asserts to scalability_test
Signed-off-by: Vallari Agrawal <[email protected]>
1 parent e450406 commit 877c726

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

qa/suites/nvmeof/basic/workloads/nvmeof_scalability.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ tasks:
3636
- nvmeof/scalability_test.sh nvmeof.b,nvmeof.c,nvmeof.d
3737
- nvmeof/scalability_test.sh nvmeof.b,nvmeof.c
3838
env:
39-
SCALING_DELAYS: '120'
39+
SCALING_DELAYS: '300'
4040
RBD_POOL: mypool
4141
NVMEOF_GROUP: mygroup0

qa/workunits/nvmeof/scalability_test.sh

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,40 @@ status_checks() {
1616
expected_count=$1
1717

1818
output=$(ceph nvme-gw show $POOL $GROUP)
19-
nvme_show=$(echo $output | grep -o '"AVAILABLE"' | wc -l)
20-
if [ "$nvme_show" -ne "$expected_count" ]; then
21-
return 1
19+
# nvme_show=$(echo $output | grep -o '"AVAILABLE"' | wc -l)
20+
# if [ "$nvme_show" -ne "$expected_count" ]; then
21+
# return 1
22+
# fi
23+
total_ns=$(echo $output | jq '.["num-namespaces"]')
24+
total_gws=$(echo $output | jq '.["num gws"]')
25+
expected_avg_ns=$((total_ns / total_gws))
26+
27+
if [ "$total_gws" -ne "$expected_count" ]; then
28+
return 1
2229
fi
30+
expected_ns_count=$(( $NVMEOF_NAMESPACES_COUNT * $NVMEOF_SUBSYSTEMS_COUNT ))
31+
if [ "$total_ns" -ne "$expected_ns_count" ]; then
32+
return 1
33+
fi
34+
35+
gateways=$(echo "$output" | jq -c '.["Created Gateways:"][]')
36+
37+
echo "$gateways" | while read -r gw; do
38+
gw_id=$(echo "$gw" | jq -r '.["gw-id"]')
39+
availability=$(echo "$gw" | jq -r '.["Availability"]')
40+
num_namespaces=$(echo "$gw" | jq '.["num-namespaces"]')
41+
42+
if [[ "$availability" != "AVAILABLE" ]]; then
43+
echo "Gateway $gw_id is not AVAILABLE."
44+
exit 1
45+
fi
46+
47+
diff=$((num_namespaces - expected_avg_ns))
48+
if [[ $diff -lt -1 || $diff -gt 1 ]]; then
49+
echo "Gateway $gw_id has num-namespaces ($num_namespaces), expected around $expected_ns. Indicates a problem in ns load-balancing."
50+
exit 1
51+
fi
52+
done
2353

2454
orch_ls=$(ceph orch ls)
2555
if ! echo "$orch_ls" | grep -q "$expected_count/$expected_count"; then

0 commit comments

Comments
 (0)