@@ -206,30 +206,32 @@ func clearEnv() {
206206
207207func getValidValuesTests (toolToTest string ) []latencyTest {
208208 var testSet []latencyTest
209- testSet = append (testSet , latencyTest {testDelay : "0" , testRun : "true" , testRuntime : "5" , testMaxLatency : guaranteedLatency , testCpus : "2" , outputMsgs : []string {success }, toolToTest : toolToTest })
210- testSet = append (testSet , latencyTest {testDelay : "0" , testRun : "true" , testRuntime : "1" , testMaxLatency : guaranteedLatency , testCpus : "5" , outputMsgs : []string {success }, toolToTest : toolToTest })
211- //BZ https://bugzilla.redhat.com/show_bug.cgi?id=2006675
212- if toolToTest == oslat {
213- testSet = append (testSet , latencyTest {testDelay : "1" , testRun : "true" , testRuntime : "2" , testMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
214- testSet = append (testSet , latencyTest {testDelay : "60" , testRun : "true" , testRuntime : "2" , testMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
215- }
209+
210+ //testRuntime: let runtime be 10 seconds for most of the tests and not less, that is to let the tools
211+ //have their time to measure latency properly hence stabilizing the tests
212+ //testCpus: for tests that expect a success output message, note that an even CPU number is needed, otherwise the test would fail with SMTAlignmentError
213+ testSet = append (testSet , latencyTest {testDelay : "0" , testRun : "true" , testRuntime : "10" , testMaxLatency : guaranteedLatency , testCpus : "2" , outputMsgs : []string {success }, toolToTest : toolToTest })
214+ testSet = append (testSet , latencyTest {testDelay : "0" , testRun : "true" , testRuntime : "10" , testMaxLatency : guaranteedLatency , testCpus : "6" , outputMsgs : []string {success }, toolToTest : toolToTest })
215+ testSet = append (testSet , latencyTest {testDelay : "1" , testRun : "true" , testRuntime : "10" , testMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
216+ testSet = append (testSet , latencyTest {testDelay : "60" , testRun : "true" , testRuntime : "2" , testMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
217+
216218 if toolToTest != hwlatdetect {
217- testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "5 " , outputMsgs : []string {skip , skipMaxLatency }, toolToTest : toolToTest })
219+ testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "1 " , outputMsgs : []string {skip , skipMaxLatency }, toolToTest : toolToTest })
218220 }
219221 if toolToTest == oslat {
220- testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "5 " , testMaxLatency : "1" , oslatMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
221- testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "5 " , oslatMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
222- testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "2 " , testMaxLatency : guaranteedLatency , testCpus : "1" , outputMsgs : []string {skip , skipOslatCpuNumber }, toolToTest : toolToTest })
222+ testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "10 " , testMaxLatency : "1" , oslatMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
223+ testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "10 " , oslatMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
224+ testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "10 " , testMaxLatency : guaranteedLatency , testCpus : "1" , outputMsgs : []string {skip , skipOslatCpuNumber }, toolToTest : toolToTest })
223225 }
224226 if toolToTest == cyclictest {
225- testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "5 " , testMaxLatency : "1" , cyclictestMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
226- testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "5 " , cyclictestMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
227+ testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "10 " , testMaxLatency : "1" , cyclictestMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
228+ testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "10 " , cyclictestMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
227229
228230 }
229231 if toolToTest == hwlatdetect {
230- testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "5 " , testMaxLatency : "1" , hwlatdetectMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
231- testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "5 " , hwlatdetectMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
232- testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "5 " , outputMsgs : []string {success }, toolToTest : toolToTest })
232+ testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "10 " , testMaxLatency : "1" , hwlatdetectMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
233+ testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "10 " , hwlatdetectMaxLatency : guaranteedLatency , outputMsgs : []string {success }, toolToTest : toolToTest })
234+ testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : "10 " , outputMsgs : []string {success }, toolToTest : toolToTest })
233235 }
234236 return testSet
235237}
@@ -240,7 +242,7 @@ func getNegativeTests(toolToTest string) []latencyTest {
240242 if toolToTest == hwlatdetect {
241243 latencyFailureMsg = hwlatdetectFail
242244 }
243-
245+ //TODO: add test to check odd CPU request.
244246 testSet = append (testSet , latencyTest {testDelay : "0" , testRun : "true" , testRuntime : "5" , testMaxLatency : "1" , outputMsgs : []string {latencyFailureMsg , fail }, toolToTest : toolToTest })
245247 testSet = append (testSet , latencyTest {testRun : "yes" , testRuntime : "5" , testMaxLatency : "1" , outputMsgs : []string {incorrectTestRun , fail }, toolToTest : toolToTest })
246248 testSet = append (testSet , latencyTest {testRun : "true" , testRuntime : fmt .Sprint (math .MaxInt32 + 1 ), outputMsgs : []string {invalidNumberRuntime , fail }, toolToTest : toolToTest })
0 commit comments