DPDK patches and discussions
 help / color / mirror / Atom feed
* DTS testpmd and SCAPY integration
@ 2023-12-26  7:31 Etelson, Gregory
  2024-01-08  1:55 ` Honnappa Nagarahalli
  2024-01-08 12:10 ` Luca Vizzarro
  0 siblings, 2 replies; 20+ messages in thread
From: Etelson, Gregory @ 2023-12-26  7:31 UTC (permalink / raw)
  To: Thomas Monjalon, Juraj Linkeš,
	Honnappa Nagarahalli, Paul Szczepanek, Luca Vizzarro,
	Yoan Picchi, Jeremy Spewock, Gregory Etelson, Patrick Robb, ci,
	dev

Hello,

Consider an option to describe DTS test with testpmd and SCAPY plain text 
commands.

For example:

Scenario:
  - Configure UDP packet in SCAPY and a flow in testpmd.
  - Send UDP packet and validate testpmd output triggered by that packet.

```yaml
phase_0:
     name: CONFIGURATION
     tg: |
         udp_pkt = Ether()/IP()/UDP(sport=31)/Raw('== TEST ==')
         print('packet is ready')
     dut: |
         start
         set verbose 1
         flow create 0 ingress pattern eth / ipv4 / udp src is 31 / end actions queue index 1 / end
     result:
         dut: 'Flow rule #0 created'
         tg: 'packet is ready'

phase_1:
     name: SEND and VALIDATE
     tg: sendp(udp_pkt, iface=pf0)
     result:
         dut: '- RSS queue=0x1 -'
```

Test described as a sequence of phases.

Phase definition:
~~~~~~~~~~~~~~~~

```
<phase id>: # unique phase ID
     name: <phase name>                       # phase name
     <application ID (APP1)>: <APP1 commands> # application APP1 commands
     ...
     <application ID (APPy)>: <APPy commands> # application APPy commands
     ...
     <application ID (APPx)>: <APPx commands> # application APPx commands

     result:                # optional phase results verification section
         <application ID APPx>: <expected output>  # APPx expected output
         ...
         <application ID APPy>: <expected output>  # APPy expected output
```

- Application commands in a phase executed sequentially,
   in order of application IDs: <APPy> commands executed
   before <APPx> commands.

- Application results in a phase validated sequentially,
   in order of application IDs: <APPx> result validated
   before APPy result.

- Application result is a regular expression.


Test application definition:
~~~~~~~~~~~~~~~~~~~~~~~~~~~

```
<application ID>: # unique application ID
     agent:        # mandatory application type identifier: {testpmd|scapy}
     cmd:          # optional application command template
```

Example:

```yaml

dut:
     agent: testpmd
     cmd: 'dpdk-testpmd -a pci0 -- -i --rxq=4 --txq=4'

tg:
     agent: scapy
```

Test commands do not bound to a specific setup.
Therefore, testpmd commad line and SCAPY sendp() function use encoding
to describe relative interface position in a tested HBA.

PCI encoding scheme for testpmd:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- PF PCI: `pciX`
   Example: `pci0: '0000:08:00.0'`


- PCI SR-IOV: `pciXvfY`
   Example: `pci0vf0: '0000:08:00.2'`

Network devices encoding scheme for SCAPY:
- PF: `pfX`
   Example: `pf0: enp8s0f0np0`


- PCI SR-IOV: `pfXvfY`
   Example: `pf0vf0: enp5s0f0v0`


- Network device representor: `pfXrfY`

      Example: `pf0rf0: enp5s0f0npf0vf0`


Test execution requires an additional file to describe tested setup.

Setup file format:
~~~~~~~~~~~~~~~~~

```
<application id>: # unique application ID
     host:         # hostname or IPvX address
     path:         # optional application path
     hba:          # optional HBA description
         pmd:      # PMD
         hw:       # HW type
```

Example:

```yaml
dut:
     host: 1.2.3.4
     path: /opt/dpdk.org/build/app
     hba:
         pmd: mlx5
         hw: mt4125
tg:
     host: ::1234
```

```yaml
dut:
     agent: testpmd
     cmd: 'dpdk-testpmd -a pci0 -- -i --rxq=4 --txq=4'
tg:
     agent: scapy

test:
     -
         phases: [ *ref_phase0 ]
         repeat: 1
     -
         phases: [ *ref_phase1 ]
         repeat: 3

phase_0: &ref_phase0
     name: CONFIGURATION
     tg: |
         udp_pkt = Ether()/IP()/UDP(sport=31)/Raw('== TEST ==')
         print('packet is ready')
     dut: |
         start
         set verbose 1
         flow create 0 ingress pattern eth / ipv4 / udp src is 31 / end actions queue index 1 / end
     result:
         dut: 'Flow rule #0 created'
         tg: 'packet is ready'

phase_1: &ref_phase1
     name: SEND and VALIDATE
     tg: sendp(udp_pkt, iface=pf0)
     result:
         dut: '- RSS queue=0x1 -'
```

The plain text format provides minimalistic and intuitive framework for DTS 
tests.
DTS can use plan text testpmd/scapy command format in addition to Python 
framework.

Regards,
Gregory

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-02-20 13:35 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-26  7:31 DTS testpmd and SCAPY integration Etelson, Gregory
2024-01-08  1:55 ` Honnappa Nagarahalli
2024-01-08  6:10   ` Etelson, Gregory
2024-01-08 17:36     ` Honnappa Nagarahalli
2024-01-18 12:32       ` Juraj Linkeš
2024-01-19 20:01         ` Patrick Robb
2024-01-08 12:17   ` Luca Vizzarro
2024-01-08 17:35     ` Honnappa Nagarahalli
2024-01-08 12:10 ` Luca Vizzarro
2024-01-08 17:23   ` Etelson, Gregory
2024-01-22 17:31   ` Thomas Monjalon
2024-01-23  3:42     ` Honnappa Nagarahalli
2024-01-23  8:50       ` Thomas Monjalon
2024-01-23 18:26         ` Jeremy Spewock
2024-01-28 13:44           ` Gregory Etelson
2024-01-30 22:03             ` Patrick Robb
2024-01-31  7:42               ` Etelson, Gregory
2024-02-14 17:27                 ` Gregory Etelson
2024-02-19  5:08                   ` Patrick Robb
2024-02-20 13:35                     ` Gregory Etelson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).