<commit_before># Test cases

This directory contains a few test cases with and without physical 10GE interfaces.

## lwaftr1 (no physical ports required)

This test creates a Docker virtual network 'net-lwaftr1' that connects the vmxlwaftr Container 
lwaftr1 with B4 client simulation Containers b4cpe1 and b4cpe2 according to the following
diagram: [net-lwaftr1 diagram](net-lwaftr1.png):

### Preparation

Create the Docker network net-lwaftr1 with the script [create-lwaftr1-testbed.sh](create-lwaftr1-testbed.sh). This creates a virtual bridge on the Linux host with IPv4 and dual IPv6 networks: one to cnnect to the vMX lwaftr1 and the other one to the B4 clients. The virtual bridge routes between
the IPv6 networks. This is required to simulate multiple B4 clients. The script finally sets up SNAT
masquerading to hide the simulated public IPv4 network behind the Docker engines host IP address.


```
$ ./create-lwaftr1-testbed.sh
checking if docker network net-lwaftr1 already exists ... ok
need sudo privileges:
/home/mwiget/vmxlwaftr/tests
creating network net-lwaftr1 ...ok
adding IPv6 network for lwaftr1 ...  on br-d908e44e0b0c ok
adding static route to AFTR fd00:fd00:a516:7c1b:17cd:6d81:2137:bd2a:2c5b via gw fd0fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b ... ok
adding static route to 192.168.127.12/24 via 172.20.0.2 ... ok
Adding SNAT masquerading via interface eth0 all set.
```

### launchl vmxlwaftr  lwaftr1

Launch the vmxlwaftr Docker Container with the shell script [run-lwaftr1.sh](run-lwaftr1.sh). The container remains in the foreground. It uses the Junos configuration found in [lwaftr1.txt](lwaftr1.txt)
Log in with lab/lab123 and verify the PFE is operational:


```
FreeBSD/amd64 (lwaftr1) (ttyu0)
<commit_msg>embed diagram<commit_after># Test cases

This directory contains a few test cases with and without physical 10GE interfaces.

## lwaftr1 (no physical ports required)

This test creates a Docker virtual network 'net-lwaftr1' that connects the vmxlwaftr Container 
lwaftr1 with B4 client simulation Containers b4cpe1 and b4cpe2 according to the following
diagram: 

![net-lwaftr1 diagram](net-lwaftr1.png):

### Preparation

Create the Docker network net-lwaftr1 with the script [create-lwaftr1-testbed.sh](create-lwaftr1-testbed.sh). This creates a virtual bridge on the Linux host with IPv4 and dual IPv6 networks: one to cnnect to the vMX lwaftr1 and the other one to the B4 clients. The virtual bridge routes between
the IPv6 networks. This is required to simulate multiple B4 clients. The script finally sets up SNAT
masquerading to hide the simulated public IPv4 network behind the Docker engines host IP address.


```
$ ./create-lwaftr1-testbed.sh
checking if docker network net-lwaftr1 already exists ... ok
need sudo privileges:
/home/mwiget/vmxlwaftr/tests
creating network net-lwaftr1 ...ok
adding IPv6 network for lwaftr1 ...  on br-d908e44e0b0c ok
adding static route to AFTR fd00:fd00:a516:7c1b:17cd:6d81:2137:bd2a:2c5b via gw fd00:4fc00:e968:6179::de52:7100 ... ok
adding static route to 192.168.127.12/24 via 172.20.0.2 ... ok
Adding SNAT masquerading via interface eth0 all set.
```

### launchl vmxlwaftr  lwaftr1

Launch the vmxlwaftr Docker Container with the shell script [run-lwaftr1.sh](run-lwaftr1.sh). The container remains in the foreground. It uses the Junos configuration found in [lwaftr1.txt](lwaftr1.txt)
Log in with lab/lab123 and verify the PFE is operational:


```
FreeBSD/amd64 (lwaftr1) (ttyu0)

{'fraction_non_alphanumeric': 0.07377521613832853, 'fraction_numerical': 0.061671469740634005, 'mean_word_length': 4.653094462540716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2590356', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1178, 'n_words': 437}