1*ca97c83dSPatrick Venture#!/bin/bash 2*ca97c83dSPatrick Venture 3*ca97c83dSPatrick VentureSourceModule() { 4*ca97c83dSPatrick Venture . fan_rpm_loop_test.sh 5*ca97c83dSPatrick Venture} 6*ca97c83dSPatrick Venture 7*ca97c83dSPatrick VentureSetupShims() { 8*ca97c83dSPatrick Venture MkDir() { echo "MkDir $*"; } 9*ca97c83dSPatrick Venture Mv() { echo "Mv $*"; } 10*ca97c83dSPatrick Venture Sleep() { echo "Sleep $*"; } 11*ca97c83dSPatrick Venture SystemCtl() { echo "SystemCtl $*"; } 12*ca97c83dSPatrick Venture CommandRpm() { echo "CommandRpm $*"; } 13*ca97c83dSPatrick Venture} 14*ca97c83dSPatrick Venture 15*ca97c83dSPatrick VentureTestRunRpmStepsWorks() { 16*ca97c83dSPatrick Venture RunRpmSteps 1000 5000 3 30 || return 17*ca97c83dSPatrick Venture RunRpmSteps 5000 1000 3 30 || return 18*ca97c83dSPatrick Venture RunRpmSteps 1000 5000 1 30 || return 19*ca97c83dSPatrick Venture RunRpmSteps 5000 1000 1 30 || return 20*ca97c83dSPatrick Venture} 21*ca97c83dSPatrick Venture 22*ca97c83dSPatrick VentureTestMainRejectsLowMinAndMax() { 23*ca97c83dSPatrick Venture if main 0 0; then 24*ca97c83dSPatrick Venture echo "main 0 0 not rejected?" 25*ca97c83dSPatrick Venture return 1 26*ca97c83dSPatrick Venture fi 27*ca97c83dSPatrick Venture if main 1 0; then 28*ca97c83dSPatrick Venture echo "main 1 0 not rejected?" 29*ca97c83dSPatrick Venture return 1 30*ca97c83dSPatrick Venture fi 31*ca97c83dSPatrick Venture} 32*ca97c83dSPatrick Venture 33*ca97c83dSPatrick VentureTestMainWorks() { 34*ca97c83dSPatrick Venture main 1000 5005 || return 35*ca97c83dSPatrick Venture} 36*ca97c83dSPatrick Venture 37*ca97c83dSPatrick Venturemain() { 38*ca97c83dSPatrick Venture SourceModule || return 39*ca97c83dSPatrick Venture SetupShims || return 40*ca97c83dSPatrick Venture TestRunRpmStepsWorks || return 41*ca97c83dSPatrick Venture TestMainRejectsLowMinAndMax || return 42*ca97c83dSPatrick Venture TestMainWorks || return 43*ca97c83dSPatrick Venture echo "All tests completed." 44*ca97c83dSPatrick Venture} 45*ca97c83dSPatrick Venture 46*ca97c83dSPatrick Venturereturn 0 2>/dev/null 47*ca97c83dSPatrick Venturemain "$@" 48*ca97c83dSPatrick Venture 49