#!/bin/sh # # Test Case 1 # # Based on script by Ashok Raj # Modified by Mark D and Bryce, Aug '05. export TCID="cpuhotplug01" export TST_TOTAL=1 # Includes: . test.sh . cpuhotplug_testsuite.sh . cpuhotplug_hotplug.sh cat <" fi # Validate the specified CPU is available if ! cpu_is_valid "${CPU_TO_TEST}" ; then tst_brkm TCONF "cpu${CPU_TO_TEST} doesn't support hotplug" fi if ! cpu_is_online "${CPU_TO_TEST}" ; then if ! online_cpu ${CPU_TO_TEST} ; then tst_brkm TBROK "Could not online cpu $CPU_TO_TEST" fi fi TST_CLEANUP=do_clean cpu_states=$(get_all_cpu_states) CPU_COUNT=0 # Start up a process that writes to disk; keep track of its PID cpuhotplug_do_disk_write_loop > /dev/null 2>&1 & WRL_ID=$! until [ $LOOP_COUNT -gt $HOTPLUG01_LOOPS ] do tst_resm TINFO "Starting loop" IRQ_START=$(cat /proc/interrupts) # Attempt to offline all CPUs for cpu in $( get_hotplug_cpus ); do if [ "$cpu" = "cpu0" ]; then continue fi do_offline $cpu err=$? if [ $err -ne 0 ]; then tst_brkm TBROK "offlining $cpu failed: $err" else tst_resm TINFO "offlining $cpu was ok" fi sleep $TM_OFFLINE done # Attempt to online all CPUs for cpu in $( get_hotplug_cpus ); do if [ "$cpu" = "cpu0" ]; then continue fi do_online $cpu err=$? if [ $err -ne 0 ]; then tst_brkm TBROK "onlining $cpu failed: $err" else tst_resm TINFO "onlining $cpu was ok" fi sleep $TM_ONLINE done IRQ_END=`cat /proc/interrupts` # Print out a report showing the changes in IRQs echo echo cpuhotplug_report_proc_interrupts "$IRQ_START" "$IRQ_END" echo sleep $TM_DLY LOOP_COUNT=$((LOOP_COUNT+1)) done tst_resm TPASS "online and offline cpu${CPU} when writing disk" tst_exit