[Hotplug_sig] regression test cases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Now that I'm back from vacation, I've taken a deeper look at the test
cases and made a pass at rewording them in really ugly pseudocode...
Still very much a work in progress, but thought I'd toss this out for
comments in case I'm really way off base.

Bryce


########################################################################
# pseudocode version of test case 01

orig_smp_affinity_mask=`xxx`
irq_smp_affinity_mask="all cpus"
CPU_TO_OFFLINE=1

echo $hex_mask > /proc/irq/${irq}/smp_affinity

if [ $new_smp_affinity_mask != correct mask ]; then
    echo "Error:  Did not set smp_affinity mask correctly"
fi

bash do_disk_write_loop &
DISK_WRITE_LOOP_PID=$!
taskset -p ${DISK_WRITE_LOOP_PID}

# Offline a CPU
echo 0 > /sys/devices/system/cpu/cpu${CPU_TO_OFFLINE}/online
if [ $? != 0 ]; then
    echo "Error:  CPU${CPU_TO_OFFLINE} cannot be offlined"
fi

if [ $smp_affinity_mask != 'correct' ]; then
    echo "Error:  Affected disk controller's smp_affinity mask is wrong"
fi

# TODO:  Capture info from /proc/interrupts

# TODO:  Look for relevant messages in /var/log/messages


########################################################################
# test case 02 (already implemented)



########################################################################
# Pseudocode for hotplug03 test

# Test Case 3

# Checks that tasks are scheduled on a newly on-lined CPU

CPU_TO_ONLINE=1
NUM_PROC_PER_CPU=5

# Offline a CPU

Foreach processor
    for i in NUM_PROC_PER_CPU; do
        bash do_spin_loop &
        Add PID->CPU to our tracking list
    done
done

# Monitor processor utilization on each CPU

# Online the CPU

# Analyze the processor utilization to determine if one of the spinning
# tasks migrated to the new CPU
foreach pid in our tracking list
    determine which CPU the PID is on now
    if PID changed, report it
done


########################################################################
# Test Case 4 - Pseudocode

CPUS_AVAILABLE=`get cpus`

foreach cpu (reverse sort CPUS_AVAILABLE)
    if [ $cpu != 0 ]; then
        offline cpu
    elif [ -e /sys/devices/system/cpu/cpu${cpu}/online ]; then
        offline cpu
    else
        echo "/sys/devices/system/cpu/cpu${cpu}/online does not exist."
        echo "CPU${cpu} cannot be offlined."
    fi
done



########################################################################
# Test Case 5 - Pseudocode

# This test looks for memory leaks or deadlocks

INTERVAL=30
THRESHHOLD='xxx'

# TODO:  Start monitoring memory usage via vmstat and sar

# TODO:  Start dbt2, running for at least 4 hours

while [ 1 ]; do
    last if workload has completed

    select a cpu at random
    if cpu is online
        offline it
    else
        online it
    fi

    measure current throughput
    if [ throughput falls below $THRESHHOLD ]; then
        echo "Throughput has fallen below threshhold."
    fi

    sleep $INTERVAL
done

# Analyze system statistics to determine memory leaks
# Analyze drops in activities


########################################################################
# Test Case 6

CPU_TO_OFFLINE=1

# Verify top (assuming it's patched)
bash top &
TOP_PID=$!

offline $CPU_TO_OFFLINE
online $CPU_TO_OFFLINE

verify TOP_PID is still running


# TODO:  Verify sar


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux