These recipes were based on the initial version of LNST-next API
but are no more relevant because the API changed.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
pyrecipes/3_vlans.py | 34 -----------------------------
pyrecipes/example.py | 33 ----------------------------
pyrecipes/ping_flood.py | 48 -----------------------------------------
3 files changed, 115 deletions(-)
delete mode 100644 pyrecipes/3_vlans.py
delete mode 100644 pyrecipes/example.py
delete mode 100644 pyrecipes/ping_flood.py
diff --git a/pyrecipes/3_vlans.py b/pyrecipes/3_vlans.py
deleted file mode 100644
index 067fd33..0000000
--- a/pyrecipes/3_vlans.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import lnst
-
-def ping_mod_init(if1, if2):
- ping_mod = lnst.get_module("IcmpPing",
- options={
- "addr": if2.get_ip(0),
- "count": 10,
- "interval": 1,
- "iface" : if1.get_devname()})
- return ping_mod
-
-m1 = lnst.add_host()
-m2 = lnst.add_host()
-
-m1_eth1 = m1.add_interface(label="tnet")
-m2_eth1 = m2.add_interface(label="tnet")
-
-while lnst.match():
- m1.sync_resources(modules=["IcmpPing"])
- m2.sync_resources(modules=["IcmpPing"])
-
- m1_vlan10 = m1.create_vlan(realdev_iface=m1_eth1, vlan_tci="10",
ip="192.168.10.1/24")
- m1_vlan20 = m1.create_vlan(realdev_iface=m1_eth1, vlan_tci="20",
ip="192.168.20.1/24")
- m1_vlan30 = m1.create_vlan(realdev_iface=m1_eth1, vlan_tci="30",
ip="192.168.30.1/24")
-
- m2_vlan10 = m2.create_vlan(realdev_iface=m2_eth1, vlan_tci="10",
ip="192.168.10.2/24")
- m2_vlan20 = m2.create_vlan(realdev_iface=m2_eth1, vlan_tci="20",
ip="192.168.20.2/24")
- m2_vlan30 = m2.create_vlan(realdev_iface=m2_eth1, vlan_tci="30",
ip="192.168.30.2/24")
-
- ping_mod = ping_mod_init(m1_vlan10, m2_vlan10)
- ping_mod_bad = ping_mod_init(m1_vlan10, m2_vlan20)
-
- m1.run(ping_mod)
- #m1.run(ping_mod_bad)
diff --git a/pyrecipes/example.py b/pyrecipes/example.py
deleted file mode 100644
index 32c1b08..0000000
--- a/pyrecipes/example.py
+++ /dev/null
@@ -1,33 +0,0 @@
-import lnst
-
-# if1 ... src
-# if2 ... dst
-def ping_mod_init(if1, if2):
- ping_mod = lnst.get_module("IcmpPing",
- options={
- "addr": if2.get_ip(0),
- "count": 10,
- "interval": 1,
- "iface" : if1.get_devname()})
- return ping_mod
-
-m1 = lnst.add_host()
-m2 = lnst.add_host()
-
-m1_eth1 = m1.add_interface(label="tnet")
-m1_eth2 = m1.add_interface(label="tnet")
-m2_eth1 = m2.add_interface(label="tnet")
-
-while lnst.match():
- m1.sync_resources(modules=["IcmpPing"])
- m2.sync_resources(modules=["IcmpPing"])
- m2_eth1.reset(ip="192.168.0.2/24")
- ping = ping_mod_init(m1_eth1, m2_eth1)
- #lnst.breakpoint()
- team_if = m1.create_team(slaves=[m1_eth1, m1_eth2])
- #lnst.breakpoint()
- team_if.reset(ip="192.168.0.1/24")
- #lnst.breakpoint()
- ping = ping_mod_init(team_if, m2_eth1)
- #lnst.breakpoint()
- m1.run(ping)
diff --git a/pyrecipes/ping_flood.py b/pyrecipes/ping_flood.py
deleted file mode 100644
index 257f7eb..0000000
--- a/pyrecipes/ping_flood.py
+++ /dev/null
@@ -1,48 +0,0 @@
-import lnst
-
-m1 = lnst.add_host()
-m2 = lnst.add_host()
-
-m1_eth1 = m1.add_interface(label="tnet")
-m2_eth1 = m2.add_interface(label="tnet")
-
-while lnst.match():
- m1.sync_resources(modules=["Icmp6Ping", "IcmpPing"])
- m2.sync_resources(modules=["Icmp6Ping", "IcmpPing"])
-
- lnst.wait(15)
-
- ipv = lnst.get_alias("ipv", default="ipv4")
- print("ipv")
- print(ipv)
- mtu = lnst.get_alias("mtu", default="1500")
- print("mtu")
- print(mtu)
-
- m1_eth1.reset(ip=["192.168.101.10/24", "fc00:0:0:0::1/64"])
- m2_eth1.reset(ip=["192.168.101.11/24", "fc00:0:0:0::2/64"])
-
- ping_mod = lnst.get_module("IcmpPing",
- options={
- "addr": m2_eth1.get_ip(0),
- "count": 10,
- "interval": 0.1,
- "iface" : m1_eth1.get_devname(),
- "limit_rate": 90})
-
- ping_mod6 = lnst.get_module("Icmp6Ping",
- options={
- "addr": m2_eth1.get_ip(1),
- "count": 10,
- "interval": 0.1,
- "iface" : m1_eth1.get_devname(),
- "limit_rate": 90})
-
- m1_eth1.set_mtu(mtu)
- m2_eth1.set_mtu(mtu)
-
- if ipv in [ 'ipv6', 'both' ]:
- m1.run(ping_mod6)
-
- if ipv in ['ipv4', 'both' ]:
- m1.run(ping_mod)
--
2.21.1