Skip to content

Commit 1b09200

Browse files
committed
verify nits
1 parent 3aef000 commit 1b09200

28 files changed

+90
-433
lines changed

test/bin/scenario.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ function get_vm_ip {
559559
ip=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1)
560560
while true; do
561561
now=$(date +%s)
562-
if [ $(( now - start )) -ge ${VM_BOOT_TIMEOUT} ]; then
562+
if [ $(( now - start )) -ge "${VM_BOOT_TIMEOUT}" ]; then
563563
echo "Timed out while waiting for IP retrieval" >&2
564564
return 1
565565
fi

test/bin/vm_scheduler.sh

Lines changed: 59 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ get_reusability_score() {
663663

664664
# Score 2: Reusable - optionals can be reused by source scenarios
665665
case "${boot_image}" in
666-
*-optionals|*-optional|*-with-optional)
666+
*-optionals|*-with-optional)
667667
echo "2"
668668
return
669669
;;
@@ -1412,65 +1412,72 @@ show_status() {
14121412
echo "=== Test Durations ==="
14131413
echo " (Tests longer than avg boot time should be 'slow', shorter should be 'fast')"
14141414
echo ""
1415-
# Collect test durations and check for mislabeling
1416-
local mislabeled_count=0
1417-
{
1418-
for scenario_dir in "${SCENARIO_INFO_DIR}"/*; do
1419-
[ -d "${scenario_dir}" ] || continue
1420-
local scenario_name
1421-
scenario_name=$(basename "${scenario_dir}")
1422-
local test_time_file="${scenario_dir}/test_time"
1423-
1424-
if [ -f "${test_time_file}" ]; then
1425-
local test_time
1426-
test_time=$(cat "${test_time_file}")
1427-
local test_mins=$((test_time / 60))
1428-
local test_secs=$((test_time % 60))
1429-
local time_str
1430-
time_str=$(printf '%2d:%02d' "${test_mins}" "${test_secs}")
1431-
1432-
# Get slow/fast flag from requirements
1433-
local req_file="${SCENARIO_STATUS}/${scenario_name}/requirements"
1434-
local slow_flag="false"
1435-
local fast_flag="false"
1436-
local current_label="-"
1437-
if [ -f "${req_file}" ]; then
1438-
slow_flag=$(get_req_value "${req_file}" "slow" "false")
1439-
fast_flag=$(get_req_value "${req_file}" "fast" "false")
1440-
if [ "${slow_flag}" = "true" ]; then
1441-
current_label="slow"
1442-
elif [ "${fast_flag}" = "true" ]; then
1443-
current_label="fast"
1444-
fi
1415+
# Collect test durations to a temp file for sorting and counting
1416+
local tmp_durations
1417+
tmp_durations=$(mktemp)
1418+
# shellcheck disable=SC2064
1419+
trap "rm -f ${tmp_durations}" RETURN
1420+
1421+
for scenario_dir in "${SCENARIO_INFO_DIR}"/*; do
1422+
[ -d "${scenario_dir}" ] || continue
1423+
local scenario_name
1424+
scenario_name=$(basename "${scenario_dir}")
1425+
local test_time_file="${scenario_dir}/test_time"
1426+
1427+
if [ -f "${test_time_file}" ]; then
1428+
local test_time
1429+
test_time=$(cat "${test_time_file}")
1430+
local test_mins=$((test_time / 60))
1431+
local test_secs=$((test_time % 60))
1432+
local time_str
1433+
time_str=$(printf '%2d:%02d' "${test_mins}" "${test_secs}")
1434+
1435+
# Get slow/fast flag from requirements
1436+
local req_file="${SCENARIO_STATUS}/${scenario_name}/requirements"
1437+
local slow_flag="false"
1438+
local fast_flag="false"
1439+
local current_label="-"
1440+
if [ -f "${req_file}" ]; then
1441+
slow_flag=$(get_req_value "${req_file}" "slow" "false")
1442+
fast_flag=$(get_req_value "${req_file}" "fast" "false")
1443+
if [ "${slow_flag}" = "true" ]; then
1444+
current_label="slow"
1445+
elif [ "${fast_flag}" = "true" ]; then
1446+
current_label="fast"
14451447
fi
1448+
fi
14461449

1447-
# Determine if mislabeled (compare against avg boot time)
1448-
local status=""
1449-
if [ ${avg_boot_time} -gt 0 ]; then
1450-
if [ ${test_time} -gt ${avg_boot_time} ]; then
1451-
# Test is slower than boot - should be 'slow'
1452-
if [ "${fast_flag}" = "true" ]; then
1453-
status="<-- MISLABELED (should be slow)"
1454-
mislabeled_count=$((mislabeled_count + 1))
1455-
fi
1456-
else
1457-
# Test is faster than boot - should be 'fast'
1458-
if [ "${slow_flag}" = "true" ]; then
1459-
status="<-- MISLABELED (should be fast)"
1460-
mislabeled_count=$((mislabeled_count + 1))
1461-
fi
1450+
# Determine if mislabeled (compare against avg boot time)
1451+
local status=""
1452+
if [ "${avg_boot_time}" -gt 0 ]; then
1453+
if [ "${test_time}" -gt "${avg_boot_time}" ]; then
1454+
# Test is slower than boot - should be 'slow'
1455+
if [ "${fast_flag}" = "true" ]; then
1456+
status="<-- MISLABELED (should be slow)"
1457+
fi
1458+
else
1459+
# Test is faster than boot - should be 'fast'
1460+
if [ "${slow_flag}" = "true" ]; then
1461+
status="<-- MISLABELED (should be fast)"
14621462
fi
14631463
fi
1464-
1465-
# Output: time, scenario, label, status (tab-separated for sorting)
1466-
printf "%d\t%s\t%-40s\t%-6s\t%s\n" "${test_time}" "${time_str}" "${scenario_name}" "${current_label}" "${status}"
14671464
fi
1468-
done
1469-
} | sort -t$'\t' -k1,1rn | cut -f2- | while IFS=$'\t' read -r time_str scenario label status; do
1465+
1466+
# Output: time, scenario, label, status (tab-separated for sorting)
1467+
printf "%d\t%s\t%-40s\t%-6s\t%s\n" "${test_time}" "${time_str}" "${scenario_name}" "${current_label}" "${status}" >> "${tmp_durations}"
1468+
fi
1469+
done
1470+
1471+
# Sort and display
1472+
sort -t$'\t' -k1,1rn "${tmp_durations}" | cut -f2- | while IFS=$'\t' read -r time_str scenario label status; do
14701473
printf " %s %-40s [%s] %s\n" "${time_str}" "${scenario}" "${label}" "${status}"
14711474
done
1475+
1476+
# Count mislabeled
1477+
local mislabeled_count
1478+
mislabeled_count=$(grep -c "MISLABELED" "${tmp_durations}" 2>/dev/null || echo 0)
14721479
echo ""
1473-
if [ ${mislabeled_count} -gt 0 ]; then
1480+
if [ "${mislabeled_count}" -gt 0 ]; then
14741481
echo " WARNING: ${mislabeled_count} test(s) appear to be mislabeled based on avg boot time (${avg_boot_time_str})"
14751482
fi
14761483
echo ""

test/scenarios-bootc/presubmits/el98-src@auto-recovery-extra.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ EOF
1717

1818
scenario_create_vms() {
1919
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
20-
launch_vm --boot_blueprint rhel98-bootc
20+
launch_vm rhel98-bootc
2121
}
2222

2323
scenario_remove_vms() {

test/scenarios-bootc/presubmits/el98-src@cert-manager.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ EOF
3333
scenario_create_vms() {
3434
LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source-optionals
3535
# Three nics - one for sriov, one for macvlan, another for ipvlan (they cannot enslave the same interface)
36-
launch_vm --boot_blueprint rhel98-bootc --network "${NETWORKS}" --vm_disksize 25 --vm_vcpus 4
36+
launch_vm rhel98-bootc --network "${NETWORKS}" --vm_disksize 25 --vm_vcpus 4
3737
}
3838

3939
scenario_remove_vms() {

test/scenarios-bootc/presubmits/el98-src@containers-policy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ EOF
1717

1818
scenario_create_vms() {
1919
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
20-
launch_vm --boot_blueprint rhel98-bootc
20+
launch_vm rhel98-bootc
2121
}
2222

2323
scenario_remove_vms() {

test/scenarios-bootc/presubmits/el98-src@etcd.sh

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -16,84 +16,14 @@ EOF
1616

1717
scenario_create_vms() {
1818
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
19-
launch_vm --boot_blueprint rhel98-bootc
19+
launch_vm rhel98-bootc
2020
}
2121

2222
scenario_remove_vms() {
2323
remove_vm host1
2424
}
2525

2626
scenario_run_tests() {
27-
# The SYNC_FREQUENCY is set to a shorter-than-default value to speed up
28-
# pre-submit scenario completion time in DNS tests.
2927
run_tests host1 \
30-
--variable "EXPECTED_OS_VERSION:9.8" \
31-
--variable "SYNC_FREQUENCY:5s" \
32-
suites/standard1/dns.robot
33-
}
34-
#!/bin/bash
35-
36-
# Sourced from scenario.sh and uses functions defined there.
37-
38-
# Opt-in to dynamic VM scheduling by declaring requirements
39-
dynamic_schedule_requirements() {
40-
cat <<EOF
41-
min_vcpus=2
42-
min_memory=4096
43-
min_disksize=20
44-
networks=default
45-
boot_image=rhel98-bootc-source
46-
fips=false
47-
EOF
48-
}
49-
50-
scenario_create_vms() {
51-
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
52-
launch_vm --boot_blueprint rhel98-bootc
53-
}
54-
55-
scenario_remove_vms() {
56-
remove_vm host1
57-
}
58-
59-
scenario_run_tests() {
60-
# The SYNC_FREQUENCY is set to a shorter-than-default value to speed up
61-
# pre-submit scenario completion time in DNS tests.
62-
run_tests host1 \
63-
--variable "EXPECTED_OS_VERSION:9.8" \
64-
--variable "SYNC_FREQUENCY:5s" \
65-
suites/standard1/dns.robot
66-
}
67-
#!/bin/bash
68-
69-
# Sourced from scenario.sh and uses functions defined there.
70-
71-
# Opt-in to dynamic VM scheduling by declaring requirements
72-
dynamic_schedule_requirements() {
73-
cat <<EOF
74-
min_vcpus=2
75-
min_memory=4096
76-
min_disksize=20
77-
networks=default
78-
boot_image=rhel98-bootc-source
79-
fips=false
80-
EOF
81-
}
82-
83-
scenario_create_vms() {
84-
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
85-
launch_vm --boot_blueprint rhel98-bootc
86-
}
87-
88-
scenario_remove_vms() {
89-
remove_vm host1
90-
}
91-
92-
scenario_run_tests() {
93-
# The SYNC_FREQUENCY is set to a shorter-than-default value to speed up
94-
# pre-submit scenario completion time in DNS tests.
95-
run_tests host1 \
96-
--variable "EXPECTED_OS_VERSION:9.8" \
97-
--variable "SYNC_FREQUENCY:5s" \
9828
suites/standard1/etcd.robot
9929
}

test/scenarios-bootc/presubmits/el98-src@feature-gates.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ EOF
1616

1717
scenario_create_vms() {
1818
prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source
19-
launch_vm --boot_blueprint rhel98-bootc
19+
launch_vm rhel98-bootc
2020
}
2121

2222
scenario_remove_vms() {

test/scenarios-bootc/presubmits/el98-src@gateway-api.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ EOF
3333
scenario_create_vms() {
3434
LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source-optionals
3535
# Three nics - one for sriov, one for macvlan, another for ipvlan (they cannot enslave the same interface)
36-
launch_vm --boot_blueprint rhel98-bootc --network "${NETWORKS}" --vm_disksize 25 --vm_vcpus 4
36+
launch_vm rhel98-bootc --network "${NETWORKS}" --vm_disksize 25 --vm_vcpus 4
3737
}
3838

3939
scenario_remove_vms() {

test/scenarios-bootc/presubmits/el98-src@generic-device-plugin.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ EOF
3333
scenario_create_vms() {
3434
LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source-optionals
3535
# Three nics - one for sriov, one for macvlan, another for ipvlan (they cannot enslave the same interface)
36-
launch_vm --boot_blueprint rhel98-bootc --network "${NETWORKS}" --vm_disksize 25 --vm_vcpus 4
36+
launch_vm rhel98-bootc --network "${NETWORKS}" --vm_disksize 25 --vm_vcpus 4
3737
}
3838

3939
scenario_remove_vms() {

test/scenarios-bootc/presubmits/el98-src@healthchecks-disabled-service.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ EOF
3232
scenario_create_vms() {
3333
LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template rhel98-bootc-source-optionals
3434
# Three nics - one for sriov, one for macvlan, another for ipvlan (they cannot enslave the same interface)
35-
launch_vm --boot_blueprint rhel98-bootc --network "${NETWORKS}" --vm_disksize 25 --vm_vcpus 4
35+
launch_vm rhel98-bootc --network "${NETWORKS}" --vm_disksize 25 --vm_vcpus 4
3636
}
3737

3838
scenario_remove_vms() {

0 commit comments

Comments
 (0)