[Fuego] [PATCH] rt-migrate-test: Add a new rt-tests

Tim.Bird at sony.com Tim.Bird at sony.com
Thu Feb 8 01:09:26 UTC 2018



> -----Original Message-----
> From: Hoang Van Tuyen
> 
> Description of the test: Test real-time multiprocessor scheduling of tasks
> to ensure the highest priority tasks are running on all available CPUs.
> 
> Signed-off-by: Hoang Van Tuyen <tuyen.hoangvan at toshiba-tsdv.com>
> ---
>   .../tests/Benchmark.migratetest/chart_config.json  |  5 ++++
>   engine/tests/Benchmark.migratetest/criteria.json   | 26
> +++++++++++++++++++
>   engine/tests/Benchmark.migratetest/fuego_test.sh   | 21
> ++++++++++++++++
>   engine/tests/Benchmark.migratetest/parser.py       | 29
> ++++++++++++++++++++++
>   engine/tests/Benchmark.migratetest/reference.json  | 26
> +++++++++++++++++++
>   engine/tests/Benchmark.migratetest/spec.json       | 14 +++++++++++
>   6 files changed, 121 insertions(+)
>   create mode 100644
> engine/tests/Benchmark.migratetest/chart_config.json
>   create mode 100644 engine/tests/Benchmark.migratetest/criteria.json
>   create mode 100755 engine/tests/Benchmark.migratetest/fuego_test.sh
>   create mode 100755 engine/tests/Benchmark.migratetest/parser.py
>   create mode 100644 engine/tests/Benchmark.migratetest/reference.json
>   create mode 100644 engine/tests/Benchmark.migratetest/spec.json
> 
> diff --git a/engine/tests/Benchmark.migratetest/chart_config.json
> b/engine/tests/Benchmark.migratetest/chart_config.json
> new file mode 100644
> index 0000000..3cbaef2
> --- /dev/null
> +++ b/engine/tests/Benchmark.migratetest/chart_config.json
> @@ -0,0 +1,5 @@
> +{
> +    "chart_type": "measure_plot",
> +    "measures": ["default.intervals.max_interval",
> +        "default.intervals.avg_interval"]
> +}
> diff --git a/engine/tests/Benchmark.migratetest/criteria.json
> b/engine/tests/Benchmark.migratetest/criteria.json
> new file mode 100644
> index 0000000..ad3df6b
> --- /dev/null
> +++ b/engine/tests/Benchmark.migratetest/criteria.json
> @@ -0,0 +1,26 @@
> +{
> +    "schema_version":"1.0",
> +    "criteria":[
> +        {
> +            "tguid":"default.intervals.max_interval",
> +            "reference":{
> +                "value":30000,
> +                "operator":"le"
> +            }
> +        },
> +        {
> +            "tguid":"default.intervals.min_interval",
> +            "reference":{
> +                "value":30000,
> +                "operator":"le"
> +            }
> +        },
> +        {
> +            "tguid":"default.intervals.avg_interval",
> +            "reference":{
> +                "value":30000,
> +                "operator":"le"
> +            }
> +        }
> +    ]
> +}
> diff --git a/engine/tests/Benchmark.migratetest/fuego_test.sh
> b/engine/tests/Benchmark.migratetest/fuego_test.sh
> new file mode 100755
> index 0000000..bc3627a
> --- /dev/null
> +++ b/engine/tests/Benchmark.migratetest/fuego_test.sh
> @@ -0,0 +1,21 @@
> +tarball=../rt-tests/rt-tests-v1.1.1.tar.gz
> +
> +NEED_ROOT=1
> +TEST_COMMAND="rt-migrate-test"

I like the use of TEST_COMMAND to avoid duplication.  It helps to
see the connection between build, deploy and run.
We should make that a convention in other Fuego tests.

