Skip to content

Commit 834726b

Browse files
pcn-nat: tests updated with the new notation for the routers
(from netmask to prefix len) Signed-off-by: Francesco Messina <francescomessina92@hotmail.com>
1 parent 1e2dc48 commit 834726b

17 files changed

+35
-35
lines changed

src/services/pcn-nat/test/examples/example1.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ create_veth_net 2
3636
polycubectl nat add nat1
3737
polycubectl router add r1
3838

39-
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip netmask=255.255.255.0
39+
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24
4040
polycubectl router r1 ports to_veth1 set peer=veth1
41-
polycubectl router r1 ports add to_nat1 ip=$to_nat_ip netmask=255.255.255.0
41+
polycubectl router r1 ports add to_nat1 ip=$to_nat_ip/24
4242

4343
polycubectl nat1 ports add to_r1 type=INTERNAL
4444
polycubectl connect nat1:to_r1 r1:to_nat1

src/services/pcn-nat/test/examples/example2.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ create_veth_net 2
3636
polycubectl nat add nat1
3737
polycubectl router add r1
3838

39-
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip netmask=255.255.255.0
39+
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24
4040
polycubectl router r1 ports to_veth1 set peer=veth1
41-
polycubectl router r1 ports add to_nat1 ip=$to_nat_ip netmask=255.255.255.0
41+
polycubectl router r1 ports add to_nat1 ip=$to_nat_ip/24
4242

4343
polycubectl nat1 ports add to_r1 type=INTERNAL
4444
polycubectl connect nat1:to_r1 r1:to_nat1

src/services/pcn-nat/test/examples/example3.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ create_veth_net 2
3838
polycubectl nat add nat1
3939
polycubectl router add r1
4040

41-
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip netmask=255.255.255.0
41+
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24
4242
polycubectl router r1 ports to_veth1 set peer=veth1
43-
polycubectl router r1 ports add to_nat1 ip=$to_nat_ip netmask=255.255.255.0
43+
polycubectl router r1 ports add to_nat1 ip=$to_nat_ip/24
4444

4545
polycubectl nat1 ports add to_r1 type=INTERNAL
4646
polycubectl connect nat1:to_r1 r1:to_nat1

src/services/pcn-nat/test/examples/example4.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ create_veth_net 2
5454
polycubectl nat add nat1
5555
polycubectl router add r1
5656

57-
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip netmask=255.255.255.0
57+
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24
5858
polycubectl router r1 ports to_veth1 set peer=veth1
59-
polycubectl router r1 ports add to_nat1 ip=$to_nat_ip netmask=255.255.255.0
59+
polycubectl router r1 ports add to_nat1 ip=$to_nat_ip/24
6060

6161
polycubectl nat1 ports add to_r1 type=INTERNAL
6262
polycubectl connect nat1:to_r1 r1:to_nat1

src/services/pcn-nat/test/test_all_dnat.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ create_veth_net 2
6060
polycubectl nat add nat1
6161
polycubectl router add r1
6262

63-
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip netmask=255.255.255.0 peer=veth1
64-
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip netmask=255.255.255.0 peer=veth2
63+
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24 peer=veth1
64+
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip/24 peer=veth2
6565

6666
polycubectl attach nat1 r1:to_veth2 position=first
6767

src/services/pcn-nat/test/test_all_pf.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ create_veth_net 2
6262
polycubectl nat add nat1
6363
polycubectl router add r1
6464

65-
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip netmask=255.255.255.0 peer=veth1
66-
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip netmask=255.255.255.0 peer=veth2
65+
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24 peer=veth1
66+
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip/24 peer=veth2
6767

6868
polycubectl attach nat1 r1:to_veth2 position=first
6969

src/services/pcn-nat/test/test_icmp_dnat.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ create_veth_net 2
3636
polycubectl nat add nat1
3737
polycubectl router add r1
3838

39-
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip netmask=255.255.255.0 peer=veth1
40-
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip netmask=255.255.255.0 peer=veth2
39+
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24 peer=veth1
40+
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip/24 peer=veth2
4141

4242
polycubectl attach nat1 r1:to_veth2 position=first
4343

src/services/pcn-nat/test/test_icmp_masq.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ create_veth_net 2
3535
polycubectl nat add nat1
3636
polycubectl router add r1
3737

38-
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip netmask=255.255.255.0 peer=veth1
39-
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip netmask=255.255.255.0 peer=veth2
38+
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24 peer=veth1
39+
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip/24 peer=veth2
4040

4141
polycubectl attach nat1 r1:to_veth2 position=first
4242

src/services/pcn-nat/test/test_icmp_snat.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ create_veth_net 2
3535
polycubectl nat add nat1
3636
polycubectl router add r1
3737

38-
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip netmask=255.255.255.0 peer=veth1
39-
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip netmask=255.255.255.0 peer=veth2
38+
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24 peer=veth1
39+
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip/24 peer=veth2
4040

4141
polycubectl attach nat1 r1:to_veth2 position=first
4242

4343
# configure source nat
4444
polycubectl nat1 rule snat append internal-net=10.0.1.0/24 external-ip=$to_veth2_ip
4545

46-
sudo ip netns exec ns1 ping $veth2_ip -c 3
46+
sudo ip netns exec ns1 ping $veth2_ip -c 3

src/services/pcn-nat/test/test_tcp_dnat.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ create_veth_net 2
5252
polycubectl nat add nat1
5353
polycubectl router add r1
5454

55-
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip netmask=255.255.255.0 peer=veth1
56-
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip netmask=255.255.255.0 peer=veth2
55+
polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24 peer=veth1
56+
polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip/24 peer=veth2
5757

5858
polycubectl attach nat1 r1:to_veth2 position=first
5959

0 commit comments

Comments
 (0)