[Goldeneye] BGPLS scripts
Change-Id: I1c263f5dc5b36c776c32f959278b88c848d46a9f
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py
new file mode 100755
index 0000000..abd1cfc
--- /dev/null
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py
@@ -0,0 +1,53 @@
+#!/usr/bin/python # This is server.py file
+from scapy.all import *
+import socket # Import socket module
+import time # Import Time module
+import sys
+import os
+
+path = os.getcwd()
+sys.path.append('OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies') #Setting the path for BgpLS
+from Nbdata import BgpLs
+
+obj = BgpLs()
+returnlist = obj.Constants()
+peerIp = returnlist[0][0]
+
+load_contrib('bgp')
+s = socket.socket() # Create a socket object
+host = peerIp # Get local machine name
+port = 179 # Reserve a port for your service.
+s.bind((host, port)) # Bind to the port
+pkts = rdpcap(path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls_all.pcap")
+pkts[69][BGPOpen].bgp_id = peerIp
+
+s.listen(5) # Now wait for client connection.
+
+print("starting Connecting to ONOS peer")
+c, addr = s.accept() # Establish connection with client.
+print 'Got connection from ONOS :', addr
+c.send(str(pkts[69][BGPHeader])) # OPEN MESSAGE
+c.recv(4096)
+c.send(str(pkts[71][BGPHeader]))# KEEPALIVE MESSAGE
+c.recv(4096)
+c.send(str(pkts[72][BGPHeader])) # UPDATE MESSAGES
+c.send(str(pkts[74][BGPHeader]))
+c.send(str(pkts[71][BGPHeader]))
+
+time.sleep(10) # Waiting for 120 seconds for update message.
+
+c.send(str(pkts[298][BGPHeader]))
+c.send(str(pkts[860][BGPHeader])) # UPDATE MESSAGES with new node
+c.send(str(pkts[865][BGPHeader]))
+print ("New Node update msg sent")
+
+time.sleep(5)
+c.send(str(pkts[890][BGPHeader]))
+print ("Node Delete msg sent")
+
+
+while True:
+ c.recv(4096)
+ c.send(str(pkts[71][BGPHeader]))
+
+ # c.close() # Close the connection
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Topo_discovery.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Topo_discovery.py
new file mode 100755
index 0000000..a7daf91
--- /dev/null
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Topo_discovery.py
@@ -0,0 +1,41 @@
+#!/usr/bin/python # This is server.py file
+from scapy.all import *
+import socket # Import socket module
+import time # Import Time module
+import sys
+import os
+
+path = os.getcwd()
+sys.path.append('OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies') #Setting the path for BgpLS
+from Nbdata import BgpLs
+
+obj = BgpLs()
+returnlist = obj.Constants()
+peerIp = returnlist[0][0]
+
+load_contrib('bgp')
+s = socket.socket() # Create a socket object
+host = peerIp # Get local machine name
+port = 179 # Reserve a port for your service.
+s.bind((host, port)) # Bind to the port
+pkts = rdpcap(path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls_all.pcap")
+pkts[69][BGPOpen].bgp_id = peerIp
+
+s.listen(5) # Now wait for client connection.
+
+print("starting Connecting to ONOS peer")
+c, addr = s.accept() # Establish connection with client.
+print 'Got connection from ONOS :', addr
+c.send(str(pkts[69][BGPHeader])) # OPEN MESSAGE
+c.recv(4096)
+c.send(str(pkts[71][BGPHeader]))# KEEPALIVE MESSAGE
+c.recv(4096)
+c.send(str(pkts[72][BGPHeader])) # UPDATE MESSAGES
+c.send(str(pkts[74][BGPHeader]))
+c.send(str(pkts[71][BGPHeader]))
+
+while True:
+ c.recv(4096)
+ c.send(str(pkts[71][BGPHeader]))
+
+ # c.close() # Close the connection
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Update_Node.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Update_Node.py
new file mode 100755
index 0000000..3a40d6c
--- /dev/null
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Update_Node.py
@@ -0,0 +1,48 @@
+#!/usr/bin/python # This is server.py file
+from scapy.all import *
+import socket # Import socket module
+import time # Import Time module
+import sys
+import os
+
+path = os.getcwd()
+sys.path.append('OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies') #Setting the path for BgpLS
+from Nbdata import BgpLs
+
+obj = BgpLs()
+returnlist = obj.Constants()
+peerIp = returnlist[0][0]
+
+load_contrib('bgp')
+s = socket.socket() # Create a socket object
+host = peerIp # Get local machine name
+port = 179 # Reserve a port for your service.
+s.bind((host, port)) # Bind to the port
+pkts = rdpcap(path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls_all.pcap")
+pkts[69][BGPOpen].bgp_id = peerIp
+
+s.listen(5) # Now wait for client connection.
+
+print("starting Connecting to ONOS peer")
+c, addr = s.accept() # Establish connection with client.
+print 'Got connection from ONOS :', addr
+c.send(str(pkts[69][BGPHeader])) # OPEN MESSAGE
+c.recv(4096)
+c.send(str(pkts[71][BGPHeader]))# KEEPALIVE MESSAGE
+c.recv(4096)
+c.send(str(pkts[72][BGPHeader])) # UPDATE MESSAGES
+c.send(str(pkts[74][BGPHeader]))
+c.send(str(pkts[71][BGPHeader]))
+
+time.sleep(10) # Waiting for 120 seconds for update message.
+
+c.send(str(pkts[298][BGPHeader]))
+c.send(str(pkts[860][BGPHeader])) # UPDATE MESSAGES with new node
+c.send(str(pkts[865][BGPHeader]))
+print ("New Node update msg sent")
+
+while True:
+ c.recv(4096)
+ c.send(str(pkts[71][BGPHeader]))
+
+ # c.close() # Close the connection
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/__init__.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/__init__.py
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/__init__.py