> +
> +function test_pre_check {
> +    assert_define BENCHMARK_RT_MIGRATE_TEST_PARAMS
> +}
> +
> +function test_build {
> +    patch -p1 -N -s <
> $TEST_HOME/../rt-tests/0001-Add-scheduling-policies-for-old-kernels.patch
> +    make NUMA=0 ${TEST_COMMAND}
> +}
> +
> +function test_deploy {
> +    put ${TEST_COMMAND} $BOARD_TESTDIR/fuego.$TESTDIR/
> +}
> +
> +function test_run {
> +    report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./${TEST_COMMAND}
> $BENCHMARK_RT_MIGRATE_TEST_PARAMS"
> +}
> diff --git a/engine/tests/Benchmark.migratetest/parser.py
> b/engine/tests/Benchmark.migratetest/parser.py
> new file mode 100755
> index 0000000..ae88f04
> --- /dev/null
> +++ b/engine/tests/Benchmark.migratetest/parser.py
> @@ -0,0 +1,29 @@
> +#!/usr/bin/python
> +import os, re, sys
> +sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
> +import common as plib
> +
> +regex_string_max = "Max:\s+(\d+)\s+us"
> +regex_string_min = "Min:\s+(\d+)\s+us"
> +regex_string_avg = "Avg:\s+(\d+)\s+us"
> +measurements = {}
> +matches_max = plib.parse_log(regex_string_max)
> +matches_min = plib.parse_log(regex_string_min)
> +matches_avg = plib.parse_log(regex_string_avg)
> +
> +if matches_max and matches_min and matches_avg:
> +    min_intervals = []
> +    avg_intervals = []
> +    max_intervals = []
> +    for thread_max in matches_max:
> +        max_intervals.append(float(thread_max[0]))
> +    for thread_min in matches_min:
> +        min_intervals.append(float(thread_min[0]))
> +    for thread_avg in matches_avg:
> +        avg_intervals.append(float(thread_avg[0]))
> +    measurements['default.intervals'] = [
> +        {"name": "max_interval", "measure" : max(max_intervals)},
> +        {"name": "min_interval", "measure" : min(min_intervals)},
> +        {"name": "avg_interval", "measure" :
> sum(avg_intervals)/len(avg_intervals)}]
> +
> +sys.exit(plib.process(measurements))
> diff --git a/engine/tests/Benchmark.migratetest/reference.json
> b/engine/tests/Benchmark.migratetest/reference.json
> new file mode 100644
> index 0000000..d1dd0bc
> --- /dev/null
> +++ b/engine/tests/Benchmark.migratetest/reference.json
> @@ -0,0 +1,26 @@
> +{
> +    "test_sets":[
> +        {
> +            "name":"default",
> +            "test_cases":[
> +                {
> +                    "name":"intervals",
> +                    "measurements":[
> +                        {
> +                            "name":"max_interval",
> +                            "unit":"us"
> +                        },
> +                        {
> +                            "name":"min_interval",
> +                            "unit":"us"
> +                        },
> +                        {
> +                            "name":"avg_interval",
> +                            "unit":"us"
> +                        }
> +                    ]
> +                }
> +            ]
> +        }
> +    ]
> +}
> diff --git a/engine/tests/Benchmark.migratetest/spec.json
> b/engine/tests/Benchmark.migratetest/spec.json
> new file mode 100644
> index 0000000..6d42f36
> --- /dev/null
> +++ b/engine/tests/Benchmark.migratetest/spec.json
> @@ -0,0 +1,14 @@
> +{
> +    "testName": "Benchmark.rt_migrate_test",
> +    "specs": {
> +        "default": {
> +            "PARAMS": "-l 10"
> +        },
> +        "latest": {
> +            "PER_JOB_BUILD": "true",
> +            "gitrepo":
> "https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git",
> +            "gitref": "unstable/devel/v1.1.1",
> +            "PARAMS": " "
> +        }
> +    }
> +}
> --
> 2.1.4
Looks great.  Applied and pushed.
 -- Tim



More information about the Fuego mailing list