Skip to content

Commit f4a5d29

Browse files
authored
Merge pull request #509 from byllyfish/examples
Re-compile example P4 programs; rename p4info.txt to p4info.txtpb
2 parents 20fd10e + e782899 commit f4a5d29

File tree

26 files changed

+68
-19
lines changed

26 files changed

+68
-19
lines changed

docs/packets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Here's the initial setup.
1515
```pycon
1616
>>> from finsy import P4PacketOut, P4PacketIn, P4Schema
1717
>>> from pathlib import Path
18-
>>> p4info = P4Schema(Path('examples/ngsdn/ngsdn/p4/main.p4info.txt'))
18+
>>> p4info = P4Schema(Path('examples/ngsdn/ngsdn/p4/main.p4info.txtpb'))
1919

2020
```
2121

docs/replication_entry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Here's the initial setup.
1919
```pycon
2020
>>> from finsy import P4MulticastGroupEntry, P4CloneSessionEntry, P4Schema
2121
>>> from pathlib import Path
22-
>>> p4info = P4Schema(Path('examples/ngsdn/ngsdn/p4/main.p4info.txt'))
22+
>>> p4info = P4Schema(Path('examples/ngsdn/ngsdn/p4/main.p4info.txtpb'))
2323

2424
```
2525

docs/table_entry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Here's the initial setup:
1818
```pycon
1919
>>> from finsy import P4Schema, P4TableEntry, Match, Action, IndirectAction
2020
>>> from pathlib import Path
21-
>>> p4info = P4Schema(Path('examples/ngsdn/ngsdn/p4/main.p4info.txt'))
21+
>>> p4info = P4Schema(Path('examples/ngsdn/ngsdn/p4/main.p4info.txtpb'))
2222

2323
```
2424

examples/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ podman or docker to run the demonstration network in a container.
1313

1414
### Requirements
1515

16-
- Python 3.10 (or later) virtual environment with `finsy` installed.
17-
- [podman](https://podman.io/) or [docker](https://docker.com)
16+
- Python 3.10 (or later) virtual environment.
17+
- [podman](https://podman.io/) or [docker](https://docker.com) installed on the host and available in PATH.
18+
- Finsy with the demonet extra installed: `pip install finsy[demonet]`
1819

1920
## gnmi
2021

@@ -59,6 +60,10 @@ To run the integration tests, enter the examples directory and type
5960
`pytest`. Each test module will create a Mininet instance, run its tests in order,
6061
then stop Mininet.
6162

63+
To use pytest, you will need to install the Finsy `dev` dependencies in your virtualenv:
64+
65+
- `pip install -r ./ci/requirements-dev.txt`
66+
6267
## References
6368

6469
Most of the Finsy example programs use P4 programs from other open source projects. These

examples/basic/demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def ipv4_lpm_drop_default():
5959
async def main():
6060
"Main program."
6161
opts = fy.SwitchOptions(
62-
p4info=_P4SRC / "basic.p4info.txt",
62+
p4info=_P4SRC / "basic.p4info.txtpb",
6363
p4blob=_P4SRC / "basic.json",
6464
p4force=True, # Always reload P4 program upon connection.
6565
)

examples/hello/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This demo program reads an existing P4Info file and prints out a description of
1212
contents.
1313

1414
```
15-
$ python demo0.py p4/hello.p4info.txt
15+
$ python demo0.py p4/hello.p4info.txtpb
1616
```
1717

1818
You should see output like:

examples/hello/demo1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def ready_handler(sw: fy.Switch):
4646
async def main():
4747
"Main program."
4848
options = fy.SwitchOptions(
49-
p4info=P4SRC / "hello.p4info.txt",
49+
p4info=P4SRC / "hello.p4info.txtpb",
5050
p4blob=P4SRC / "hello.json",
5151
ready_handler=ready_handler,
5252
)

examples/hello/demo2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DemoApp:
2626
"Hello World, demo app."
2727

2828
CONTROLLER_PORT = 255
29-
P4INFO = P4SRC / "hello.p4info.txt"
29+
P4INFO = P4SRC / "hello.p4info.txtpb"
3030
P4BLOB = P4SRC / "hello.json"
3131

3232
def __init__(self):

examples/hello/demo3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DemoRoleApp:
2828
"Hello World, demo app (with role support)."
2929

3030
CONTROLLER_PORT = 255
31-
P4INFO = P4SRC / "hello.p4info.txt"
31+
P4INFO = P4SRC / "hello.p4info.txtpb"
3232
P4BLOB = P4SRC / "hello.json"
3333

3434
def __init__(self):

0 commit comments

Comments
 (0)