<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/tc-testing/tdc.py, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-10-27T03:22:33Z</updated>
<entry>
<title>selftests: tc-testing: Add matchJSON to tdc</title>
<updated>2022-10-27T03:22:33Z</updated>
<author>
<name>Victor Nogueira</name>
<email>victor@mojatatu.com</email>
</author>
<published>2022-10-24T11:16:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=95d9a3dab109f2806980d55634972120824a5a5a'/>
<id>urn:sha1:95d9a3dab109f2806980d55634972120824a5a5a</id>
<content type='text'>
This allows the use of a matchJSON field in tests to match
against JSON output from the command under test, if that
command outputs JSON.

You specify what you want to match against as a JSON array
or object in the test's matchJSON field. You can leave out
any fields you don't want to match against that are present
in the output and they will be skipped.

An example matchJSON value would look like this:

"matchJSON": [
  {
    "Value": {
      "neighIP": {
        "family": 4,
        "addr": "AQIDBA==",
        "width": 32
      },
      "nsflags": 142,
      "ncflags": 0,
      "LLADDR": "ESIzRFVm"
    }
  }
]

The real output from the command under test might have some
extra fields that we don't care about for matching, and
since we didn't include them in our matchJSON value, those
fields will not be attempted to be matched. If everything
we included above has the same values as the real command
output, the test will pass.

The matchJSON field's type must be the same as the command
output's type, otherwise the test will fail. So if the
command outputs an array, then the value of matchJSON must
also be an array.

If matchJSON is an array, it must not contain more elements
than the command output's array, otherwise the test will
fail.

Signed-off-by: Jeremy Carter &lt;jeremy@mojatatu.com&gt;
Signed-off-by: Victor Nogueira &lt;victor@mojatatu.com&gt;
Acked-by: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Link: https://lore.kernel.org/r/20221024111603.2185410-1-victor@mojatatu.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/tc-testing: add exit code</title>
<updated>2021-12-03T11:46:41Z</updated>
<author>
<name>Li Zhijian</name>
<email>zhijianx.li@intel.com</email>
</author>
<published>2021-12-03T02:53:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=96f3896780153214040a6747974bebc1355307c0'/>
<id>urn:sha1:96f3896780153214040a6747974bebc1355307c0</id>
<content type='text'>
Mark the summary result as FAIL to prevent from confusing the selftest
framework if some of them are failed.

Previously, the selftest framework always treats it as *ok* even though
some of them are failed actually. That's because the script tdc.sh always
return 0.

 # All test results:
 #
 # 1..97
 # ok 1 83be - Create FQ-PIE with invalid number of flows
 # ok 2 8b6e - Create RED with no flags
[...snip]
 # ok 6 5f15 - Create RED with flags ECN, harddrop
 # ok 7 53e8 - Create RED with flags ECN, nodrop
 # ok 8 d091 - Fail to create RED with only nodrop flag
 # ok 9 af8e - Create RED with flags ECN, nodrop, harddrop
 # not ok 10 ce7d - Add mq Qdisc to multi-queue device (4 queues)
 #       Could not match regex pattern. Verify command output:
 # qdisc mq 1: root
 # qdisc fq_codel 0: parent 1:4 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
 # qdisc fq_codel 0: parent 1:3 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64
[...snip]
 # ok 96 6979 - Change quantum of a strict ETS band
 # ok 97 9a7d - Change ETS strict band without quantum
 #
 #
 #
 #
 ok 1 selftests: tc-testing: tdc.sh &lt;&lt;&lt; summary result

CC: Philip Li &lt;philip.li@intel.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Li Zhijian &lt;zhijianx.li@intel.com&gt;
Acked-by: Davide Caratti &lt;dcaratti@redhat.com&gt;
Acked-by: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tc-testing: remove duplicate code in tdc.py</title>
<updated>2020-04-08T01:38:55Z</updated>
<author>
<name>Roman Mashak</name>
<email>mrv@mojatatu.com</email>
</author>
<published>2020-04-07T17:13:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cb9533d1c683219bc982905046c05e24bfaf4996'/>
<id>urn:sha1:cb9533d1c683219bc982905046c05e24bfaf4996</id>
<content type='text'>
In set_operation_mode() function remove duplicated check for args.list
parameter, which is already done one line before.

Signed-off-by: Roman Mashak &lt;mrv@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tc-testing: Clarify the use of tdc's -d option</title>
<updated>2019-07-31T22:54:34Z</updated>
<author>
<name>Lucas Bates</name>
<email>lucasb@mojatatu.com</email>
</author>
<published>2019-07-29T23:18:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0eba31ef5c8913adfd103c45c32d4856f1aa85cc'/>
<id>urn:sha1:0eba31ef5c8913adfd103c45c32d4856f1aa85cc</id>
<content type='text'>
The -d command line argument to tdc requires the name of a physical device
on the system where the tests will be run. If -d has not been used, tdc
will skip tests that require a physical device.

This patch is intended to better document what the -d option does and how
it is used.

