ee00af6017
The tests 'alarm_autotest' and 'cycles_autotest' rely on the underlying system having very accurate and precise timing. On systems where the timing isn't as rigid, or the load is particularly high, these tests are unreliable since the wake latency from the scheduler can be high enough to miss the timing window. Remove the timing related tests from the test suites. These tests now ensure the add/remove callback infrastructure unit tests, but drop the waits and reliance on system timing and load. This avoids FAIL on various testing infrastructures. Signed-off-by: Aaron Conole <aconole@redhat.com>
57 lines
908 B
C
57 lines
908 B
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright(c) 2010-2014 Intel Corporation
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
|
|
#include <rte_common.h>
|
|
#include <rte_cycles.h>
|
|
|
|
#include "test.h"
|
|
|
|
/*
|
|
* rte_delay_us_callback test
|
|
*
|
|
* - check if callback is correctly registered/unregistered
|
|
*
|
|
*/
|
|
|
|
static unsigned int pattern;
|
|
static void my_rte_delay_us(unsigned int us)
|
|
{
|
|
pattern += us;
|
|
}
|
|
|
|
static int
|
|
test_user_delay_us(void)
|
|
{
|
|
pattern = 0;
|
|
|
|
rte_delay_us(2);
|
|
if (pattern != 0)
|
|
return -1;
|
|
|
|
/* register custom delay function */
|
|
rte_delay_us_callback_register(my_rte_delay_us);
|
|
|
|
rte_delay_us(2);
|
|
if (pattern != 2)
|
|
return -1;
|
|
|
|
rte_delay_us(3);
|
|
if (pattern != 5)
|
|
return -1;
|
|
|
|
/* restore original delay function */
|
|
rte_delay_us_callback_register(rte_delay_us_block);
|
|
|
|
rte_delay_us(3);
|
|
if (pattern != 5)
|
|
return -1;
|
|
|
|
return 0;
|
|
}
|
|
|
|
REGISTER_TEST_COMMAND(user_delay_us, test_user_delay_us);
|