Signed-off-by: Lucas Bates &lt;lucasb@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tc-testing: Allow tdc plugins to see test case data</title>
<updated>2019-07-09T21:07:20Z</updated>
<author>
<name>Lucas Bates</name>
<email>lucasb@mojatatu.com</email>
</author>
<published>2019-07-09T01:34:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a7d50a0dd81b09dc13fa9e4b55765e8684bc8226'/>
<id>urn:sha1:a7d50a0dd81b09dc13fa9e4b55765e8684bc8226</id>
<content type='text'>
Instead of only passing the test case name and ID, pass the
entire current test case down to the plugins. This change
allows plugins to start accepting commands and directives
from the test cases themselves, for greater flexibility
in testing.

Signed-off-by: Lucas Bates &lt;lucasb@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tc-testing: Restore original behaviour for namespaces in tdc</title>
<updated>2019-06-25T19:57:29Z</updated>
<author>
<name>Lucas Bates</name>
<email>lucasb@mojatatu.com</email>
</author>
<published>2019-06-25T01:00:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=489ce2f42514b4324e5c63e93ae7570cab995254'/>
<id>urn:sha1:489ce2f42514b4324e5c63e93ae7570cab995254</id>
<content type='text'>
This patch restores the original behaviour for tdc prior to the
introduction of the plugin system, where the network namespace
functionality was split from the main script.

It introduces the concept of required plugins for testcases,
and will automatically load any plugin that isn't already
enabled when said plugin is required by even one testcase.

Additionally, the -n option for the nsPlugin is deprecated
so the default action is to make use of the namespaces.
Instead, we introduce -N to not use them, but still create
the veth pair.

buildebpfPlugin's -B option is also deprecated.

If a test cases requires the features of a specific plugin
in order to pass, it should instead include a new key/value
pair describing plugin interactions:

        "plugins": {
                "requires": "buildebpfPlugin"
        },

A test case can have more than one required plugin: a list
can be inserted as the value for 'requires'.

Signed-off-by: Lucas Bates &lt;lucasb@mojatatu.com&gt;
Acked-by: Davide Caratti &lt;dcaratti@redhat.com&gt;
Tested-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tc-testing: Allow test cases to be skipped</title>
<updated>2019-03-02T07:05:06Z</updated>
<author>
<name>Lucas Bates</name>
<email>lucasb@mojatatu.com</email>
</author>
<published>2019-02-28T22:38:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=255c1c7279abf991113e7c9c29f91e9f1a5776a9'/>
<id>urn:sha1:255c1c7279abf991113e7c9c29f91e9f1a5776a9</id>
<content type='text'>
By adding a check for an optional key/value pair to the test case
data, individual test cases may be skipped to prevent tdc from
aborting a test run due to setup or teardown failure.

If a test case is skipped, it will still appear in the results
output to allow for a consistent number of executed tests in each
run. However, the test will be marked as skipped.

This support for skipping extends to any plugins that may generate
additional results for each executed test.

Signed-off-by: Lucas Bates &lt;lucasb@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tc-testing: Implement the TdcResults module in tdc</title>
<updated>2018-12-08T00:39:03Z</updated>
<author>
<name>Lucas Bates</name>
<email>lucasb@mojatatu.com</email>
</author>
<published>2018-12-06T22:42:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=915c158deaf97be49e71250f43e1539542217962'/>
<id>urn:sha1:915c158deaf97be49e71250f43e1539542217962</id>
<content type='text'>
In tdc and the valgrind plugin, begin using the TdcResults module
to track executed test cases.

Signed-off-by: Lucas Bates &lt;lucasb@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tc-testing: Add command timeout feature to tdc</title>
<updated>2018-12-08T00:39:03Z</updated>
<author>
<name>Lucas Bates</name>
<email>lucasb@mojatatu.com</email>
</author>
<published>2018-12-06T22:42:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d37e56df23f9e5916f95b60388c3f179c53c7102'/>
<id>urn:sha1:d37e56df23f9e5916f95b60388c3f179c53c7102</id>
<content type='text'>
Using an attribute set in the tdc_config.py file, limit the
amount of time tdc will wait for an executed command to
complete and prevent the script from hanging entirely.

This timeout will be applied to all executed commands.

Signed-off-by: Lucas Bates &lt;lucasb@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tc-testing: tdc.py: Guard against lack of returncode in executed command</title>
<updated>2018-11-18T05:54:53Z</updated>
<author>
<name>Brenda J. Butler</name>
<email>bjb@mojatatu.com</email>
</author>
<published>2018-11-16T22:37:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c6cecf4ae44e4ce9158ef8806358142c3512cd33'/>
<id>urn:sha1:c6cecf4ae44e4ce9158ef8806358142c3512cd33</id>
<content type='text'>
Add some defensive coding in case one of the subprocesses created by tdc
returns nothing. If no object is returned from exec_cmd, then tdc will
halt with an unhandled exception.

Signed-off-by: Brenda J. Butler &lt;bjb@mojatatu.com&gt;
Signed-off-by: Lucas Bates &lt;lucasb@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
